diff options
author | Nadav Rotem <nrotem@apple.com> | 2012-10-31 16:22:16 +0000 |
---|---|---|
committer | Nadav Rotem <nrotem@apple.com> | 2012-10-31 16:22:16 +0000 |
commit | 4c1b4b1fe794437cbb245b11650d9e4001c9605e (patch) | |
tree | cd901f8477d25b39bbf462e260366f0763b9bb1e | |
parent | f772f0780252c4d12fbc87da75d51c35ec8c1ac6 (diff) | |
download | external_llvm-4c1b4b1fe794437cbb245b11650d9e4001c9605e.zip external_llvm-4c1b4b1fe794437cbb245b11650d9e4001c9605e.tar.gz external_llvm-4c1b4b1fe794437cbb245b11650d9e4001c9605e.tar.bz2 |
Put the threshold magic number in a variable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167134 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Transforms/Vectorize/LoopVectorize.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Transforms/Vectorize/LoopVectorize.cpp b/lib/Transforms/Vectorize/LoopVectorize.cpp index 40235ef..94e56a1 100644 --- a/lib/Transforms/Vectorize/LoopVectorize.cpp +++ b/lib/Transforms/Vectorize/LoopVectorize.cpp @@ -75,6 +75,9 @@ static cl::opt<unsigned> VectorizationFactor("force-vector-width", cl::init(0), cl::Hidden, cl::desc("Set the default vectorization width. Zero is autoselect.")); +/// We don't vectorize loops with a known constant trip count below this number. +const int TinyTripCountThreshold = 16; + namespace { // Forward declarations. @@ -1147,7 +1150,7 @@ bool LoopVectorizationLegality::canVectorize() { // Do not loop-vectorize loops with a tiny trip count. unsigned TC = SE->getSmallConstantTripCount(TheLoop, BB); - if (TC > 0 && TC < 16) { + if (TC > 0 && TC < TinyTripCountThreshold) { DEBUG(dbgs() << "LV: Found a loop with a very small trip count. " << "This loop is not worth vectorizing.\n"); return false; |