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

Max Kazantsev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 22 22:27:49 PDT 2021


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

LGTM, thanks!



================
Comment at: llvm/unittests/Analysis/ScalarEvolutionTest.cpp:1411
+                                  ICmpInst::ICMP_SGT, AddRec_0_1, Zero));
+    // {0,+,-1}<nw> < -1  =>  {0,+,1}<nuw><nsw> > 0
+    EXPECT_TRUE(isImpliedCond(SE, ICmpInst::ICMP_SGT, AddRec_0_1, Zero,
----------------
nikic wrote:
> mkazantsev wrote:
> > I think it can be strengthened to `{0,+,1}<nuw><nsw> > 1`, no?
> We should be able to prove that, but don't. After negation, we'll try both `{0,+,-1}<nw> < -1 ->  {-1,+,-1}<nw> < -2` and `{-1,+,1}<nsw> > 0  ->  {0,+,1}<nuw><nsw> > 1`, but can't prove either.
Wow, that expands the horizons of SCEV's ignorance :)


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

https://reviews.llvm.org/D90926



More information about the llvm-commits mailing list