mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-20 16:17:38 +00:00
For some targets, a copy can use a register multiple times, e.g. ppc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88895 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -77,6 +77,7 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &fn) {
|
||||
SmallVector<MachineInstr*, 8> ImpDefMIs;
|
||||
MachineBasicBlock *Entry = fn.begin();
|
||||
SmallPtrSet<MachineBasicBlock*,16> Visited;
|
||||
SmallPtrSet<MachineInstr*, 8> ModInsts;
|
||||
|
||||
for (df_ext_iterator<MachineBasicBlock*, SmallPtrSet<MachineBasicBlock*,16> >
|
||||
DFI = df_ext_begin(Entry, Visited), E = df_ext_end(Entry, Visited);
|
||||
@@ -201,6 +202,8 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &fn) {
|
||||
MachineOperand &RMO = UI.getOperand();
|
||||
MachineInstr *RMI = &*UI;
|
||||
++UI;
|
||||
if (ModInsts.count(RMI))
|
||||
continue;
|
||||
MachineBasicBlock *RMBB = RMI->getParent();
|
||||
if (RMBB == MBB)
|
||||
continue;
|
||||
@@ -216,6 +219,7 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &fn) {
|
||||
RMI->setDesc(tii_->get(TargetInstrInfo::IMPLICIT_DEF));
|
||||
for (int j = RMI->getNumOperands() - 1, ee = 0; j > ee; --j)
|
||||
RMI->RemoveOperand(j);
|
||||
ModInsts.insert(RMI);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -226,6 +230,7 @@ bool ProcessImplicitDefs::runOnMachineFunction(MachineFunction &fn) {
|
||||
RMO.setIsKill();
|
||||
}
|
||||
}
|
||||
ModInsts.clear();
|
||||
ImpDefRegs.clear();
|
||||
ImpDefMIs.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user