Thunk functions in Windows are varag functions that call a musttail function to pass the arguments after the fixup is done. We need to make sure that we forward the arguments from the caller vararg to the callee vararg function. This is the same mechanism that is used for Windows on X86.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
3152 | Please do this for all OSs, not just windows. This is a general purpose feature that is supposed to work for all targets, it's just only implemented for one right now. | |
3158 | Neat, I guess the code I wrote to find all the remaining regparms was generic enough to work for any convention. | |
3622 | Please remove the IsWin64 test so we just do this all the time. One day, someone will come asking to use this on AArch64, probably. | |
test/CodeGen/AArch64/vararg-tallcall.ll | ||
1 | If it works, test some other targets, especially if the default calling convention changes based on OS. |
Testcase should also check that the vector registers are correctly saved/restored. (Something like call void asm sideeffect "", "~{d0}"() should force a spill.) It looks like the code handles this correctly already.
Otherwise LGTM.
Please do this for all OSs, not just windows. This is a general purpose feature that is supposed to work for all targets, it's just only implemented for one right now.