[Mlir-commits] [mlir] [mlir][DataLayout] Add a default memory space entry to the data layout. (PR #127416)

Rolf Morel llvmlistbot at llvm.org
Thu Mar 6 06:32:02 PST 2025


================
@@ -318,7 +318,8 @@ combineOneSpec(DataLayoutSpecInterface spec,
            "unexpected data layout entry for built-in type");
 
     auto interface = cast<DataLayoutTypeInterface>(typeSample);
-    if (!interface.areCompatible(entriesForType.lookup(kvp.first), kvp.second))
+    if (!interface.areCompatible(entriesForType.lookup(kvp.first), kvp.second,
----------------
rolfmorel wrote:

Great example of why these key identifiers should probably just be static. Do they even combine if the default identifiers don't match? And how does it work in the following case:

```
DL1  /*interface methods*/ [default_identifier = "dlti.default_memory_space"] {
DL2 /*interface methods*/ [default_identifier = "my_dlti.default_memory_space"] /*data layout entries*/ {
DL3  /*interface methods*/ [default_identifier = "dlti.default_memory_space"] <ptr spec> {
  # ptr usage
}
}
}
```
Does your code do the right thing when `curSpec` becomes DL3 in the last `combineOneSpec` call?

Point taken about this being a complex issue. How about you create a Github issue and link to it from a TODO in this PR. I am afraid otherwise GH issues are way too easy to lose track off.

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


More information about the Mlir-commits mailing list