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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 18 20:12:42 PST 2020


mkazantsev requested review of this revision.
mkazantsev added inline comments.


================
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;
----------------
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.


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

https://reviews.llvm.org/D91535



More information about the llvm-commits mailing list