[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
Thu Jun 29 08:28:36 PDT 2023


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/ConstraintElimination.cpp:1218
+    auto *UpperGEP = dyn_cast<GetElementPtrInst>(B);
+    if (!UpperGEP || UpperGEP->getPointerOperand() != StartValue)
+      return;
----------------
I think you need to require inbounds here as well. Otherwise, for non-power-of-two steps, you don't have a guarantee that the end value will be hit without wrapping (just that it is hit eventually).


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