tsan: don't consider debug calls as calls
authorDmitry Vyukov <dvyukov@google.com>
Wed, 17 Nov 2021 12:56:16 +0000 (13:56 +0100)
committerDmitry Vyukov <dvyukov@google.com>
Wed, 17 Nov 2021 13:42:16 +0000 (14:42 +0100)
commita7c57c4ec8100523e200ed1f608e1efbfd43a2f6
treebcb24e87a99762a6f57e465b4af2bca06972a664
parent2b4948448f03104b4b957860dd8c019d0b9df2f0
tsan: don't consider debug calls as calls

Tsan pass does 2 optimizations based on presence of calls:
1. Don't emit function entry/exit callbacks if there are no calls
and no memory accesses.
2. Combine read/write of the same variable if there are no
intervening calls.
However, all debug info is represented as CallInst as well
and thus effectively disables these optimizations.
Don't consider debug info calls as calls.

Reviewed By: glider, melver

Differential Revision: https://reviews.llvm.org/D114079
llvm/lib/Transforms/Instrumentation/ThreadSanitizer.cpp
llvm/test/Instrumentation/ThreadSanitizer/debug_calls.ll [new file with mode: 0644]