diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2009-11-16 05:52:06 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2009-11-16 05:52:06 +0000 |
| commit | 11bf4493d4bddaf895e1af3c6f760666ea5ef6ca (patch) | |
| tree | 7a73e6330f876b4359904d23ed5f41f3c4bb697a /llvm/lib/CodeGen | |
| parent | 8c98dffd1fe35026fe7e797f4c0dc68781986f48 (diff) | |
| download | bcm5719-llvm-11bf4493d4bddaf895e1af3c6f760666ea5ef6ca.tar.gz bcm5719-llvm-11bf4493d4bddaf895e1af3c6f760666ea5ef6ca.zip | |
For some targets, a copy can use a register multiple times, e.g. ppc.
llvm-svn: 88895
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/ProcessImplicitDefs.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp index 23b78c74386..455964b5c5a 100644 --- a/llvm/lib/CodeGen/ProcessImplicitDefs.cpp +++ b/llvm/lib/CodeGen/ProcessImplicitDefs.cpp @@ -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(); } |

