diff options
| author | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2015-09-21 19:10:11 +0000 |
|---|---|---|
| committer | Johannes Doerfert <doerfert@cs.uni-saarland.de> | 2015-09-21 19:10:11 +0000 |
| commit | e526de5a47071d4cfb1ce181cc8ec3c575376588 (patch) | |
| tree | a5a8323256ecb49052b00a4c874ed814e61efeab /polly/lib/Analysis/ScopDetection.cpp | |
| parent | 510d7c71e2d60f9b5f5ba1c5c1123e9d5cd0070e (diff) | |
| download | bcm5719-llvm-e526de5a47071d4cfb1ce181cc8ec3c575376588.tar.gz bcm5719-llvm-e526de5a47071d4cfb1ce181cc8ec3c575376588.zip | |
Make MIN_LOOP_TRIP_COUNT a static constant
llvm-svn: 248192
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
| -rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index e32f267ec27..8a41891b1a4 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -159,6 +159,9 @@ static cl::opt<bool> AllowNonSCEVBackedgeTakenCount( 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, DetectionContext &Context) const { } /// @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) |

