Skip to content

Commit 2b7da5f

Browse files
jayfoadcdevadas
authored andcommitted
[AMDGPU] When allocating VGPRs, VGPR spills are not part of the prologue (llvm#109439)
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: Ice1ab75074aa380c13e07c452a2854f78ff37ce7
1 parent 733e0a8 commit 2b7da5f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

llvm/lib/Target/AMDGPU/SIInstrInfo.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8984,11 +8984,10 @@ bool SIInstrInfo::isBasicBlockPrologue(const MachineInstr &MI,
89848984
}
89858985

89868986
uint16_t Opcode = MI.getOpcode();
8987-
// FIXME: Copies inserted in the block prolog for live-range split should also
8988-
// be included.
89898987
return IsNullOrVectorRegister &&
8990-
(isSpill(Opcode) || (!MI.isTerminator() && Opcode != AMDGPU::COPY &&
8991-
MI.modifiesRegister(AMDGPU::EXEC, &RI)));
8988+
(isSGPRSpill(Opcode) ||
8989+
(!MI.isTerminator() && Opcode != AMDGPU::COPY &&
8990+
MI.modifiesRegister(AMDGPU::EXEC, &RI)));
89928991
}
89938992

89948993
MachineInstrBuilder

0 commit comments

Comments
 (0)