[llvm-commits] [llvm] r167134 - /llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp

Nadav Rotem nrotem at apple.com
Wed Oct 31 09:22:16 PDT 2012


Author: nadav
Date: Wed Oct 31 11:22:16 2012
New Revision: 167134

URL: http://llvm.org/viewvc/llvm-project?rev=167134&view=rev
Log:
Put the threshold magic number in a variable.

Modified:
    llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp

Modified: llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp?rev=167134&r1=167133&r2=167134&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp (original)
+++ llvm/trunk/lib/Transforms/Vectorize/LoopVectorize.cpp Wed Oct 31 11:22:16 2012
@@ -75,6 +75,9 @@
 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 @@
 
   // 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;





More information about the llvm-commits mailing list