-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AMDGPU] Consolidate SGPRSpill and VGPRSpill into single Spill bit #81901
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
b438f06
df46f5f
bf89a98
742c808
fc25a1f
212570f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -708,25 +708,41 @@ class SIInstrInfo final : public AMDGPUGenInstrInfo { | |
return get(Opcode).TSFlags & SIInstrFlags::DisableWQM; | ||
} | ||
|
||
// SI_SPILL_S32_TO_VGPR and SI_RESTORE_S32_FROM_VGPR form a special case of | ||
// SGPRs spilling to VGPRs which are SGPR spills but from VALU instructions | ||
// therefore we need an explicit check for them since just checking if the | ||
// Spill bit is set and what instruction type it came from misclassifies | ||
// them. | ||
static bool isVGPRSpill(const MachineInstr &MI) { | ||
return MI.getDesc().TSFlags & SIInstrFlags::VGPRSpill; | ||
return MI.getOpcode() != AMDGPU::SI_SPILL_S32_TO_VGPR && | ||
MI.getOpcode() != AMDGPU::SI_RESTORE_S32_FROM_VGPR && | ||
(isSpill(MI) && isVALU(MI)); | ||
} | ||
|
||
bool isVGPRSpill(uint16_t Opcode) const { | ||
return get(Opcode).TSFlags & SIInstrFlags::VGPRSpill; | ||
return Opcode != AMDGPU::SI_SPILL_S32_TO_VGPR && | ||
Opcode != AMDGPU::SI_RESTORE_S32_FROM_VGPR && | ||
(isSpill(Opcode) && isVALU(Opcode)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check these first? |
||
} | ||
|
||
static bool isSGPRSpill(const MachineInstr &MI) { | ||
return MI.getDesc().TSFlags & SIInstrFlags::SGPRSpill; | ||
return MI.getOpcode() == AMDGPU::SI_SPILL_S32_TO_VGPR || | ||
MI.getOpcode() == AMDGPU::SI_RESTORE_S32_FROM_VGPR || | ||
(isSpill(MI) && isSALU(MI)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check these first? |
||
} | ||
|
||
bool isSGPRSpill(uint16_t Opcode) const { | ||
return get(Opcode).TSFlags & SIInstrFlags::SGPRSpill; | ||
return Opcode == AMDGPU::SI_SPILL_S32_TO_VGPR || | ||
Opcode == AMDGPU::SI_RESTORE_S32_FROM_VGPR || | ||
(isSpill(Opcode) && isSALU(Opcode)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Check these first? |
||
} | ||
|
||
bool isSpillOpcode(uint16_t Opcode) const { | ||
return get(Opcode).TSFlags & | ||
(SIInstrFlags::SGPRSpill | SIInstrFlags::VGPRSpill); | ||
bool isSpill(uint16_t Opcode) const { | ||
return get(Opcode).TSFlags & SIInstrFlags::Spill; | ||
CRobeck marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} | ||
|
||
static bool isSpill(const MachineInstr &MI) { | ||
return MI.getDesc().TSFlags & SIInstrFlags::Spill; | ||
} | ||
|
||
static bool isWWMRegSpillOpcode(uint16_t Opcode) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Check these first?