From 6b64f365364a6bf9a0ae039f6115871bc3b8ce07 Mon Sep 17 00:00:00 2001 From: abhishek-kaushik22 Date: Tue, 5 Nov 2024 22:42:53 +0800 Subject: [PATCH] [NFC] Use `std::move` to avoid copy (#113080) --- llvm/lib/CodeGen/MachineLICM.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp index 7ea07862b839d0..da095c692e6d5d 100644 --- a/llvm/lib/CodeGen/MachineLICM.cpp +++ b/llvm/lib/CodeGen/MachineLICM.cpp @@ -1371,7 +1371,8 @@ bool MachineLICMImpl::IsProfitableToHoist(MachineInstr &MI, }) && IsLoopInvariantInst(MI, CurLoop) && any_of(MRI->use_nodbg_instructions(DefReg), - [&CurLoop, this, DefReg, Cost](MachineInstr &UseMI) { + [&CurLoop, this, DefReg, + Cost = std::move(Cost)](MachineInstr &UseMI) { if (!CurLoop->contains(&UseMI)) return false;