[polly] r248192 - Make MIN_LOOP_TRIP_COUNT a static constant

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 21 12:10:12 PDT 2015


Author: jdoerfert
Date: Mon Sep 21 14:10:11 2015
New Revision: 248192

URL: http://llvm.org/viewvc/llvm-project?rev=248192&view=rev
Log:
Make MIN_LOOP_TRIP_COUNT a static constant

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=248192&r1=248191&r2=248192&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Mon Sep 21 14:10:11 2015
@@ -159,6 +159,9 @@ static cl::opt<bool> AllowNonSCEVBackedg
     cl::desc("Allow loops even if SCEV cannot provide a trip count"),
     cl::Hidden, cl::init(true), cl::ZeroOrMore, cl::cat(PollyCategory));
 
+/// @brief The minimal trip count under which loops are considered unprofitable.
+static const unsigned MIN_LOOP_TRIP_COUNT = 8;
+
 bool polly::PollyTrackFailures = false;
 bool polly::PollyDelinearize = false;
 StringRef polly::PollySkipFnAttr = "polly.skip.fn";
@@ -730,13 +733,13 @@ bool ScopDetection::isValidLoop(Loop *L,
 }
 
 /// @brief Return the number of loops in @p L (incl. @p L) that have a trip
-///        count that is not known to be less than 8.
+///        count that is not known to be less than MIN_LOOP_TRIP_COUNT.
 static unsigned countBeneficialLoops(Loop *L, ScalarEvolution &SE) {
   auto *TripCount = SE.getBackedgeTakenCount(L);
 
   auto count = 1;
   if (auto *TripCountC = dyn_cast<SCEVConstant>(TripCount))
-    if (TripCountC->getValue()->getZExtValue() < 8)
+    if (TripCountC->getValue()->getZExtValue() < MIN_LOOP_TRIP_COUNT)
       count -= 1;
 
   for (auto &SubLoop : *L)




More information about the llvm-commits mailing list