[PATCH] D40048: [asan] Prevent rematerialization of &__asan_shadow.

Evgenii Stepanov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 14 13:25:35 PST 2017


eugenis created this revision.
Herald added subscribers: hiraditya, kristof.beyls, aemerson.

In the mode when ASan shadow base is computed as the address of an
external global (__asan_shadow, currently on android/arm32 only),
regalloc prefers to rematerialize this value to save register spills.
Even in -Os. On arm32 it is rather expensive (2 loads + 1 constant
pool entry).

This changes adds an inline asm in the function prologue to suppress
this behavior. It reduces AsanTest binary size by 7%.


https://reviews.llvm.org/D40048

Files:
  llvm/lib/Transforms/Instrumentation/AddressSanitizer.cpp
  llvm/test/Instrumentation/AddressSanitizer/with-ifunc.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40048.122902.patch
Type: text/x-patch
Size: 5122 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171114/9de6de7b/attachment.bin>


More information about the llvm-commits mailing list