[llvm] [ConstraintElimination] Elide redundant bounds checks in canonical loops (PR #221028)
Alina Sbirlea via llvm-commits
llvm-commits at lists.llvm.org
Sat Sep 12 22:56:09 PDT 2026
================
@@ -556,6 +556,15 @@ static Decomposition decompose(Value *V, const ConstraintInfo &Info,
if (!Ty->isIntegerTy() || Ty->getIntegerBitWidth() > 64)
return V;
+ if (!IsSigned) {
+ Value *PtrOp;
+ if (match(V, m_PtrToInt(m_Value(PtrOp))) &&
+ DL.getTypeSizeInBits(Ty) ==
+ DL.getIndexTypeSizeInBits(PtrOp->getType())) {
+ return decompose(PtrOp, Info, IsSigned, DL);
+ }
----------------
alinas wrote:
Yup, confirmed this is wrong.
Tests would fold the icmp to true: https://godbolt.org/z/7dKs7h5Ts
https://github.com/llvm/llvm-project/pull/221028
More information about the llvm-commits
mailing list