[llvm] [NVPTX] Improve copy avoidance during lowering. (PR #106423)
Fei Peng via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 28 15:26:35 PDT 2024
================
@@ -269,24 +293,44 @@ static void convertToParamAS(Use *OldUse, Value *Param, bool GridConstant) {
OriginalUser->getIterator());
return CvtToGenCall;
};
-
- if (auto *CI = dyn_cast<CallInst>(I.OldInstruction)) {
- I.OldUse->set(GetParamAddrCastToGeneric(I.NewParam, CI));
- return CI;
+ auto *ParamInGenericAS =
+ GetParamAddrCastToGeneric(I.NewParam, I.OldInstruction);
+
+ // phi/select could use generic arg pointers w/o __grid_constant__
----------------
fiigii wrote:
Ideally, we can also avoid `cvta.param` at Phi/Select uses if Phi/Select's all incoming values have the same address space. However, this pass seems to run before the address space assignment. It could be a further improvement opportunity.
https://github.com/llvm/llvm-project/pull/106423
More information about the llvm-commits
mailing list