[clang] [lld] [llvm] [mlir] [IR] Introduce `T<address space>` to `DataLayout` to represent flat address space if a target supports it (PR #108786)

Jessica Clarke via cfe-commits cfe-commits at lists.llvm.org
Sun Sep 15 20:20:43 PDT 2024


================
@@ -245,6 +246,7 @@ class DataLayout {
   unsigned getDefaultGlobalsAddressSpace() const {
     return DefaultGlobalsAddrSpace;
   }
+  unsigned getFlatAddressSpace() const { return FlatAddressSpace; }
----------------
jrtc27 wrote:

> The absence of this specification indicates the target does not have such a flat address space to optimize away.

Yet this isn't an optional? Is the expectation that callers check against a magic ~0U sentinel? (Is there precedent for that in DataLayout?)

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


More information about the cfe-commits mailing list