[safestack] Fast access to the unsafe stack pointer on AArch64/Android.
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 15 Oct 2015 20:50:16 +0000 (20:50 +0000)
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>
Thu, 15 Oct 2015 20:50:16 +0000 (20:50 +0000)
commit06f1d96236a0faa608567d7dbbb29497c8202504
tree3ab266c11af179a48504f33b0254d38729e645d7
parent1552d17aad5aee7ce782978fd31d80eea5379b39
[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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250456 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