[asan] Skip promotable allocas to improve performance at -O0
authorAnna Zaks <ganna@apple.com>
Fri, 27 Feb 2015 03:12:36 +0000 (03:12 +0000)
committerAnna Zaks <ganna@apple.com>
Fri, 27 Feb 2015 03:12:36 +0000 (03:12 +0000)
commitf891336a25215a6d0720689ccce8bc31dbe3e9ac
tree398a3cfb9e14591727b8674b33324124ce2d1633
parent791a501266e71f6192f46149bca13ceb045fe02a
[asan] Skip promotable allocas to improve performance at -O0

Currently, the ASan executables built with -O0 are unnecessarily slow.
The main reason is that ASan instrumentation pass inserts redundant
checks around promotable allocas. These allocas do not get instrumented
under -O1 because they get converted to virtual registered by mem2reg.
With this patch, ASan instrumentation pass will only instrument non
promotable allocas, giving us a speedup of 39% on a collection of
benchmarks with -O0. (There is no measurable speedup at -O1.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230724 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Instrumentation/AddressSanitizer.cpp
test/Instrumentation/AddressSanitizer/debug_info.ll
test/Instrumentation/AddressSanitizer/do-not-instrument-promotable-allocas.ll [new file with mode: 0644]
test/Instrumentation/AddressSanitizer/instrument-dynamic-allocas.ll
test/Instrumentation/AddressSanitizer/lifetime-uar.ll
test/Instrumentation/AddressSanitizer/lifetime.ll
test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll
test/Instrumentation/AddressSanitizer/stack_layout.ll