aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-02-24 18:55:53 +0000
committerDan Gohman <gohman@apple.com>2009-02-24 18:55:53 +0000
commit46bdfb0e6bb9de86b19562fc52fddefd7014cf73 (patch)
treea8f92be55af923205fbf9436d25b7544215c44bb /include
parent57f0db833dc30404f1f5d28b23df326e520698ec (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 'include')
-rw-r--r--include/llvm/Analysis/ScalarEvolution.h28
1 files changed, 19 insertions, 9 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h
index b001077ca7..0b148da56f 100644
--- a/include/llvm/Analysis/ScalarEvolution.h
+++ b/include/llvm/Analysis/ScalarEvolution.h
@@ -298,18 +298,28 @@ namespace llvm {
bool isLoopGuardedByCond(const Loop *L, ICmpInst::Predicate Pred,
SCEV *LHS, SCEV *RHS);
- /// getIterationCount - If the specified loop has a predictable iteration
- /// count, return it, otherwise return a SCEVCouldNotCompute object.
- SCEVHandle getIterationCount(const Loop *L) const;
+ /// getBackedgeTakenCount - If the specified loop has a predictable
+ /// backedge-taken count, return it, otherwise return a SCEVCouldNotCompute
+ /// object. The backedge-taken count is the number of times the loop header
+ /// will be branched to from within the loop. This is one less than the
+ /// trip count of the loop, since it doesn't count the first iteration,
+ /// when the header is branched to from outside the loop.
+ ///
+ /// Note that it is not valid to call this method on a loop without a
+ /// loop-invariant backedge-taken count (see
+ /// hasLoopInvariantBackedgeTakenCount).
+ ///
+ SCEVHandle getBackedgeTakenCount(const Loop *L) const;
- /// hasLoopInvariantIterationCount - Return true if the specified loop has
- /// an analyzable loop-invariant iteration count.
- bool hasLoopInvariantIterationCount(const Loop *L) const;
+ /// hasLoopInvariantBackedgeTakenCount - Return true if the specified loop
+ /// has an analyzable loop-invariant backedge-taken count.
+ bool hasLoopInvariantBackedgeTakenCount(const Loop *L) const;
- /// forgetLoopIterationCount - This method should be called by the
+ /// forgetLoopBackedgeTakenCount - This method should be called by the
/// client when it has changed a loop in a way that may effect
- /// ScalarEvolution's ability to compute a trip count.
- void forgetLoopIterationCount(const Loop *L);
+ /// ScalarEvolution's ability to compute a trip count, or if the loop
+ /// is deleted.
+ void forgetLoopBackedgeTakenCount(const Loop *L);
/// deleteValueFromRecords - This method should be called by the
/// client before it removes a Value from the program, to make sure