[llvm-branch-commits] [llvm] [Attributor] Use `getAllocaAddrSpace` to get address space for `AllocaInst` (PR #136865)
Matt Arsenault via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Apr 23 07:16:03 PDT 2025
arsenm wrote:
> If the data layout doesn't match the target, the module is already broken to begin with, and any optimization that relies on data layout information can't be expected to work correctly.
This is not how the semantics of the datalayout works, particularly with the alloca addrspace. The datalayout is not asserting allocas must use this address space. It tells you nothing other than if you are creating a temporary variable, generic code should use this address space.
> If that's the case, what's the point of having a data layout at all? Why don't just pull every piece of information from the backend anyway?
Part of the point of the datalayout is to have semantics independent of the backend. The IR has standalone semantics.
https://github.com/llvm/llvm-project/pull/136865
More information about the llvm-branch-commits
mailing list