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

Matt Arsenault via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 24 15:03:31 PDT 2023


arsenm added a comment.

In D155986#4529782 <https://reviews.llvm.org/D155986#4529782>, @yaxunl wrote:

> Does this patch cause the callee to skip making a local copy of the struct type argument? What if the callee makes changes to the argument? That is a common use case since users assume the function arguments in C/C++/HIP are passed by value.

The callee is supposed to use an explicit memcpy. The explicit memcpy can be optimized away most of the time. The current byval is an invisible copy on the caller side which is difficult to eliminate


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

https://reviews.llvm.org/D155986



More information about the llvm-commits mailing list