diff options
author | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-09-25 22:33:15 +0100 |
---|---|---|
committer | Simon Pilgrim <llvm-dev@redking.me.uk> | 2020-09-26 14:31:57 +0100 |
commit | decc1944f38f4205bf53829bf91e3c98ea6fc7ac (patch) | |
tree | fb24daa257d66b1ece5b380a1735485364b2927c /llvm/lib/CodeGen/MachineCSE.cpp | |
parent | f91b9c0f9858bb3d6ff4dd1fb494e83633eefed8 (diff) | |
download | llvm-decc1944f38f4205bf53829bf91e3c98ea6fc7ac.zip llvm-decc1944f38f4205bf53829bf91e3c98ea6fc7ac.tar.gz llvm-decc1944f38f4205bf53829bf91e3c98ea6fc7ac.tar.bz2 |
MachineCSE.cpp - use auto const& iterators in for-range loops to avoid copies. NFCI.
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r-- | llvm/lib/CodeGen/MachineCSE.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp index d3eca3a..2bc56cc 100644 --- a/llvm/lib/CodeGen/MachineCSE.cpp +++ b/llvm/lib/CodeGen/MachineCSE.cpp @@ -640,7 +640,7 @@ bool MachineCSE::ProcessBlockCSE(MachineBasicBlock *MBB) { // Actually perform the elimination. if (DoCSE) { - for (std::pair<unsigned, unsigned> &CSEPair : CSEPairs) { + for (const std::pair<unsigned, unsigned> &CSEPair : CSEPairs) { unsigned OldReg = CSEPair.first; unsigned NewReg = CSEPair.second; // OldReg may have been unused but is used now, clear the Dead flag @@ -656,7 +656,7 @@ bool MachineCSE::ProcessBlockCSE(MachineBasicBlock *MBB) { // we should make sure it is not dead at CSMI. for (unsigned ImplicitDefToUpdate : ImplicitDefsToUpdate) CSMI->getOperand(ImplicitDefToUpdate).setIsDead(false); - for (auto PhysDef : PhysDefs) + for (const auto &PhysDef : PhysDefs) if (!MI->getOperand(PhysDef.first).isDead()) CSMI->getOperand(PhysDef.first).setIsDead(false); |