[llvm] [TargetLibraryInfo] Use std::move (NFC) (PR #95671)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Jun 15 10:28:30 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-analysis
Author: Kazu Hirata (kazutakahirata)
<details>
<summary>Changes</summary>
The std::move here saves 0.11% of heap allocations during the
compilation of a large preprocessed file, namely X86ISelLowering.cpp,
for the X86 target.
---
Full diff: https://github.com/llvm/llvm-project/pull/95671.diff
1 Files Affected:
- (modified) llvm/include/llvm/Analysis/TargetLibraryInfo.h (+2-1)
``````````diff
diff --git a/llvm/include/llvm/Analysis/TargetLibraryInfo.h b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
index f5da222d11f55..b29046a969448 100644
--- a/llvm/include/llvm/Analysis/TargetLibraryInfo.h
+++ b/llvm/include/llvm/Analysis/TargetLibraryInfo.h
@@ -316,7 +316,8 @@ class TargetLibraryInfo {
// Provide value semantics.
TargetLibraryInfo(const TargetLibraryInfo &TLI) = default;
TargetLibraryInfo(TargetLibraryInfo &&TLI)
- : Impl(TLI.Impl), OverrideAsUnavailable(TLI.OverrideAsUnavailable) {}
+ : Impl(TLI.Impl),
+ OverrideAsUnavailable(std::move(TLI.OverrideAsUnavailable)) {}
TargetLibraryInfo &operator=(const TargetLibraryInfo &TLI) = default;
TargetLibraryInfo &operator=(TargetLibraryInfo &&TLI) {
Impl = TLI.Impl;
``````````
</details>
https://github.com/llvm/llvm-project/pull/95671
More information about the llvm-commits
mailing list