Skip to content

Commit 3b48c64

Browse files
authored
AMDGPU: Move spill pseudo special case out of adjustAllocatableRegClass (#158246)
This is special for the same reason av_mov_b64_imm_pseudo is special.
1 parent 4b03252 commit 3b48c64

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5976,8 +5976,7 @@ SIInstrInfo::getWholeWaveFunctionSetup(MachineFunction &MF) const {
59765976
static const TargetRegisterClass *
59775977
adjustAllocatableRegClass(const GCNSubtarget &ST, const SIRegisterInfo &RI,
59785978
const MCInstrDesc &TID, unsigned RCID) {
5979-
if (!ST.hasGFX90AInsts() && (((TID.mayLoad() || TID.mayStore()) &&
5980-
!(TID.TSFlags & SIInstrFlags::Spill)))) {
5979+
if (!ST.hasGFX90AInsts() && (TID.mayLoad() || TID.mayStore())) {
59815980
switch (RCID) {
59825981
case AMDGPU::AV_32RegClassID:
59835982
RCID = AMDGPU::VGPR_32RegClassID;
@@ -6012,10 +6011,9 @@ const TargetRegisterClass *SIInstrInfo::getRegClass(const MCInstrDesc &TID,
60126011
if (OpNum >= TID.getNumOperands())
60136012
return nullptr;
60146013
auto RegClass = TID.operands()[OpNum].RegClass;
6015-
if (TID.getOpcode() == AMDGPU::AV_MOV_B64_IMM_PSEUDO) {
6016-
// Special pseudos have no alignment requirement
6014+
// Special pseudos have no alignment requirement.
6015+
if (TID.getOpcode() == AMDGPU::AV_MOV_B64_IMM_PSEUDO || isSpill(TID))
60176016
return RI.getRegClass(RegClass);
6018-
}
60196017

60206018
return adjustAllocatableRegClass(ST, RI, TID, RegClass);
60216019
}

llvm/lib/Target/AMDGPU/SIInstrInfo.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,10 +797,12 @@ class SIInstrInfo final : public AMDGPUGenInstrInfo {
797797
return get(Opcode).TSFlags & SIInstrFlags::Spill;
798798
}
799799

800-
static bool isSpill(const MachineInstr &MI) {
801-
return MI.getDesc().TSFlags & SIInstrFlags::Spill;
800+
static bool isSpill(const MCInstrDesc &Desc) {
801+
return Desc.TSFlags & SIInstrFlags::Spill;
802802
}
803803

804+
static bool isSpill(const MachineInstr &MI) { return isSpill(MI.getDesc()); }
805+
804806
static bool isWWMRegSpillOpcode(uint16_t Opcode) {
805807
return Opcode == AMDGPU::SI_SPILL_WWM_V32_SAVE ||
806808
Opcode == AMDGPU::SI_SPILL_WWM_AV32_SAVE ||

0 commit comments

Comments
 (0)