[PATCH] asan: do not instrument direct inbounds accesses to stack variables

Dmitry Vyukov dvyukov at google.com
Wed Mar 4 01:38:58 PST 2015


Chandler,

I've applied clang-format.

Renamed s/inbounds/safe/. Comment above the function explains the meaning of safe.

Regarding compilation speed. On top of removing instrumentation and reducing binary size, it also speedups compilation (less stuff for backed to deal with). I've tested on llvm's largest source file lib/Target/X86/X86ISelLowering.cpp.

current without asan -O0:
real	0m4.847s
real	0m4.813s
real	0m4.776s
(I cross-checked that the new compiler has the same performance)

current -fsanitize=address -O0
real	0m7.191s
real	0m7.257s
real	0m7.183s

new -fsanitize=address -O0
real	0m6.619s
real	0m6.798s
real	0m6.722s
(~-6.4%)

current -fsanitize=address -O1
real	0m17.466s
real	0m17.553s
real	0m17.449s

new -fsanitize=address -O1
real	0m15.908s
real	0m15.853s
real	0m15.329s
(~-12.15%)

current -fsanitize=address -O2
real	0m24.337s
real	0m24.246s
real	0m24.604s

new -fsanitize=address -O2
real	0m23.662s
real	0m23.430s
real	0m23.400s
(~-3.49%)

Object file size:
w/o asan: 1228800
current with asan: 3658480 (+197.73%)
new with asan: 3444760 (-5.84%)

Amount of instrumentation (since it is just an object file, I grepped for "callq"):
w/o asan: 8235
current with asan: 37342
new with asan: 33706 (-12.5%)


http://reviews.llvm.org/D7583

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/






More information about the llvm-commits mailing list