[PATCH] D152730: [ConstraintElim] Add A < B if A is an increasing phi for A != B.

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 18 08:00:33 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:1171
+        StepInst->getOperand(1) ==
+            ConstantInt::get(StepInst->getOperand(1)->getType(), 1)) {
+      StartValue = PN->getIncomingValue(1 - I);
----------------
This does not guarantee a step of 1, because you're missing the multiplication with the type alloc size here. And if you add that, it likely won't support the cases you're interested in any more.

It would probably be easier to handle integer inductions, pointers are more complicated.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152730



More information about the llvm-commits mailing list