[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:27:11 PDT 2025


shiltian wrote:

The LLVM Lang Ref says:

> The function of the data layout string may not be what you expect. Notably, this is not a specification from the frontend of what alignment the code generator should use.
>
> Instead, if specified, **the target data layout is required to match what the ultimate code generator expects**. This string is used by the mid-level optimizers to improve code, and this only works if it matches what the ultimate code generator uses.

My reading is, it has to match the ultimate code generator. Middle end optimization relies on it to improve the code.

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


More information about the llvm-branch-commits mailing list