[clang] [lld] [llvm] [mlir] [IR] Introduce `T<address space>` to `DataLayout` to represent flat address space if a target supports it (PR #108786)
Alex Voicu via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 19 08:52:21 PDT 2024
AlexVlx wrote:
> +1 to @efriedma-quic and @jdoerfert's comments. DataLayout should remain as generic as possible. Trying to encode a concept of "_the_ flat address space" in it seems way too specific to one optimization for one or two targets.
This isn't purely a nice to have optimisation aid though, is it? 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). We do handwave 0 as being that safe default, and hope for the best, but as mentioned that relies on targets using 0 to correspond to flat/generic/whatever we call it, which they are not bound to do. To me, adding this is not entirely different from encoding the Alloca AS, which we already do.
https://github.com/llvm/llvm-project/pull/108786
More information about the cfe-commits
mailing list