[compiler-rt] [scudo] Move ALWAYS_INLINE up in tsd_shared's ScopedTSD ctor (PR #81982)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 16 03:13:04 PST 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-compiler-rt-sanitizer
Author: Fabio D'Urso (fabio-d)
<details>
<summary>Changes</summary>
This PR should fix the performance regression that was introduced by #<!-- -->80061
---
Full diff: https://github.com/llvm/llvm-project/pull/81982.diff
1 Files Affected:
- (modified) compiler-rt/lib/scudo/standalone/tsd_shared.h (+2-2)
``````````diff
diff --git a/compiler-rt/lib/scudo/standalone/tsd_shared.h b/compiler-rt/lib/scudo/standalone/tsd_shared.h
index 0ac2be3d4c294d..db5f6ec2094538 100644
--- a/compiler-rt/lib/scudo/standalone/tsd_shared.h
+++ b/compiler-rt/lib/scudo/standalone/tsd_shared.h
@@ -29,7 +29,7 @@ struct TSDRegistrySharedT {
using ThisT = TSDRegistrySharedT<Allocator, TSDsArraySize, DefaultTSDCount>;
struct ScopedTSD {
- ScopedTSD(ThisT &TSDRegistry) {
+ ALWAYS_INLINE ScopedTSD(ThisT &TSDRegistry) {
CurrentTSD = TSDRegistry.getTSDAndLock();
DCHECK_NE(CurrentTSD, nullptr);
}
@@ -133,7 +133,7 @@ struct TSDRegistrySharedT {
}
private:
- ALWAYS_INLINE TSD<Allocator> *getTSDAndLock() NO_THREAD_SAFETY_ANALYSIS {
+ TSD<Allocator> *getTSDAndLock() NO_THREAD_SAFETY_ANALYSIS {
TSD<Allocator> *TSD = getCurrentTSD();
DCHECK(TSD);
// Try to lock the currently associated context.
``````````
</details>
https://github.com/llvm/llvm-project/pull/81982
More information about the llvm-commits
mailing list