[llvm] adbbe85 - [perf] Replace copy-assign by move-assign in llvm/lib/CodeGen/* (#178172)

via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 22:57:54 PST 2026


Author: serge-sans-paille
Date: 2026-01-28T06:57:50Z
New Revision: adbbe856d7e65351b5d786bb7c9c4cbcf2f81b86

URL: https://github.com/llvm/llvm-project/commit/adbbe856d7e65351b5d786bb7c9c4cbcf2f81b86
DIFF: https://github.com/llvm/llvm-project/commit/adbbe856d7e65351b5d786bb7c9c4cbcf2f81b86.diff

LOG: [perf] Replace copy-assign by move-assign in llvm/lib/CodeGen/* (#178172)

Added: 
    

Modified: 
    llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
    llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
    llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    llvm/lib/CodeGen/TargetInstrInfo.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
index 7bef3a8f4d3ff..1ca3a2cc6850d 100644
--- a/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
+++ b/llvm/lib/CodeGen/AssignmentTrackingAnalysis.cpp
@@ -136,7 +136,7 @@ class FunctionVarLocsBuilder {
     VarLocInfo VarLoc;
     VarLoc.VariableID = insertVariable(Var);
     VarLoc.Expr = Expr;
-    VarLoc.DL = DL;
+    VarLoc.DL = std::move(DL);
     VarLoc.Values = R;
     SingleLocVars.emplace_back(VarLoc);
   }
@@ -147,7 +147,7 @@ class FunctionVarLocsBuilder {
     VarLocInfo VarLoc;
     VarLoc.VariableID = insertVariable(Var);
     VarLoc.Expr = Expr;
-    VarLoc.DL = DL;
+    VarLoc.DL = std::move(DL);
     VarLoc.Values = R;
     VarLocsBeforeInst[Before].emplace_back(VarLoc);
   }

diff  --git a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
index cdc1f64dc439f..1dbba820b3dea 100644
--- a/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
+++ b/llvm/lib/CodeGen/GlobalISel/LoadStoreOpt.cpp
@@ -967,7 +967,7 @@ void LoadStoreOpt::initializeStoreMergeTargetInfo(unsigned AddrSpace) {
       LegalSizes.set(Size);
   }
   assert(LegalSizes.any() && "Expected some store sizes to be legal!");
-  LegalStoreSizes[AddrSpace] = LegalSizes;
+  LegalStoreSizes[AddrSpace] = std::move(LegalSizes);
 }
 
 bool LoadStoreOpt::runOnMachineFunction(MachineFunction &MF) {

diff  --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
index e23a1f67171d3..b92b35feb53e3 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
@@ -14466,7 +14466,7 @@ void SelectionDAG::copyExtraInfo(SDNode *From, SDNode *To) {
         return false;
     }
     // Copy only if entry node was not reached.
-    SDEI[N] = NEI;
+    SDEI[N] = std::move(NEI);
     return true;
   };
 

diff  --git a/llvm/lib/CodeGen/TargetInstrInfo.cpp b/llvm/lib/CodeGen/TargetInstrInfo.cpp
index 75d31ff92a340..8b26ab8da124b 100644
--- a/llvm/lib/CodeGen/TargetInstrInfo.cpp
+++ b/llvm/lib/CodeGen/TargetInstrInfo.cpp
@@ -1118,7 +1118,7 @@ void TargetInstrInfo::reduceAccumulatorTree(
   if (RegistersToReduce.size() % 2 != 0)
     NewRegs.push_back(RegistersToReduce[RegistersToReduce.size() - 1]);
 
-  RegistersToReduce = NewRegs;
+  RegistersToReduce = std::move(NewRegs);
 }
 
 // The concept of the reassociation pass is that these operations can benefit


        


More information about the llvm-commits mailing list