[AArch64] Speed-up leak and address sanitizers on AArch64 for 48-bit VMA
authorSebastian Pop <sebpop@gmail.com>
Tue, 20 Aug 2019 20:54:05 +0000 (20:54 +0000)
committerSebastian Pop <sebpop@gmail.com>
Tue, 20 Aug 2019 20:54:05 +0000 (20:54 +0000)
commit63487bfec927e378e67748fee2730eacebfa1a77
treea49c8a076cb7d8b8e86eedb8c5ba8ba5c9cff940
parent5adace352d5ef63fe344dc95a375bd33040ea987
[AArch64] Speed-up leak and address sanitizers on AArch64 for 48-bit VMA

This patch fixes https://github.com/google/sanitizers/issues/703
On a Graviton-A1 aarch64 machine with 48-bit VMA,
the time spent in LSan and ASan reduced from 2.5s to 0.01s when running

clang -fsanitize=leak compiler-rt/test/lsan/TestCases/sanity_check_pure_c.c && time ./a.out
clang -fsanitize=address compiler-rt/test/lsan/TestCases/sanity_check_pure_c.c && time ./a.out

With this patch, LSan and ASan create both the 32 and 64 allocators and select
at run time between the two allocators following a global variable that is
initialized at init time to whether the allocator64 can be used in the virtual
address space.

Differential Revision: https://reviews.llvm.org/D60243

llvm-svn: 369441
compiler-rt/lib/asan/asan_allocator.cpp
compiler-rt/lib/asan/asan_allocator.h
compiler-rt/lib/asan/asan_stats.cpp
compiler-rt/lib/asan/asan_stats.h
compiler-rt/lib/lsan/lsan_allocator.h
compiler-rt/lib/sanitizer_common/sanitizer_allocator.h
compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h
compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h
compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary64.h
compiler-rt/lib/sanitizer_common/sanitizer_runtime_select_allocator.h [new file with mode: 0644]
compiler-rt/lib/sanitizer_common/tests/sanitizer_allocator_test.cpp