llvm-project/compiler-rt/test
Peter Collingbourne 3859fc653f AArch64: Switch to x20 as the shadow base register for outlined HWASan checks.
From a code size perspective it turns out to be better to use a
callee-saved register to pass the shadow base. For non-leaf functions
it avoids the need to reload the shadow base into x9 after each
function call, at the cost of an additional stack slot to save the
caller's x20. But with x9 there is also a stack size cost, either
as a result of copying x9 to a callee-saved register across calls or
by spilling it to stack, so for the non-leaf functions the change to
stack usage is largely neutral.

It is also code size (and stack size) neutral for many leaf functions.
Although they now need to save/restore x20 this can typically be
combined via LDP/STP into the x30 save/restore. In the case where
the function needs callee-saved registers or stack spills we end up
needing, on average, 8 more bytes of stack and 1 more instruction
but given the improvements to other functions this seems like the
right tradeoff.

Unfortunately we cannot change the register for the v1 (non short
granules) check because the runtime assumes that the shadow base
register is stored in x9, so the v1 check still uses x9.

Aside from that there is no change to the ABI because the choice
of shadow base register is a contract between the caller and the
outlined check function, both of which are compiler generated. We do
need to rename the v2 check functions though because the functions
are deduplicated based on their names, not on their contents, and we
need to make sure that when object files from old and new compilers
are linked together we don't end up with a function that uses x9
calling an outlined check that uses x20 or vice versa.

With this change code size of /system/lib64/*.so in an Android build
with HWASan goes from 200066976 bytes to 194085912 bytes, or a 3%
decrease.

Differential Revision: https://reviews.llvm.org/D90422
2020-10-30 12:51:30 -07:00
..
BlocksRuntime Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
asan [NFC][Asan] Fix cpplint warning in test 2020-10-28 00:38:50 -07:00
builtins These compiler-rt tests should be UNSUPPORTED instead of XFAIL. 2020-10-23 20:57:18 +04:00
cfi [cfi][test] cross-dso/stats.cpp: don't assume the order of static constructors 2020-01-08 15:50:51 -08:00
crt These compiler-rt tests should be UNSUPPORTED instead of XFAIL. 2020-10-23 20:57:18 +04:00
dfsan [sanitizer] Disable ASLR for release_shadow_space 2020-10-29 16:09:03 -03:00
fuzzer [compiler-rt][SystemZ] Skip fuzzer/full-coverage.test 2020-10-28 16:39:46 +01:00
gwp_asan [GWP-ASan] Split the unwinder into segv/non-segv. 2020-07-21 08:25:37 -07:00
hwasan AArch64: Switch to x20 as the shadow base register for outlined HWASan checks. 2020-10-30 12:51:30 -07:00
interception [compiler-rt] Rename lit.*.cfg.* -> lit.*.cfg.py.* 2019-06-27 20:56:04 +00:00
lsan [sanitizer]Update tests to be compatible with Android. 2020-10-21 17:16:54 -07:00
memprof [MemProf] Temporarily disable test failing on a couple bots 2020-10-29 11:26:21 -07:00
msan [msan][asan] Add runtime flag intercept_strcmp 2020-09-18 13:45:55 -07:00
profile Use uint64_t for branch weights instead of uint32_t 2020-10-30 10:03:46 -07:00
safestack compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
sanitizer_common [sanitizer] Escape quotes in tests to fix android bot after D88361 2020-10-13 18:09:38 -07:00
scudo [compiler-rt][scudo][LIT] Use target_suffix instead of target-arch 2020-05-20 03:34:50 +00:00
shadowcallstack compiler-rt: Remove .cc from all lit config files 2019-08-05 19:25:35 +00:00
tsan [TSan][Darwin] Handle NULL argument in interceptor 2020-08-24 11:36:02 -07:00
ubsan [NFC][UBSAN] Try to re-enable tests on IOS 2020-10-27 23:49:31 -07:00
ubsan_minimal [NFC][UBSAN] Refine CHECK pattern in test 2020-10-23 21:11:03 -07:00
xray [xray] Option to omit the function index 2020-06-17 13:49:01 -04:00
.clang-format [compiler-rt] Use "ColumnLimit: 0" instead of "clang-format off" in tests 2018-12-01 01:24:29 +00:00
.clang-tidy [NFC][compiler-rt] Refine .clang-tidy checks 2020-09-05 15:42:15 -07:00
CMakeLists.txt [MemProf] Memory profiling runtime support 2020-10-16 09:47:02 -07:00
lit.common.cfg.py [sanitizer]Update tests to be compatible with Android. 2020-10-21 17:16:54 -07:00
lit.common.configured.in [MemProf] Memory profiling runtime support 2020-10-16 09:47:02 -07:00