[llvm] [NVPTX] add an optional early copy of byval arguments (PR #113384)
Akshay Deodhar via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 23 14:10:29 PDT 2024
================
@@ -734,3 +739,21 @@ bool NVPTXLowerArgs::runOnFunction(Function &F) {
}
FunctionPass *llvm::createNVPTXLowerArgsPass() { return new NVPTXLowerArgs(); }
+
+static bool copyFunctionByValArgs(Function &F) {
+ LLVM_DEBUG(dbgs() << "Creating a copy of byval args of " << F.getName()
+ << "\n");
+ bool Changed = false;
+ for (Argument &Arg : F.args())
+ if (Arg.getType()->isPointerTy() && Arg.hasByValAttr()) {
+ copyByValParam(F, Arg);
----------------
akshayrdeodhar wrote:
to clarify: any readonly byvals which were not formerly lowered to allocas will get lowered to allocas, but SROA will convert loads from the allocas to loads from the byval pointer?
https://github.com/llvm/llvm-project/pull/113384
More information about the llvm-commits
mailing list