[llvm] AMDGPU: Allocate special SGPRs before user SGPR arguments (PR #78234)

Christudasan Devadasan via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 16 07:23:19 PST 2024


================
@@ -2782,15 +2782,19 @@ SDValue SITargetLowering::LowerFormalArguments(
   } else if (!IsGraphics) {
     // For the fixed ABI, pass workitem IDs in the last argument register.
     allocateSpecialInputVGPRsFixed(CCInfo, MF, *TRI, *Info);
-  }
 
-  if (!IsKernel) {
-    CCAssignFn *AssignFn = CCAssignFnForCall(CallConv, isVarArg);
-    if (!IsGraphics && !Subtarget->enableFlatScratch()) {
+    if (!Subtarget->enableFlatScratch()) {
+      // FIXME: Sink this into allocateSpecialInputSGPRs
       CCInfo.AllocateRegBlock(ArrayRef<MCPhysReg>{AMDGPU::SGPR0, AMDGPU::SGPR1,
----------------
cdevadas wrote:

Can't we use `CCInfo.AllocateReg(Info->getScratchRSrcReg());` as used in the GlobalISel path?

https://github.com/llvm/llvm-project/pull/78234


More information about the llvm-commits mailing list