Skip to content

Commit 735a5f6

Browse files
authored
[AMDGPU] When allocating VGPRs, VGPR spills are not part of the prologue (#109439)
PRs #69924 and #72140 modified SIInstrInfo::isBasicBlockPrologue to skip over EXEC modifications and spills when allocating VGPRs. But treating VGPR spills as part of the prologue can confuse the register allocator as in #109294, so restrict it to SGPR spills, which were inserted during SGPR allocation which is done in an earlier pass. Fixes: #109294 Fixes: SWDEV-485841
1 parent c0e97c4 commit 735a5f6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -8899,11 +8899,10 @@ bool SIInstrInfo::isBasicBlockPrologue(const MachineInstr &MI,
88998899
}
89008900

89018901
uint16_t Opcode = MI.getOpcode();
8902-
// FIXME: Copies inserted in the block prolog for live-range split should also
8903-
// be included.
89048902
return IsNullOrVectorRegister &&
8905-
(isSpill(Opcode) || (!MI.isTerminator() && Opcode != AMDGPU::COPY &&
8906-
MI.modifiesRegister(AMDGPU::EXEC, &RI)));
8903+
(isSGPRSpill(Opcode) ||
8904+
(!MI.isTerminator() && Opcode != AMDGPU::COPY &&
8905+
MI.modifiesRegister(AMDGPU::EXEC, &RI)));
89078906
}
89088907

89098908
MachineInstrBuilder

0 commit comments

Comments
 (0)