summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
diff options
context:
space:
mode:
authorNadav Rotem <nrotem@apple.com>2012-10-31 16:22:16 +0000
committerNadav Rotem <nrotem@apple.com>2012-10-31 16:22:16 +0000
commitec3ab49dda1767bc8b2b8744685c573758dff547 (patch)
tree091b997812cd86fb47164165af2551061a4b77ed /llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
parent1caa6f9575abe3dc0d0243292c8ea3fd2f8336f2 (diff)
downloadbcm5719-llvm-ec3ab49dda1767bc8b2b8744685c573758dff547.tar.gz
bcm5719-llvm-ec3ab49dda1767bc8b2b8744685c573758dff547.zip
Put the threshold magic number in a variable.
llvm-svn: 167134
Diffstat (limited to 'llvm/lib/Transforms/Vectorize/LoopVectorize.cpp')
-rw-r--r--llvm/lib/Transforms/Vectorize/LoopVectorize.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp b/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
index 40235ef1043..94e56a17131 100644
--- a/llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud