Skip to content

Commit

Permalink
MachineCSE.cpp - use auto const& iterator in for-range loop to avoid …
Browse files Browse the repository at this point in the history
…copies. NFCI.
  • Loading branch information
RKSimon committed Sep 21, 2020
1 parent 604206b commit ce294ff
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions llvm/lib/CodeGen/MachineCSE.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit ce294ff

Please sign in to comment.