[clang] [Clang][CodeGen] Emit alignment information for indirect arguments (PR #201999)
Sayan Sivakumaran via cfe-commits
cfe-commits at lists.llvm.org
Tue Jun 9 08:28:05 PDT 2026
================
@@ -3061,13 +3061,9 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
//
// This is different from indirect *not* byval, where the object
// exists already, and the align attribute is purely
- // informative.
+ // informative (but is still useful for optimization passes).
----------------
sivakusayan wrote:
Yes, if I'm reading this correctly we know this from this [chunk of code](https://github.com/llvm/llvm-project/blob/fe2f7e40994574dd5d7efa4da8be5d9237905416/clang/lib/CodeGen/CGCall.cpp#L5641) inside of `EmitCall()`. In particular, since we aren't byval we create the [aligned temporary here](https://github.com/llvm/llvm-project/blob/fe2f7e40994574dd5d7efa4da8be5d9237905416/clang/lib/CodeGen/CGCall.cpp#L5713). Godbolt [shows an example](https://godbolt.org/z/o3GYMn69Y) of this if we use the linked ticket's code sample, looking at the top of the unoptimized `qux`.
Let me add a better comment here, I'm not sure if there is a useful `assert` that I can add but I'll check.
https://github.com/llvm/llvm-project/pull/201999
More information about the cfe-commits
mailing list