[llvm] 1605bf5 - [ConstraintElimination] Use std::move in the constructor (NFC) (#79259)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 24 09:19:01 PST 2024


Author: Kazu Hirata
Date: 2024-01-24T09:18:57-08:00
New Revision: 1605bf58151bc357780fee5553beee2b404772a7

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

LOG: [ConstraintElimination] Use std::move in the constructor (NFC) (#79259)

Moving the contents of Coefficients saves 0.43% of heap allocations
during the compilation of a large preprocessed file, namely
X86ISelLowering.cpp, for the X86 target.

Added: 
    

Modified: 
    llvm/lib/Transforms/Scalar/ConstraintElimination.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index 7b672e89b67aae4..ae8e2292519cb77 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -231,8 +231,8 @@ struct ConstraintTy {
 
   ConstraintTy(SmallVector<int64_t, 8> Coefficients, bool IsSigned, bool IsEq,
                bool IsNe)
-      : Coefficients(Coefficients), IsSigned(IsSigned), IsEq(IsEq), IsNe(IsNe) {
-  }
+      : Coefficients(std::move(Coefficients)), IsSigned(IsSigned), IsEq(IsEq),
+        IsNe(IsNe) {}
 
   unsigned size() const { return Coefficients.size(); }
 


        


More information about the llvm-commits mailing list