[PATCH] D109091: [SCEV] Further clarify comments regarding UB and zero stride

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 1 14:10:36 PDT 2021


reames created this revision.
reames added reviewers: eli.friedman, nikic, fhahn.
Herald added subscribers: bollu, hiraditya, mcrosier.
reames requested review of this revision.
Herald added a project: LLVM.

Follow on to D109029 <https://reviews.llvm.org/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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D109091

Files:
  llvm/lib/Analysis/ScalarEvolution.cpp


Index: llvm/lib/Analysis/ScalarEvolution.cpp
===================================================================
--- llvm/lib/Analysis/ScalarEvolution.cpp
+++ llvm/lib/Analysis/ScalarEvolution.cpp
@@ -11632,9 +11632,9 @@
     //
     // 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)
+    // b) 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.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D109091.370053.patch
Type: text/x-patch
Size: 790 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210901/6ae14368/attachment.bin>


More information about the llvm-commits mailing list