When hoisting common code, watch out for uses which are marked "kill". If the

killed registers are needed below the insertion point, then unset the kill
marker.

Sorry I'm not able to find a reduced test case.

rdar://10660944

llvm-svn: 148043
This commit is contained in:
Evan Cheng 2012-01-12 20:31:24 +00:00
parent 9a167eeaff
commit 5c03a6b8f5
1 changed files with 5 additions and 0 deletions

View File

@ -1618,6 +1618,11 @@ bool BranchFolder::HoistCommonCodeInSuccs(MachineBasicBlock *MBB) {
IsSafe = false;
break;
}
if (MO.isKill() && Uses.count(Reg))
// Kills a register that's read by the instruction at the point of
// insertion. Remove the kill marker.
MO.setIsKill(false);
}
}
if (!IsSafe)