[llvm] Use `std::move` to avoid copy (PR #113080)

Nashe Mncube via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 29 08:52:13 PDT 2024


================
@@ -1377,7 +1377,7 @@ bool MachineLICMImpl::IsProfitableToHoist(MachineInstr &MI,
                }) &&
         IsLoopInvariantInst(MI, CurLoop) &&
         any_of(MRI->use_nodbg_instructions(DefReg),
-               [&CurLoop, this, DefReg, Cost](MachineInstr &UseMI) {
+               [&CurLoop, this, DefReg, std::move(Cost)](MachineInstr &UseMI) {
----------------
nasherm wrote:

This change still needs to make use of lambda captures though. I'm happy to approve once that's done

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


More information about the llvm-commits mailing list