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 | 285a7d57dc3c1210eda135fc137928e727175200 (patch) | |
tree | 5a29eb089640aafdcceb7dc330c4b3bf56edd20d /lib | |
parent | 2d947263d5df54a10f58d6a7b31d49c515c7347f (diff) | |
download | external_llvm-285a7d57dc3c1210eda135fc137928e727175200.zip external_llvm-285a7d57dc3c1210eda135fc137928e727175200.tar.gz external_llvm-285a7d57dc3c1210eda135fc137928e727175200.tar.bz2 |
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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/ProcessImplicitDefs.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/ProcessImplicitDefs.cpp b/lib/CodeGen/ProcessImplicitDefs.cpp index 23b78c7..455964b 100644 --- a/lib/CodeGen/ProcessImplicitDefs.cpp +++ b/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(); } |