diff options
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineCSE.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index bebdead..6d14509 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -325,8 +325,9 @@ bool MachineCSEImpl::hasLivePhysRegDefUses(const MachineInstr *MI, } // Finally, add all defs to PhysRefs as well. - for (const auto &Def : PhysDefs) - for (MCRegAliasIterator AI(Def.second, TRI, true); AI.isValid(); ++AI) + for (unsigned i = 0, e = PhysDefs.size(); i != e; ++i) + for (MCRegAliasIterator AI(PhysDefs[i].second, TRI, true); AI.isValid(); + ++AI) PhysRefs.insert(*AI); return !PhysRefs.empty(); @@ -347,8 +348,9 @@ bool MachineCSEImpl::PhysRegDefsReach(MachineInstr *CSMI, MachineInstr *MI, if (MBB->pred_size() != 1 || *MBB->pred_begin() != CSMBB) return false; - for (const auto &PhysDef : PhysDefs) { - if (MRI->isAllocatable(PhysDef.second) || MRI->isReserved(PhysDef.second)) + for (unsigned i = 0, e = PhysDefs.size(); i != e; ++i) { + if (MRI->isAllocatable(PhysDefs[i].second) || + MRI->isReserved(PhysDefs[i].second)) // Avoid extending live range of physical registers if they are //allocatable or reserved. return false; |