Skip to content

Commit 8df7e2c

Browse files
committed
[AMDGPU] When allocating VGPRs, VGPR spills are not part of the prologue
PRs llvm#69924 and llvm#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 llvm#109294, so restrict it to SGPR spills, which were inserted during SGPR allocation which is done in an earlier pass. Fixes: llvm#109294 Fixes: SWDEV-485841 Change-Id: I328fb2edfca8110ea36c94812e60bc1d7663c266
1 parent ba4f980 commit 8df7e2c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8902,8 +8902,9 @@ bool SIInstrInfo::isBasicBlockPrologue(const MachineInstr &MI,
89028902
// FIXME: Copies inserted in the block prolog for live-range split should also
89038903
// be included.
89048904
return IsNullOrVectorRegister &&
8905-
(isSpill(Opcode) || (!MI.isTerminator() && Opcode != AMDGPU::COPY &&
8906-
MI.modifiesRegister(AMDGPU::EXEC, &RI)));
8905+
(isSGPRSpill(Opcode) ||
8906+
(!MI.isTerminator() && Opcode != AMDGPU::COPY &&
8907+
MI.modifiesRegister(AMDGPU::EXEC, &RI)));
89078908
}
89088909

89098910
MachineInstrBuilder

0 commit comments

Comments
 (0)