[PATCH] D100566: [SCEV] Add a ad-hoc pattern on isImpliedCondBalancedTypes

JinGu Kang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 26 04:07:23 PDT 2021


jaykang10 added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:10470
+             !StepCst->getValue()->isNegative()) ||
+            AddRec->getNoWrapFlags(SCEV::FlagNUW)) {
+          const auto *NewFoundLHS = cast<SCEVAddRecExpr>(FoundLHS)->getStart();
----------------
nikic wrote:
> This still isn't right: the required nowrap flag depends on the predicate. If you have `NewFoundPred = ICMP_SLE`, then you need nsw. If you have `NewFoundPred = ICMP_ULE`, then you need nuw.
Oops! sorry, you are right! It looks the unsigned predicate with constant is transformed with `SimplifyICmpOperands` earlier. Let's just handle signed case. 


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

https://reviews.llvm.org/D100566



More information about the llvm-commits mailing list