[PATCH] D90926: [SCEV] Don't use not expressions for implied conditions

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 6 10:00:39 PST 2020


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/ScalarEvolution.cpp:10552-10554
-         isImpliedCondOperandsHelper(Pred, LHS, RHS,
-                                     getNotSCEV(FoundRHS),
-                                     getNotSCEV(FoundLHS));
----------------
lebedev.ri wrote:
> What happens if the predicate is swapped instead of operands?
It's not possible to swap the predicate at this point, because this code already works on a single matching predicate only.

However, I think your general idea here is right. I've updated the patch to preserve this transform, but at a higher level: When we try to line up a predicate and a swapped predicate, using this approach allows us to do a "double swap" and thus avoid changing operand order. That allows us to preserve canonical operand ordering, and thus prove useful facts.

Because this is done at a higher level, we'll also try to apply more types of reasoning to the not-ed version.


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

https://reviews.llvm.org/D90926



More information about the llvm-commits mailing list