[PATCH] D91535: [IndVars] Use isLoopBackedgeGuardedByCond for last iteration check

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 20:14:21 PST 2020


skatkov accepted this revision.
skatkov added inline comments.
This revision is now accepted and ready to land.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:9642
   // Does it still meet the requirement?
-  if (!isKnownPredicateAt(Pred, Last, RHS, Context))
+  if (!isLoopBackedgeGuardedByCond(L, Pred, Last, RHS))
     return None;
----------------
mkazantsev wrote:
> skatkov wrote:
> > The only concern I have: whether isLoopBackedgeGuardedByCond always produces better result than isKnownPredicateAt.
> I ran 4077 fuzzer-generated test with assert that whenever the new condition is false, the old condition is also false. Theoretically, this might happen. But it's just a reason to make `isLoopBackedgeGuardedByCond` smarter.
I hope no one test failed :)


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

https://reviews.llvm.org/D91535



More information about the llvm-commits mailing list