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

Mehdi Amini llvmlistbot at llvm.org
Mon Feb 17 05:38:46 PST 2025


================
@@ -246,6 +246,17 @@ Attribute mlir::detail::getDefaultEndianness(DataLayoutEntryInterface entry) {
   return entry.getValue();
 }
 
+// Returns the default memory space if specified in the given entry. If the
+// entry is empty the default memory space represented by an empty attribute is
+// returned.
+Attribute mlir::detail::getDefaultMemorySpace(DataLayoutEntryInterface entry) {
+  if (entry == DataLayoutEntryInterface()) {
----------------
joker-eph wrote:

```suggestion
  if (!entry)
```

That should work right?

(also drop spurious braces)

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


More information about the Mlir-commits mailing list