[safestack] Fast access to the unsafe stack pointer on AArch64/Android.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Mon, 26 Oct 2015 18:28:25 +0000 (18:28 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Mon, 26 Oct 2015 18:28:25 +0000 (18:28 +0000)
commit324bf0ddcc8acfaba6c07415335a978ba3f0a57f
tree71884284c5fb5ee8e5925e21f7a35e994e3a4dad
parent6aeb31b5f0cb1063b74b062bf453b111477ff808
[safestack] Fast access to the unsafe stack pointer on AArch64/Android.

Android libc provides a fixed TLS slot for the unsafe stack pointer,
and this change implements direct access to that slot on AArch64 via
__builtin_thread_pointer() + offset.

This change also moves more code into TargetLowering and its
target-specific subclasses to get rid of target-specific codegen
in SafeStackPass.

This change does not touch the ARM backend because ARM lowers
builting_thread_pointer as aeabi_read_tp, which is not available
on Android.

The previous iteration of this change was reverted in r250461. This
version leaves the generic, compiler-rt based implementation in
SafeStack.cpp instead of moving it to TargetLoweringBase in order to
allow testing without a TargetMachine.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@251324 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/Target/TargetLowering.h
lib/CodeGen/TargetLoweringBase.cpp
lib/Target/AArch64/AArch64ISelLowering.cpp
lib/Target/AArch64/AArch64ISelLowering.h
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86ISelLowering.h
lib/Transforms/Instrumentation/SafeStack.cpp
test/Transforms/SafeStack/AArch64/abi.ll