summaryrefslogtreecommitdiffstats
path: root/llvm/test/Instrumentation/AddressSanitizer/stack_layout.ll
Commit message (Collapse)AuthorAgeFilesLines
* ASAN: Provide reliable debug info for local variables at -O0.Adrian Prantl2017-12-111-0/+3
| | | | | | | | | | | | | | | | | | | | | | The function stack poisioner conditionally stores local variables either in an alloca or in malloc'ated memory, which has the unfortunate side-effect, that the actual address of the variable is only materialized when the variable is accessed, which means that those variables are mostly invisible to the debugger even when compiling without optimizations. This patch stores the address of the local stack base into an alloca, which can be referred to by the debug info and is available throughout the function. This adds one extra pointer-sized alloca to each stack frame (but mem2reg can optimize it away again when optimizations are enabled, yielding roughly the same debug info quality as before in optimized code). rdar://problem/30433661 Differential Revision: https://reviews.llvm.org/D41034 llvm-svn: 320415
* Add address space mangling to lifetime intrinsicsMatt Arsenault2017-04-101-6/+6
| | | | | | In preparation for allowing allocas to have non-0 addrspace. llvm-svn: 299876
* [asan] Append line number to variable name if line is available and in the ↵Vitaly Buka2016-10-181-7/+43
| | | | | | | | | | | | same file as the function. PR30498 Reviewers: eugenis Differential Revision: https://reviews.llvm.org/D25715 llvm-svn: 284546
* [asan] Skip promotable allocas to improve performance at -O0Anna Zaks2015-02-271-0/+18
| | | | | | | | | | | | 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.) llvm-svn: 230724
* [ASan] Change fake stack and local variables handling.Alexey Samsonov2014-12-111-4/+16
| | | | | | | | | | | | | | | | | | | | | | | | | This commit changes the way we get fake stack from ASan runtime (to find use-after-return errors) and the way we represent local variables: - __asan_stack_malloc function now returns pointer to newly allocated fake stack frame, or NULL if frame cannot be allocated. It doesn't take pointer to real stack as an input argument, it is calculated inside the runtime. - __asan_stack_free function doesn't take pointer to real stack as an input argument. Now this function is never called if fake stack frame wasn't allocated. - __asan_init version is bumped to reflect changes in the ABI. - new flag "-asan-stack-dynamic-alloca" allows to store all the function local variables in a dynamic alloca, instead of the static one. It reduces the stack space usage in use-after-return mode (dynamic alloca will not be called if the local variables are stored in a fake stack), and improves the debug info quality for local variables (they will not be described relatively to %rbp/%rsp, which are assumed to be clobbered by function calls). This flag is turned off by default for now, but I plan to turn it on after more testing. llvm-svn: 224062
* [ASan] Add -asan-module to the ASan .ll tests.Alexander Potapenko2014-03-201-1/+1
| | | | | | | | After the -asan pass had been split into -asan (function-level) and -asan-module (module-level) some of the tests have silently stopped working, because they didn't instrument the globals anymore. We've decided to have every test using both passes, irrespective of the presence of globals in it. llvm-svn: 204335
* [ASan] Fix the tests broken by r198018 to check for private linkage of ↵Alexander Potapenko2013-12-251-3/+3
| | | | | | ASan-generated globals. llvm-svn: 198020
* [asan] rewrite asan's stack frame layoutKostya Serebryany2013-12-061-0/+49
Summary: Rewrite asan's stack frame layout. First, most of the stack layout logic is moved into a separte file to make it more testable and (potentially) useful for other projects. Second, make the frames more compact by using adaptive redzones (smaller for small objects, larger for large objects). Third, try to minimized gaps due to large alignments (this is hypothetical since today we don't see many stack vars aligned by more than 32). The frames indeed become more compact, but I'll still need to run more benchmarks before committing, but I am sking for review now to get early feedback. This change will be accompanied by a trivial change in compiler-rt tests to match the new frame sizes. Reviewers: samsonov, dvyukov Reviewed By: samsonov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2324 llvm-svn: 196568
OpenPOWER on IntegriCloud