[llvm] 6b64f36 - [NFC] Use `std::move` to avoid copy (#113080)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Nov 5 06:42:57 PST 2024
Author: abhishek-kaushik22
Date: 2024-11-05T14:42:53Z
New Revision: 6b64f365364a6bf9a0ae039f6115871bc3b8ce07
URL: https://github.com/llvm/llvm-project/commit/6b64f365364a6bf9a0ae039f6115871bc3b8ce07
DIFF: https://github.com/llvm/llvm-project/commit/6b64f365364a6bf9a0ae039f6115871bc3b8ce07.diff
LOG: [NFC] Use `std::move` to avoid copy (#113080)
Added:
Modified:
llvm/lib/CodeGen/MachineLICM.cpp
Removed:
################################################################################
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;
More information about the llvm-commits
mailing list