[PATCH] D42835: [SCEV] Make isLoopEntryGuardedByCond a bit smarter

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 6 00:03:21 PST 2018


sanjoy accepted this revision.
sanjoy added a comment.
This revision is now accepted and ready to land.

LGTM with the comment addressed.



================
Comment at: lib/Analysis/ScalarEvolution.cpp:9109
+  if (Pred != NonStrictPredicate &&
+      isLoopEntryGuardedByCond(L, ICmpInst::ICMP_NE, LHS, RHS) &&
+      isLoopEntryGuardedByCond(L, NonStrictPredicate, LHS, RHS))
----------------
I'm sorry I didn't notice this before, but I think this is better to "fuse" this into the iteration we're already doing instead of recursing (which will walk the dominating checks again).  Perhaps extract out a lambda that you call instead of `isImpliedCond` in this function that has this bit of logic too?


https://reviews.llvm.org/D42835





More information about the llvm-commits mailing list