Skip to content

Commit ce294ff

Browse files
committed
MachineCSE.cpp - use auto const& iterator in for-range loop to avoid copies. NFCI.
1 parent 604206b commit ce294ff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/CodeGen/MachineCSE.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -777,11 +777,11 @@ bool MachineCSE::isPRECandidate(MachineInstr *MI) {
777777
MI->getNumExplicitDefs() != 1)
778778
return false;
779779

780-
for (auto def : MI->defs())
780+
for (const auto &def : MI->defs())
781781
if (!Register::isVirtualRegister(def.getReg()))
782782
return false;
783783

784-
for (auto use : MI->uses())
784+
for (const auto &use : MI->uses())
785785
if (use.isReg() && !Register::isVirtualRegister(use.getReg()))
786786
return false;
787787

0 commit comments

Comments
 (0)