[PATCH] D155986: [clang][AMDGPU]: Don't use byval for struct arguments in function ABI

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 14:49:18 PDT 2023


jdoerfert added a comment.

In D155986#4523674 <https://reviews.llvm.org/D155986#4523674>, @arsenm wrote:

> In D155986#4523635 <https://reviews.llvm.org/D155986#4523635>, @jdoerfert wrote:
>
>> I would have assumed it makes more sense to have an IR pass that changes the ABI of functions with local linkage. The problem with this is that other languages might still emit byval, etc.
>
> I think this would be good as an alternative optimization, but this wouldn't change the C ABI to avoid byval. I think we don't want byval for whenever we have an object linkable ABI

I have two points, I should have been more clear:

1. This is dangerous since we change something that is tested. Interoperability might not be the biggest thing yet, but special casing clangs behavior seems a slippery slope towards rust/fortran/Julia/... code not being able to talk to C/C++/HIP/... code when both are compiled for AMDGPUs.
2. We get more bang and less (potential) problems if we transform the IR whenever we can prove that we can, e.g., we see all the call sites. It should be overall better since we target a closed world, at least for the foreseeable future.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D155986/new/

https://reviews.llvm.org/D155986



More information about the llvm-commits mailing list