@@ -5960,7 +5960,7 @@ adjustAllocatableRegClass(const GCNSubtarget &ST, const SIRegisterInfo &RI,
5960
5960
if ((IsAllocatable || !ST.hasGFX90AInsts ()) &&
5961
5961
(((TID.mayLoad () || TID.mayStore ()) &&
5962
5962
!(TID.TSFlags & SIInstrFlags::Spill)) ||
5963
- (TID.TSFlags & ( SIInstrFlags::DS | SIInstrFlags:: MIMG) ))) {
5963
+ (TID.TSFlags & SIInstrFlags::MIMG))) {
5964
5964
switch (RCID) {
5965
5965
case AMDGPU::AV_32RegClassID:
5966
5966
RCID = AMDGPU::VGPR_32RegClassID;
@@ -5996,23 +5996,18 @@ const TargetRegisterClass *SIInstrInfo::getRegClass(const MCInstrDesc &TID,
5996
5996
return nullptr ;
5997
5997
auto RegClass = TID.operands ()[OpNum].RegClass ;
5998
5998
bool IsAllocatable = false ;
5999
- if (TID.TSFlags & ( SIInstrFlags::DS | SIInstrFlags:: FLAT) ) {
5999
+ if (TID.TSFlags & SIInstrFlags::FLAT) {
6000
6000
// vdst and vdata should be both VGPR or AGPR, same for the DS instructions
6001
6001
// with two data operands. Request register class constrained to VGPR only
6002
6002
// of both operands present as Machine Copy Propagation can not check this
6003
6003
// constraint and possibly other passes too.
6004
6004
//
6005
- // The check is limited to FLAT and DS because atomics in non-flat encoding
6006
- // have their vdst and vdata tied to be the same register.
6007
- const int VDstIdx = AMDGPU::getNamedOperandIdx (TID.Opcode ,
6008
- AMDGPU::OpName::vdst);
6009
- const int DataIdx = AMDGPU::getNamedOperandIdx (TID.Opcode ,
6010
- (TID.TSFlags & SIInstrFlags::DS) ? AMDGPU::OpName::data0
6011
- : AMDGPU::OpName::vdata);
6012
- if (DataIdx != -1 ) {
6013
- IsAllocatable = VDstIdx != -1 || AMDGPU::hasNamedOperand (
6014
- TID.Opcode , AMDGPU::OpName::data1);
6015
- }
6005
+ // The check is limited to FLAT because atomics in non-flat encoding have
6006
+ // their vdst and vdata tied to be the same register, and DS instructions
6007
+ // have separate instruction definitions with AGPR and VGPR operand lists.
6008
+ IsAllocatable =
6009
+ AMDGPU::hasNamedOperand (TID.Opcode , AMDGPU::OpName::vdata) &&
6010
+ AMDGPU::hasNamedOperand (TID.Opcode , AMDGPU::OpName::vdst);
6016
6011
} else if (TID.getOpcode () == AMDGPU::AV_MOV_B64_IMM_PSEUDO) {
6017
6012
// Special pseudos have no alignment requirement
6018
6013
return RI.getRegClass (RegClass);
0 commit comments