aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/CodeGen/MachineCSE.cpp
diff options
context:
space:
mode:
authorSimon Pilgrim <llvm-dev@redking.me.uk>2020-09-21 16:38:44 +0100
committerSimon Pilgrim <llvm-dev@redking.me.uk>2020-09-21 16:54:26 +0100
commitce294ff8cddf110cefd5955cf30c575c7838b452 (patch)
tree1dfb02fda8652350865ea4a19ab2dc4d1767f2a2 /llvm/lib/CodeGen/MachineCSE.cpp
parent604206b61cb948c01b438dd06b3b7bc837e99455 (diff)
downloadllvm-ce294ff8cddf110cefd5955cf30c575c7838b452.zip
llvm-ce294ff8cddf110cefd5955cf30c575c7838b452.tar.gz
llvm-ce294ff8cddf110cefd5955cf30c575c7838b452.tar.bz2
MachineCSE.cpp - use auto const& iterator in for-range loop to avoid copies. NFCI.
Diffstat (limited to 'llvm/lib/CodeGen/MachineCSE.cpp')
-rw-r--r--llvm/lib/CodeGen/MachineCSE.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/MachineCSE.cpp b/llvm/lib/CodeGen/MachineCSE.cpp
index 0953127..d3eca3a 100644
--- a/llvm/lib/CodeGen/MachineCSE.cpp
+++ b/llvm/lib/CodeGen/MachineCSE.cpp
@@ -777,11 +777,11 @@ bool MachineCSE::isPRECandidate(MachineInstr *MI) {
MI->getNumExplicitDefs() != 1)
return false;
- for (auto def : MI->defs())
+ for (const auto &def : MI->defs())
if (!Register::isVirtualRegister(def.getReg()))
return false;
- for (auto use : MI->uses())
+ for (const auto &use : MI->uses())
if (use.isReg() && !Register::isVirtualRegister(use.getReg()))
return false;