[PATCH] D103991: [SCEV] Move mustprogress based no-self-wrap logic so it applies to all exit conditions

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 18 09:09:53 PST 2021


reames added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:8335
+      if (AR->getLoop() == L && AR->isAffine() && StrideC &&
+          StrideC->getAPInt().isPowerOf2()) {
+        auto Flags = AR->getNoWrapFlags();
----------------
nikic wrote:
> Also check that the NW flag isn't already set?
Oh, good catch.  


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:11844
     return loopIsFiniteByAssumption(L);
   };
 
----------------
nikic wrote:
> Maybe you want to extract canAsusmeNoSelfWrap as a static function and reuse? You repeat the same conditions in the new code, just without the comments.
I'm hoping to delete it in a following commit.  I replicated the explanation that seemed relevant, and the remaining use looks highly suspect.  (I wrote the remaining use, and I'm not convinced by my own comments.  At a minimum, I want to rework the comments.)


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103991/new/

https://reviews.llvm.org/D103991



More information about the llvm-commits mailing list