asan: do not instrument direct inbounds accesses to stack variables
authorDmitry Vyukov <dvyukov@google.com>
Wed, 4 Mar 2015 13:27:53 +0000 (13:27 +0000)
committerDmitry Vyukov <dvyukov@google.com>
Wed, 4 Mar 2015 13:27:53 +0000 (13:27 +0000)
commit826cbaf934b102c853c03116b6e5d92ace364666
tree43bc6c7006156b9d1fac0b4f447a432267a32290
parentdee2f990fefddd4ce4cdcea62d932d6fd22b8c6b
asan: do not instrument direct inbounds accesses to stack variables

Do not instrument direct accesses to stack variables that can be
proven to be inbounds, e.g. accesses to fields of structs on stack.

But it eliminates 33% of instrumentation on webrtc/modules_unittests
(number of memory accesses goes down from 290152 to 193998) and
reduces binary size by 15% (from 74M to 64M) and improved compilation time by 6-12%.

The optimization is guarded by asan-opt-stack flag that is off by default.

http://reviews.llvm.org/D7583

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