Skip to content

Commit f8730b5

Browse files
kzhuravlShoreshen
andauthored
CP upstream llvm#157927 (llvm#4406)
Co-authored-by: shore <[email protected]>
1 parent 4f4ae5a commit f8730b5

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,7 +3193,7 @@ bool SITargetLowering::CanLowerReturn(
31933193

31943194
// We must use the stack if return would require unavailable registers.
31953195
unsigned MaxNumVGPRs = Subtarget->getMaxNumVGPRs(MF);
3196-
unsigned TotalNumVGPRs = AMDGPU::VGPR_32RegClass.getNumRegs();
3196+
unsigned TotalNumVGPRs = Subtarget->getAddressableNumArchVGPRs();
31973197
for (unsigned i = MaxNumVGPRs; i < TotalNumVGPRs; ++i)
31983198
if (CCInfo.isAllocated(AMDGPU::VGPR_32RegClass.getRegister(i)))
31993199
return false;

llvm/lib/Target/AMDGPU/SIMachineFunctionInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ SIMachineFunctionInfo::SIMachineFunctionInfo(const Function &F,
102102
MaxKernArgAlign);
103103

104104
if (ST.hasGFX90AInsts() &&
105-
ST.getMaxNumVGPRs(F) <= AMDGPU::VGPR_32RegClass.getNumRegs() &&
105+
ST.getMaxNumVGPRs(F) <= ST.getAddressableNumArchVGPRs() &&
106106
!mayUseAGPRs(F))
107107
MayNeedAGPRs = false; // We will select all MAI with VGPR operands.
108108
}

0 commit comments

Comments
 (0)