[all-commits] [llvm/llvm-project] 82b38e: [ASan][libc++] Optimization of container annotatio...
Tacet via All-commits
all-commits at lists.llvm.org
Thu Dec 21 14:26:23 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 82b38e83cfbb3f996313b22f5daf0d104c0f27dc
https://github.com/llvm/llvm-project/commit/82b38e83cfbb3f996313b22f5daf0d104c0f27dc
Author: Tacet <4922191+AdvenamTacet at users.noreply.github.com>
Date: 2023-12-21 (Thu, 21 Dec 2023)
Changed paths:
M libcxx/include/deque
M libcxx/include/string
M libcxx/include/vector
Log Message:
-----------
[ASan][libc++] Optimization of container annotations (#76082)
This commit implements conditional compilation for ASan helper code.
As convey to me by @EricWF, string benchmarks with UBSan have been
experiencing significant performance hit after the commit with ASan
string annotations. This is likely due to the fact that no-op ASan code
is not optimized out with UBSan. To address this issue, this commit
conditionalizes the inclusion of ASan helper function bodies using
`#ifdef` directives. This approach allows us to selectively include only
the ASan code when it's actually required, thereby enhancing
optimizations and improving performance.
While issue was noticed in string benchmarks, I expect same overhead
(just less noticeable) in other containers, therefore `std::vector` and
`std::deque` have same changes.
To see impact of that change run `string.libcxx.out` with UBSan and
`--benchmark_filter=BM_StringAssign` or
`--benchmark_filter=BM_StringConstruct`.
More information about the All-commits
mailing list