[Mlir-commits] [mlir] [MLIR][LLVM] Support inrange in GEP (PR #220424)

Letu Ren llvmlistbot at llvm.org
Tue Sep 22 13:50:59 PDT 2026


================
@@ -695,7 +695,9 @@ bool LLVM::GEPOp::canUsesBeRemoved(
     SmallVectorImpl<OpOperand *> &newBlockingUses,
     const DataLayout &dataLayout) {
   // GEP can be removed as long as it is a no-op and its users can be removed.
-  if (!hasAllZeroIndices(*this))
+  // `inrange` is defined relative to the GEP result, so a zero-index GEP is
+  // not a no-op when that would drop the qualifier.
----------------
FantasqueX wrote:

Fixed.

https://github.com/llvm/llvm-project/pull/220424


More information about the Mlir-commits mailing list