mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-02-03 10:54:42 +00:00
If the 2addr instruction has other kills, don't move it below any other uses since we don't want to extend other live ranges.
llvm-svn: 144772
This commit is contained in:
parent
27c17a65d1
commit
65d5df1165
@ -933,6 +933,7 @@ TwoAddressInstructionPass::RescheduleMIBelowKill(MachineBasicBlock *MBB,
|
||||
return false;
|
||||
|
||||
SmallSet<unsigned, 2> Uses;
|
||||
SmallSet<unsigned, 2> Kills;
|
||||
SmallSet<unsigned, 2> Defs;
|
||||
for (unsigned i = 0, e = MI->getNumOperands(); i != e; ++i) {
|
||||
const MachineOperand &MO = MI->getOperand(i);
|
||||
@ -943,8 +944,11 @@ TwoAddressInstructionPass::RescheduleMIBelowKill(MachineBasicBlock *MBB,
|
||||
continue;
|
||||
if (MO.isDef())
|
||||
Defs.insert(MOReg);
|
||||
else
|
||||
else {
|
||||
Uses.insert(MOReg);
|
||||
if (MO.isKill() && MOReg != Reg)
|
||||
Kills.insert(MOReg);
|
||||
}
|
||||
}
|
||||
|
||||
// Move the copies connected to MI down as well.
|
||||
@ -991,7 +995,8 @@ TwoAddressInstructionPass::RescheduleMIBelowKill(MachineBasicBlock *MBB,
|
||||
} else {
|
||||
if (Defs.count(MOReg))
|
||||
return false;
|
||||
if (MOReg != Reg && MO.isKill() && Uses.count(MOReg))
|
||||
if (MOReg != Reg &&
|
||||
((MO.isKill() && Uses.count(MOReg)) || Kills.count(MOReg)))
|
||||
// Don't want to extend other live ranges and update kills.
|
||||
return false;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user