mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 19:23:23 +01:00
0919e582e6
Both AArch64 and ARM support llvm.<arch>.thread.pointer intrinsics that just return the thread pointer. I have a pending patch that does the same for SystemZ (D19054), and there are many more targets that could benefit from one. This patch merges the ARM and AArch64 intrinsics into a single target independent one that will also be used by subsequent targets. Differential Revision: http://reviews.llvm.org/D19098 llvm-svn: 266818
23 lines
750 B
LLVM
23 lines
750 B
LLVM
; RUN: opt -safe-stack -S -mtriple=aarch64-linux-android < %s -o - | FileCheck --check-prefix=TLS %s
|
|
|
|
|
|
define void @foo() nounwind uwtable safestack sspreq {
|
|
entry:
|
|
; The first @llvm.thread.pointer is for the unsafe stack pointer, skip it.
|
|
; TLS: call i8* @llvm.thread.pointer()
|
|
|
|
; TLS: %[[TP2:.*]] = call i8* @llvm.thread.pointer()
|
|
; TLS: %[[B:.*]] = getelementptr i8, i8* %[[TP2]], i32 40
|
|
; TLS: %[[C:.*]] = bitcast i8* %[[B]] to i8**
|
|
; TLS: %[[StackGuard:.*]] = load i8*, i8** %[[C]]
|
|
; TLS: store i8* %[[StackGuard]], i8** %[[StackGuardSlot:.*]]
|
|
%a = alloca i128, align 16
|
|
call void @Capture(i128* %a)
|
|
|
|
; TLS: %[[A:.*]] = load i8*, i8** %[[StackGuardSlot]]
|
|
; TLS: icmp ne i8* %[[StackGuard]], %[[A]]
|
|
ret void
|
|
}
|
|
|
|
declare void @Capture(i128*)
|