Skip to content

Commit d7717bf

Browse files
authored
[AMDGPU] Constrain inline asm vgprs to low 256 (#157531)
Also adds codegen test for high VGPRs codegen.
1 parent e7d916b commit d7717bf

File tree

2 files changed

+582
-1
lines changed

2 files changed

+582
-1
lines changed

llvm/lib/Target/AMDGPU/SIISelLowering.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17000,7 +17000,9 @@ SITargetLowering::getRegForInlineAsmConstraint(const TargetRegisterInfo *TRI_,
1700017000
: &AMDGPU::VGPR_32_Lo256RegClass;
1700117001
break;
1700217002
default:
17003-
RC = TRI->getVGPRClassForBitWidth(BitWidth);
17003+
RC = Subtarget->has1024AddressableVGPRs()
17004+
? TRI->getAlignedLo256VGPRClassForBitWidth(BitWidth)
17005+
: TRI->getVGPRClassForBitWidth(BitWidth);
1700417006
if (!RC)
1700517007
return std::pair(0U, nullptr);
1700617008
break;

0 commit comments

Comments
 (0)