Skip to content

Commit

Permalink
[SCEV] Further clarify comments regarding UB and zero stride
Browse files Browse the repository at this point in the history
Follow on to D109029. I realized we had no mention of mustprogrress in the comment (as it prexisted mustprogress in the codebase). In the process of adding it, I tweaked the preconditions into something I think is more clear. Note that mustprogress is checked in the code.

Differential Revision: https://reviews.llvm.org/D109091
  • Loading branch information
preames committed Sep 7, 2021
1 parent ee903a2 commit 9659069
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Analysis/ScalarEvolution.cpp
Expand Up @@ -11631,9 +11631,9 @@ ScalarEvolution::howManyLessThans(const SCEV *LHS, const SCEV *RHS,
//
// a) IV is either nuw or nsw depending upon signedness (indicated by the
// NoWrap flag).
// b) loop is single exit with no side effects.
// c) loop has no abnormal exits
//
// b) the loop is guaranteed to be finite (e.g. is mustprogress and has
// no side effects within the loop)
// c) loop has a single static exit (with no abnormal exits)
//
// Precondition a) implies that if the stride is negative, this is a single
// trip loop. The backedge taken count formula reduces to zero in this case.
Expand Down

0 comments on commit 9659069

Please sign in to comment.