- /// hasLoopInvariantIterationCount - Return true if the specified loop has
- /// an analyzable loop-invariant iteration count.
- bool hasLoopInvariantIterationCount(const Loop *L);
-
- /// getIterationCount - If the specified loop has a predictable iteration
- /// count, return it. Note that it is not valid to call this method on a
- /// loop without a loop-invariant iteration count.
- SCEVHandle getIterationCount(const Loop *L);
+ /// hasLoopInvariantBackedgeTakenCount - Return true if the specified loop
+ /// has an analyzable loop-invariant backedge-taken count.
+ bool hasLoopInvariantBackedgeTakenCount(const Loop *L);
+
+ /// 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, or if the loop
+ /// is deleted.
+ void forgetLoopBackedgeTakenCount(const Loop *L);
+
+ /// 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);