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

Letu Ren llvmlistbot at llvm.org
Tue Sep 22 13:54:40 PDT 2026


================
@@ -463,3 +463,20 @@ llvm.func @empty_struct_not_destructured() -> !llvm.struct<()> {
   %2 = llvm.load %1 : !llvm.ptr -> !llvm.struct<()>
   llvm.return %2 : !llvm.struct<()>
 }
+
+// -----
+
+// inrange is defined relative to the GEP result, so SROA must keep it on the
+// rewritten GEP even when the new GEP would otherwise fold (offset 0).
----------------
FantasqueX wrote:

I agree. I changed the logic. If SROA check meets a GEP with `inrange` attr, it will say that "cannot replace!" and SROA will leave it as is. I'm not sure whether this is a good way to bail out though.

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


More information about the Mlir-commits mailing list