[PATCH] [WIP] Use dynamic alloca for stack variables in ASan.

Alexey Samsonov vonosmas at gmail.com
Thu Dec 4 18:10:56 PST 2014


More changes.
  - Disable dynamic-alloca by default for now.
  - Slightly refactor the code and update the tests.
  - Bump __asan_init version.

I've tested this change (with and without enabling dynamic alloca) on a
lot of code for now, and it seems to be pretty stable (workaround to
disable dynamic alloca if there is inline assembly helps a lot). I've verified
that it helps with debug info in simple cases (reported here:
https://code.google.com/p/address-sanitizer/issues/detail?id=235), and I believe
Kuba that it helps his non-ObjC-blocks cases as well.

I've also ran a SPEC benchmarks, and observed no regression (although I'm not
sure that the results are robust/stable enough on my machine). Just this change,
which keeps static alloca, but changes the way we handle fake stack, shows
2.3% speedup on average, and if we enable dynamic alloca average speedup
goes up to 6.8% (for -O2/ASan).

Compiler-rt changes are trivial, I will send them for review in a sepate revision.

Please take a look.

http://reviews.llvm.org/D6465

Files:
  lib/Transforms/Instrumentation/AddressSanitizer.cpp
  test/Instrumentation/AddressSanitizer/basic.ll
  test/Instrumentation/AddressSanitizer/stack_dynamic_alloca.ll
  test/Instrumentation/AddressSanitizer/stack_layout.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D6465.16974.patch
Type: text/x-patch
Size: 15328 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141205/b91a635e/attachment.bin>


More information about the llvm-commits mailing list