aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2021-07-15 10:51:32 +0200
committerDmitry Vyukov <dvyukov@google.com>2021-07-15 17:34:00 +0200
commite33446ea58b8357dd8b79eb39140a1de2baff1ae (patch)
tree413acc17a9abedc7e2451729e8e8330e133ce012 /llvm/lib/Bitcode
parentd40e8091bd1f48e8d3f64e4f99952f0139e9c27b (diff)
downloadllvm-e33446ea58b8357dd8b79eb39140a1de2baff1ae.zip
llvm-e33446ea58b8357dd8b79eb39140a1de2baff1ae.tar.gz
llvm-e33446ea58b8357dd8b79eb39140a1de2baff1ae.tar.bz2
tsan: make obtaining current PC faster
We obtain the current PC is all interceptors and collectively common interceptor code contributes to overall slowdown (in particular cheaper str/mem* functions). The current way to obtain the current PC involves: 4493e1: e8 3a f3 fe ff callq 438720 <_ZN11__sanitizer10StackTrace12GetCurrentPcEv> 4493e9: 48 89 c6 mov %rax,%rsi and the called function is: uptr StackTrace::GetCurrentPc() { 438720: 48 8b 04 24 mov (%rsp),%rax 438724: c3 retq The new way uses address of a local label and involves just: 44a888: 48 8d 35 fa ff ff ff lea -0x6(%rip),%rsi I am not switching all uses of StackTrace::GetCurrentPc to GET_CURRENT_PC because it may lead some differences in produced reports and break tests. The difference comes from the fact that currently we have PC pointing to the CALL instruction, but the new way does not yield any code on its own so the PC points to a random instruction in the function and symbolizing that instruction can produce additional inlined frames (if the random instruction happen to relate to some inlined function). Reviewed By: melver Differential Revision: https://reviews.llvm.org/D106046
Diffstat (limited to 'llvm/lib/Bitcode')
0 files changed, 0 insertions, 0 deletions