[llvm] [DebugInfo][InstrRef][MIR][GlobalIsel][MachineLICM] Use std::move to avoid copying (PR #116935)

Akshat Oke via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 20 06:03:14 PST 2024


================
@@ -364,7 +364,7 @@ void MIRPrinter::convert(yaml::MachineFunction &YamlMF,
     for (const MCPhysReg *I = CalleeSavedRegs; *I; ++I) {
       yaml::FlowStringValue Reg;
       printRegMIR(*I, Reg, TRI);
-      CalleeSavedRegisters.push_back(Reg);
+      CalleeSavedRegisters.push_back(std::move(Reg));
     }
     YamlMF.CalleeSavedRegisters = CalleeSavedRegisters;
----------------
optimisan wrote:

Can use `std::move` here as well right?

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


More information about the llvm-commits mailing list