[clang] [clang][CodeGen][X86_64] Honor per-function AVX ABI in C/C++ call paths, maintain old psABI for PlayStation. (PR #193298)
Benjamin Luke via cfe-commits
cfe-commits at lists.llvm.org
Thu Apr 23 16:54:59 PDT 2026
freaknbigpanda wrote:
>It should be clear enough if we pretty-print the avx modifier as part of the calling convention. Something similar on Arm:
Yes this would work. GCC doesn't have this limitation though so I wonder if it is strictly required. It is less user friendly to
>gcc, as far as I can tell, uses the caller's target attribute to determine whether to use AVX to pass arguments. And spits a warning whenever you try to pass an AVX-ABI vector without AVX enabled. Which has its own problems, but doesn't specifically run into issues with indirect calls.
Yes I feel that this is the most intuitive way to do it. Always use the caller target attributes to determine ABI. I mentioned previously that direct calls could use the callee target attribute to determine whether to use AVX to pass arguments, but after thinking about it I think the most intuitive way would be to always use the caller target attributes, for both direct and indirect. What problems do you see with this approach?
Basically I would like to implement something like this:
- call site ABI is determined based on caller target attributes
- the calleeās target attributes affects how the callee itself is compiled
- Do not force callers with a lower target attribute AVX level to change their calling convention, but emit warnings
What do you think?
https://github.com/llvm/llvm-project/pull/193298
More information about the cfe-commits
mailing list