[Mlir-commits] [mlir] [mlir][Ptr] Don't assert when the default memory space isn't a MemorySpaceAttrInterface (PR #217512)
Fabian Mora
llvmlistbot at llvm.org
Thu Aug 20 05:34:31 PDT 2026
================
@@ -147,3 +147,25 @@ module attributes { dlti.dl_spec = #dlti.dl_spec<
return
}
}
+
+// -----
+
+// Regression test for https://github.com/llvm/llvm-project/issues/217170:
+// the default memory space in the data layout does not have to implement
+// `MemorySpaceAttrInterface` (e.g. it may be a plain integer attribute).
+// Querying a pointer type whose memory space differs from that default
+// memory space used to crash instead of falling back to the default
+// pointer spec.
----------------
fabianmcg wrote:
NIT: Always prefer "to the point" comments.
```suggestion
// querying the ptr layout caused a crash when the default memory space was not
// a `MemorySpaceAttrInterface` (e.g. a plain `i32` attr).
```
https://github.com/llvm/llvm-project/pull/217512
More information about the Mlir-commits
mailing list