summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86ISelLowering.cpp
diff options
context:
space:
mode:
authorEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-04-05 22:41:50 +0000
committerEvgeniy Stepanov <eugeni.stepanov@gmail.com>2016-04-05 22:41:50 +0000
commitdde29e2799b82bf76b263eac46acf3a1ae90d206 (patch)
tree3de199ef85cff9089e3b7b882b6b41eaf996948c /llvm/lib/Target/X86/X86ISelLowering.cpp
parentf8bdd88cd95e5387ad853874fe2db38edfe76c41 (diff)
downloadbcm5719-llvm-dde29e2799b82bf76b263eac46acf3a1ae90d206.tar.gz
bcm5719-llvm-dde29e2799b82bf76b263eac46acf3a1ae90d206.zip
Faster stack-protector for Android/AArch64.
Bionic has a defined thread-local location for the stack protector cookie. Emit a direct load instead of going through __stack_chk_guard. llvm-svn: 265481
Diffstat (limited to 'llvm/lib/Target/X86/X86ISelLowering.cpp')
-rw-r--r--llvm/lib/Target/X86/X86ISelLowering.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index ea5518ed4c6..f81a3082ed2 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -2193,16 +2193,17 @@ unsigned X86TargetLowering::getAddressSpace() const {
return 256;
}
-bool X86TargetLowering::getStackCookieLocation(unsigned &AddressSpace,
- unsigned &Offset) const {
+Value *X86TargetLowering::getStackCookieLocation(IRBuilder<> &IRB) const {
if (!Subtarget.isTargetLinux())
- return false;
+ return TargetLowering::getStackCookieLocation(IRB);
// %fs:0x28, unless we're using a Kernel code model, in which case it's %gs:
// %gs:0x14 on i386
- Offset = (Subtarget.is64Bit()) ? 0x28 : 0x14;
- AddressSpace = getAddressSpace();
- return true;
+ unsigned Offset = (Subtarget.is64Bit()) ? 0x28 : 0x14;
+ unsigned AddressSpace = getAddressSpace();
+ return ConstantExpr::getIntToPtr(
+ ConstantInt::get(Type::getInt32Ty(IRB.getContext()), Offset),
+ Type::getInt8PtrTy(IRB.getContext())->getPointerTo(AddressSpace));
}
Value *X86TargetLowering::getSafeStackPointerLocation(IRBuilder<> &IRB) const {
OpenPOWER on IntegriCloud