diff options
author | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-06-30 00:30:36 +0000 |
---|---|---|
committer | Jakob Stoklund Olesen <stoklund@2pi.dk> | 2010-06-30 00:30:36 +0000 |
commit | 170c41f3d50b7172437d90895a033daeb8d7563a (patch) | |
tree | 42ce841d0177b8c89416a7489dfd9cf8823d89a4 /lib/CodeGen/SimpleRegisterCoalescing.cpp | |
parent | d5bd68ed08a414b00721c3c556459d0f295ea4d5 (diff) |
Use skipInstruction() as a simpler way of iterating over instructions using SrcReg
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SimpleRegisterCoalescing.cpp')
-rw-r--r-- | lib/CodeGen/SimpleRegisterCoalescing.cpp | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/lib/CodeGen/SimpleRegisterCoalescing.cpp b/lib/CodeGen/SimpleRegisterCoalescing.cpp index 5f4ef5b3b1..be2bff3d5c 100644 --- a/lib/CodeGen/SimpleRegisterCoalescing.cpp +++ b/lib/CodeGen/SimpleRegisterCoalescing.cpp @@ -742,16 +742,8 @@ SimpleRegisterCoalescing::UpdateRegDefsUses(const CoalescerPair &CP) { unsigned DstReg = CP.getDstReg(); unsigned SubIdx = CP.getSubIdx(); - // Collect all the instructions using SrcReg. - SmallPtrSet<MachineInstr*, 32> Instrs; - for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(SrcReg), - E = mri_->reg_end(); I != E; ++I) - Instrs.insert(&*I); - - for (SmallPtrSet<MachineInstr*, 32>::const_iterator I = Instrs.begin(), - E = Instrs.end(); I != E; ++I) { - MachineInstr *UseMI = *I; - + for (MachineRegisterInfo::reg_iterator I = mri_->reg_begin(SrcReg); + MachineInstr *UseMI = I.skipInstruction();) { // A PhysReg copy that won't be coalesced can perhaps be rematerialized // instead. if (DstIsPhys) { |