MachineCSE.cpp - use auto const& iterator in for-range loop to avoid copies. NFCI.

This commit is contained in:
Simon Pilgrim 2020-09-21 16:38:44 +01:00
parent 604206b61c
commit ce294ff8cd
1 changed files with 2 additions and 2 deletions

View File

@ -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;