[llvm-branch-commits] [llvm] [Attributor] Use `getAllocaAddrSpace` to get address space for `AllocaInst` (PR #136865)

Shilei Tian via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Wed Apr 23 07:11:05 PDT 2025


shiltian wrote:

> The address space should just come directly from the alloca. You don't know if it's correct to just replace the addrspace with whatever the datalayout says is the alloca addrspace. The datalayout value is for new allocas where the code has no additional context

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. 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?

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


More information about the llvm-branch-commits mailing list