[llvm] [NFC] Use references to avoid copying (PR #99863)

Haohai Wen via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 6 03:00:53 PDT 2024


================
@@ -584,7 +584,7 @@ void RegAllocFastImpl::spill(MachineBasicBlock::iterator Before,
       SpilledOperandsMap;
   for (MachineOperand *MO : LRIDbgOperands)
     SpilledOperandsMap[MO->getParent()].push_back(MO);
-  for (auto MISpilledOperands : SpilledOperandsMap) {
+  for (auto &MISpilledOperands : SpilledOperandsMap) {
----------------
HaohaiWen wrote:

Why not add const here.

https://github.com/llvm/llvm-project/pull/99863


More information about the llvm-commits mailing list