From 0949f8cec1056632fc079e404f169ead7bf1a041 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sat, 15 Jun 2024 16:24:10 -0700 Subject: [PATCH] [TargetLibraryInfo] Use the default move constructor/assignment operator commit ecea8371ff03c15fb3dc27ee4108b98335fd2d63 Author: Kazu Hirata Date: Sat Jun 15 14:02:42 2024 -0700 added std::move to the move constructor and assignment operator, but we can just use = default to have the compiler to generate them. As expected, the number of heap allocations is virtually unchanged. --- llvm/include/llvm/Analysis/TargetLibraryInfo.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h index ee19bc816b4e0..37e8bcbcc009e 100644 --- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h +++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h @@ -315,15 +315,9 @@ class TargetLibraryInfo { // Provide value semantics. TargetLibraryInfo(const TargetLibraryInfo &TLI) = default; - TargetLibraryInfo(TargetLibraryInfo &&TLI) - : Impl(TLI.Impl), - OverrideAsUnavailable(std::move(TLI.OverrideAsUnavailable)) {} + TargetLibraryInfo(TargetLibraryInfo &&TLI) = default; TargetLibraryInfo &operator=(const TargetLibraryInfo &TLI) = default; - TargetLibraryInfo &operator=(TargetLibraryInfo &&TLI) { - Impl = TLI.Impl; - OverrideAsUnavailable = std::move(TLI.OverrideAsUnavailable); - return *this; - } + TargetLibraryInfo &operator=(TargetLibraryInfo &&TLI) = default; /// Determine whether a callee with the given TLI can be inlined into /// caller with this TLI, based on 'nobuiltin' attributes. When requested,