[tsan] two more compile-time optimizations:
authorKostya Serebryany <kcc@google.com>
Tue, 10 Apr 2012 22:29:17 +0000 (22:29 +0000)
committerKostya Serebryany <kcc@google.com>
Tue, 10 Apr 2012 22:29:17 +0000 (22:29 +0000)
commitcff60c1409e36079b4bc6ecbda84565143bf00af
tree37ee207e2155b163af6bc0da9fa27ebccbe92a1d
parent3aef2ff514c879f98571fb91ddbe1142466a6266
[tsan] two more compile-time optimizations:
- don't isntrument reads from constant globals.
Saves ~1.5% of instrumented instructions on CPU2006
(counting static instructions, not their execution).
- don't insrument reads from vtable (which is a global constant too).
Saves ~5%.

I did not measure the run-time impact of this,
but it is certainly non-negative.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154444 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/ThreadSanitizer.cpp
test/Instrumentation/ThreadSanitizer/read_from_global.ll [new file with mode: 0644]