diff options
author | Dan Gohman <gohman@apple.com> | 2009-02-24 18:55:53 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-02-24 18:55:53 +0000 |
commit | 46bdfb0e6bb9de86b19562fc52fddefd7014cf73 (patch) | |
tree | a8f92be55af923205fbf9436d25b7544215c44bb /lib/Transforms/Scalar/LoopStrengthReduce.cpp | |
parent | 57f0db833dc30404f1f5d28b23df326e520698ec (diff) |
Rename ScalarEvolution's getIterationCount to getBackedgeTakenCount,
to more accurately describe what it does. Expand its doxygen comment
to describe what the backedge-taken count is and how it differs
from the actual iteration count of the loop. Adjust names and
comments in associated code accordingly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65382 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LoopStrengthReduce.cpp')
-rw-r--r-- | lib/Transforms/Scalar/LoopStrengthReduce.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/lib/Transforms/Scalar/LoopStrengthReduce.cpp b/lib/Transforms/Scalar/LoopStrengthReduce.cpp index 0d6df2fbae..641f9b0e5c 100644 --- a/lib/Transforms/Scalar/LoopStrengthReduce.cpp +++ b/lib/Transforms/Scalar/LoopStrengthReduce.cpp @@ -2351,13 +2351,13 @@ ICmpInst *LoopStrengthReduce::OptimizeSMax(Loop *L, ICmpInst *Cond, SelectInst *Sel = dyn_cast<SelectInst>(Cond->getOperand(1)); if (!Sel || !Sel->hasOneUse()) return Cond; - SCEVHandle IterationCount = SE->getIterationCount(L); - if (isa<SCEVCouldNotCompute>(IterationCount)) + SCEVHandle BackedgeTakenCount = SE->getBackedgeTakenCount(L); + if (isa<SCEVCouldNotCompute>(BackedgeTakenCount)) return Cond; - SCEVHandle One = SE->getIntegerSCEV(1, IterationCount->getType()); + SCEVHandle One = SE->getIntegerSCEV(1, BackedgeTakenCount->getType()); - // Adjust for an annoying getIterationCount quirk. - IterationCount = SE->getAddExpr(IterationCount, One); + // Add one to the backedge-taken count to get the trip count. + SCEVHandle IterationCount = SE->getAddExpr(BackedgeTakenCount, One); // Check for a max calculation that matches the pattern. SCEVSMaxExpr *SMax = dyn_cast<SCEVSMaxExpr>(IterationCount); @@ -2412,8 +2412,8 @@ ICmpInst *LoopStrengthReduce::OptimizeSMax(Loop *L, ICmpInst *Cond, /// inside the loop then try to eliminate the cast opeation. void LoopStrengthReduce::OptimizeShadowIV(Loop *L) { - SCEVHandle IterationCount = SE->getIterationCount(L); - if (isa<SCEVCouldNotCompute>(IterationCount)) + SCEVHandle BackedgeTakenCount = SE->getBackedgeTakenCount(L); + if (isa<SCEVCouldNotCompute>(BackedgeTakenCount)) return; for (unsigned Stride = 0, e = StrideOrder.size(); Stride != e; |