Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions llvm/lib/Target/AMDGPU/SILowerControlFlow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ void SILowerControlFlow::emitIf(MachineInstr &MI) {
LIS->InsertMachineInstrInMaps(*SetExec);
LIS->InsertMachineInstrInMaps(*NewBr);

LIS->removeAllRegUnitsForPhysReg(AMDGPU::EXEC);
MI.eraseFromParent();

// FIXME: Is there a better way of adjusting the liveness? It shouldn't be
Expand Down Expand Up @@ -362,9 +361,6 @@ void SILowerControlFlow::emitElse(MachineInstr &MI) {
RecomputeRegs.insert(SrcReg);
RecomputeRegs.insert(DstReg);
LIS->createAndComputeVirtRegInterval(SaveReg);

// Let this be recomputed.
LIS->removeAllRegUnitsForPhysReg(AMDGPU::EXEC);
}

void SILowerControlFlow::emitIfBreak(MachineInstr &MI) {
Expand Down Expand Up @@ -932,8 +928,6 @@ bool SILowerControlFlow::runOnMachineFunction(MachineFunction &MF) {
case AMDGPU::SI_INIT_EXEC:
case AMDGPU::SI_INIT_EXEC_FROM_INPUT:
lowerInitExec(MBB, MI);
if (LIS)
LIS->removeAllRegUnitsForPhysReg(AMDGPU::EXEC);
Changed = true;
break;

Expand All @@ -951,6 +945,11 @@ bool SILowerControlFlow::runOnMachineFunction(MachineFunction &MF) {
optimizeEndCf();

if (LIS) {
if (Changed) {
// These will need to be recomputed for insertions and removals.
LIS->removeAllRegUnitsForPhysReg(AMDGPU::EXEC);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exec is reserved and has no liveness tracking, not sure why it was handled before

LIS->removeAllRegUnitsForPhysReg(AMDGPU::SCC);
}
for (Register Reg : RecomputeRegs) {
LIS->removeInterval(Reg);
LIS->createAndComputeVirtRegInterval(Reg);
Expand Down