Skip to content

Commit 2c1df22

Browse files
committed
RegAllocFast: Fix 8634635 to not trip assertions
1 parent 56379b2 commit 2c1df22

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

llvm/lib/CodeGen/RegAllocFast.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -982,9 +982,9 @@ void RegAllocFastImpl::allocVirtRegUndef(MachineOperand &MO) {
982982
if (!shouldAllocateRegister(VirtReg))
983983
return;
984984

985-
MO.setIsRenamable();
986985
LiveRegMap::iterator LRI = findLiveVirtReg(VirtReg);
987986
MCPhysReg PhysReg;
987+
bool IsRenamable = true;
988988
if (LRI != LiveVirtRegs.end() && LRI->PhysReg) {
989989
PhysReg = LRI->PhysReg;
990990
} else {
@@ -998,7 +998,7 @@ void RegAllocFastImpl::allocVirtRegUndef(MachineOperand &MO) {
998998
// basic.
999999
PhysReg = getErrorAssignment(*LRI, *MO.getParent(), RC);
10001000
LRI->Error = true;
1001-
MO.setIsRenamable(false);
1001+
IsRenamable = false;
10021002
} else
10031003
PhysReg = AllocationOrder.front();
10041004
}
@@ -1009,6 +1009,7 @@ void RegAllocFastImpl::allocVirtRegUndef(MachineOperand &MO) {
10091009
MO.setSubReg(0);
10101010
}
10111011
MO.setReg(PhysReg);
1012+
MO.setIsRenamable(IsRenamable);
10121013
}
10131014

10141015
/// Variation of defineVirtReg() with special handling for livethrough regs

0 commit comments

Comments
 (0)