[llvm] [NVPTX] add an optional early copy of byval arguments (PR #113384)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 23 14:30:48 PDT 2024
================
@@ -612,29 +638,8 @@ void NVPTXLowerArgs::handleByValParam(const NVPTXTargetMachine &TM,
// Do not replace Arg in the cast to param space
CastToParam->setOperand(0, Arg);
- } else {
----------------
Artem-B wrote:
`NVPTXLowerArgs` does quite a bit more than just add copies. It also deals with `cvta.param`, and that requires adding `addrspacecast`, etc, and I'm not comfortable doing it that early in the pipeline. AS-specific pointers are not always handled well in LLVM.
With the early copy, there will still be some work to do if LLVM would eliminate the inserted copy, but the code would still take a pointer to byval (i.e. using something like `escape( condition ? &byval_arg : &some_global)` )
I suspect we'll see other corner cases. That's why I want to keep it disabled by default, while I see how the change fares on a wide range of code.
https://github.com/llvm/llvm-project/pull/113384
More information about the llvm-commits
mailing list