[llvm] [perf] Replace copy-assign by move-assign in llvm/lib/Analysis/* (PR #178169)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 27 07:09:00 PST 2026
https://github.com/serge-sans-paille updated https://github.com/llvm/llvm-project/pull/178169
>From 6143b5a1be5553b32e8368fcf88d3773d1cbd81b Mon Sep 17 00:00:00 2001
From: serge-sans-paille <sguelton at mozilla.com>
Date: Tue, 27 Jan 2026 09:35:33 +0100
Subject: [PATCH] [perf] Replace copy-assign by move-assign in
llvm/lib/Analysis/*
---
llvm/lib/Analysis/IVDescriptors.cpp | 9 ++++-----
llvm/lib/Analysis/InlineCost.cpp | 2 +-
llvm/lib/Analysis/LoopUnrollAnalyzer.cpp | 2 +-
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/llvm/lib/Analysis/IVDescriptors.cpp b/llvm/lib/Analysis/IVDescriptors.cpp
index 3946a7ce8b8f6..39cec1822d90f 100644
--- a/llvm/lib/Analysis/IVDescriptors.cpp
+++ b/llvm/lib/Analysis/IVDescriptors.cpp
@@ -656,11 +656,10 @@ bool RecurrenceDescriptor::AddReductionVar(
// is saved as part of the RecurrenceDescriptor.
// Save the description of this reduction variable.
- RecurrenceDescriptor RD(RdxStart, ExitInstruction, IntermediateStore, Kind,
- FMF, ExactFPMathInst, RecurrenceType, IsSigned,
- IsOrdered, CastInsts, MinWidthCastToRecurrenceType);
- RedDes = RD;
-
+ ResDes = RecurrenceDescriptor RD(RdxStart, ExitInstruction, IntermediateStore,
+ Kind, FMF, ExactFPMathInst, RecurrenceType,
+ IsSigned, IsOrdered, CastInsts,
+ MinWidthCastToRecurrenceType);
return true;
}
diff --git a/llvm/lib/Analysis/InlineCost.cpp b/llvm/lib/Analysis/InlineCost.cpp
index 0e49b1903d410..8e99a4c352454 100644
--- a/llvm/lib/Analysis/InlineCost.cpp
+++ b/llvm/lib/Analysis/InlineCost.cpp
@@ -1728,7 +1728,7 @@ bool CallAnalyzer::canFoldInboundsGEP(GetElementPtrInst &I) {
return false;
// Add the result as a new mapping to Base + Offset.
- ConstantOffsetPtrs[&I] = BaseAndOffset;
+ ConstantOffsetPtrs[&I] = std::move(BaseAndOffset);
return true;
}
diff --git a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
index 9c78e2afaede7..7c8e300c016ba 100644
--- a/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
+++ b/llvm/lib/Analysis/LoopUnrollAnalyzer.cpp
@@ -66,7 +66,7 @@ bool UnrolledInstAnalyzer::simplifyInstWithSCEV(Instruction *I) {
SimplifiedAddress Address;
Address.Base = Base->getValue();
Address.Offset = *Offset;
- SimplifiedAddresses[I] = Address;
+ SimplifiedAddresses[I] = std::move(Address);
return false;
}
More information about the llvm-commits
mailing list