[PATCH] D139289: [SCCP] Propagate equality or inequality state of a not-constant

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 5 03:23:53 PST 2022


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/SCCPSolver.cpp:1330
+                         ? ValueLatticeElement::getNot(CondVal.getConstant())
+                         : ValueLatticeElement::get(CondVal.getConstant()));
         return;
----------------
StephenFan wrote:
> nikic wrote:
> > nikic wrote:
> > > Shouldn't this be getNotConstant()? Probably missing test coverage, I'd expect this to assert.
> > Actually, isn't this case entirely incorrect? If `A != B` and `B != C`, then that does not imply that `A == C`, right?
> Yes, you are right. Thanks!
Could you please still add a test for this, to make sure the optimization does not happen?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139289



More information about the llvm-commits mailing list