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

Eli Friedman via cfe-commits cfe-commits at lists.llvm.org
Thu Sep 19 14:41:18 PDT 2024


efriedma-quic wrote:

> If DataLayout is still a good place, then it might be just about whether we call it a flat address space, or optimizable address space, and nothing would be different from what is done in this PR.

We've avoided putting optimization properties in the DataLayout in the past.  The interactions with LTO mean we want the DataLayout for a given subtarget to be stable.

In this particular case, a target's "flat" address-space can't really ever change, though, so it's probably fine.

> There are cases where you need a safe (portable?) default that the target can perhaps optimise, but, absent that, would at least work, and at the moment there's no handy way to query that generically (or from Clang).

The use-cases currently under discussion, and LangRef itself, don't require the flat address-space to have any particular semantics; the only property it has is "operations using it are slower".  What semantics do you need, and where do you need them?

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


More information about the cfe-commits mailing list