tsan: do not instrument not captured values
authorDmitry Vyukov <dvyukov@google.com>
Thu, 12 Feb 2015 09:55:28 +0000 (09:55 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Thu, 12 Feb 2015 09:55:28 +0000 (09:55 +0000)
commit95fa2f93265ff2efddd05a52897247acacca34a2
tree07d64b88c1f5d7f903e8569663bdbd4d33212f40
parentf41b8e3e49de626e81c5a3b497f389b3d5bd2788
tsan: do not instrument not captured values

I've built some tests in WebRTC with and without this change. With this change number of __tsan_read/write calls is reduced by 20-40%, binary size decreases by 5-10% and execution time drops by ~5%. For example:

$ ls -l old/modules_unittests new/modules_unittests
-rwxr-x--- 1 dvyukov 41708976 Jan 20 18:35 old/modules_unittests
-rwxr-x--- 1 dvyukov 38294008 Jan 20 18:29 new/modules_unittests
$ objdump -d old/modules_unittests | egrep "callq.*__tsan_(read|write|unaligned)" | wc -l
239871
$ objdump -d new/modules_unittests | egrep "callq.*__tsan_(read|write|unaligned)" | wc -l
148365

http://reviews.llvm.org/D7069

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