diff options
author | Nadav Rotem <nrotem@apple.com> | 2013-01-09 01:15:42 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2013-01-09 01:15:42 +0000 |
commit | b696c36fcd94339787d979c4ed6fb8cc9b83afdd (patch) | |
tree | 0a8341f8831b3b5cf92603209af9f8e30d3671f4 /llvm/lib/Transforms/Vectorize | |
parent | 5e111fe533597a4bc46d69ad66f6d0c6b3c31689 (diff) | |
download | bcm5719-llvm-b696c36fcd94339787d979c4ed6fb8cc9b83afdd.tar.gz bcm5719-llvm-b696c36fcd94339787d979c4ed6fb8cc9b83afdd.zip |
Cost Model: Move the 'max unroll factor' variable to the TTI and add initial Cost Model support on ARM.
llvm-svn: 171928
Diffstat (limited to 'llvm/lib/Transforms/Vectorize')
-rw-r--r-- | llvm/lib/Transforms/Vectorize/LoopVectorize.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp index 9c82cb8dca1..c29f416be7e 100644 --- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -116,9 +116,6 @@ static const unsigned RuntimeMemoryCheckThreshold = 4; /// This is the highest vector width that we try to generate. static const unsigned MaxVectorSize = 8; -/// This is the highest Unroll Factor. -static const unsigned MaxUnrollSize = 4; - namespace { // Forward declarations. @@ -2715,6 +2712,8 @@ LoopVectorizationCostModel::selectUnrollFactor(bool OptForSize, UF = std::min(UF, (MaxLoopSizeThreshold / R.NumInstructions)); // Clamp the unroll factor ranges to reasonable factors. + unsigned MaxUnrollSize = TTI.getMaximumUnrollFactor(); + if (UF > MaxUnrollSize) UF = MaxUnrollSize; else if (UF < 1) |