[llvm] [AMDGPU] Pass sret pointers in SGPRs (PR #203486)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 12 03:51:40 PDT 2026
================
@@ -3407,7 +3374,11 @@ bool isArgPassedInSGPR(const Argument *A) {
A->hasAttribute(Attribute::ByVal);
default:
// TODO: treat i1 as divergent?
- return A->hasAttribute(Attribute::InReg);
+ // sret/byval pointers are a constant offset from the wave-uniform stack
+ // pointer, so they are uniform and passed in SGPRs (see CC_AMDGPU_Func).
+ return A->hasAttribute(Attribute::InReg) ||
+ A->hasAttribute(Attribute::StructRet) ||
+ A->hasAttribute(Attribute::ByVal);
----------------
arsenm wrote:
Title only mentions sret, and the Callingconv patch doesn't cover byval
https://github.com/llvm/llvm-project/pull/203486
More information about the llvm-commits
mailing list