diff --git a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp --- a/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp +++ b/llvm/lib/Target/AMDGPU/SIFrameLowering.cpp @@ -879,8 +879,8 @@ Optional FPSaveIndex = FuncInfo->FramePointerSaveIndex; Optional BPSaveIndex = FuncInfo->BasePointerSaveIndex; - for (const SIMachineFunctionInfo::SGPRSpillVGPRCSR &Reg - : FuncInfo->getSGPRSpillVGPRs()) { + for (const SIMachineFunctionInfo::SGPRSpillVGPR &Reg : + FuncInfo->getSGPRSpillVGPRs()) { if (!Reg.FI.hasValue()) continue; @@ -1174,7 +1174,7 @@ } } - for (const SIMachineFunctionInfo::SGPRSpillVGPRCSR &Reg : + for (const SIMachineFunctionInfo::SGPRSpillVGPR &Reg : FuncInfo->getSGPRSpillVGPRs()) { if (!Reg.FI.hasValue()) continue; diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h --- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h +++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.h @@ -445,15 +445,15 @@ bool hasReg() { return VGPR != 0;} }; - struct SGPRSpillVGPRCSR { + struct SGPRSpillVGPR { // VGPR used for SGPR spills Register VGPR; - // If the VGPR is a CSR, the stack slot used to save/restore it in the - // prolog/epilog. + // If the VGPR is is used for SGPR spills in a non-entrypoint function, the + // stack slot used to save/restore it in the prolog/epilog. Optional FI; - SGPRSpillVGPRCSR(Register V, Optional F) : VGPR(V), FI(F) {} + SGPRSpillVGPR(Register V, Optional F) : VGPR(V), FI(F) {} }; struct VGPRSpillToAGPR { @@ -470,7 +470,7 @@ // frameindex key. DenseMap> SGPRToVGPRSpills; unsigned NumVGPRSpillLanes = 0; - SmallVector SpillVGPRs; + SmallVector SpillVGPRs; DenseMap VGPRToAGPRSpills; @@ -505,9 +505,7 @@ ArrayRef() : makeArrayRef(I->second); } - ArrayRef getSGPRSpillVGPRs() const { - return SpillVGPRs; - } + ArrayRef getSGPRSpillVGPRs() const { return SpillVGPRs; } void setSGPRSpillVGPRs(Register NewVGPR, Optional newFI, int Index) { SpillVGPRs[Index].VGPR = NewVGPR; diff --git a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp --- a/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp +++ b/llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp @@ -321,7 +321,7 @@ SpillFI = FrameInfo.CreateSpillStackObject(4, Align(4)); } - SpillVGPRs.push_back(SGPRSpillVGPRCSR(LaneVGPR, SpillFI)); + SpillVGPRs.push_back(SGPRSpillVGPR(LaneVGPR, SpillFI)); // Add this register as live-in to all blocks to avoid machine verifer // complaining about use of an undefined physical register. @@ -347,7 +347,7 @@ MF.getRegInfo(), &AMDGPU::VGPR_32RegClass, MF, true); if (LaneVGPR == Register()) return false; - SpillVGPRs.push_back(SGPRSpillVGPRCSR(LaneVGPR, None)); + SpillVGPRs.push_back(SGPRSpillVGPR(LaneVGPR, None)); FuncInfo->VGPRReservedForSGPRSpill = LaneVGPR; return true; }