mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-24 03:33:20 +01:00
e010508942
Implement IR intrinsics for stack tagging. Generated code is very unoptimized for now. Two special intrinsics, llvm.aarch64.irg.sp and llvm.aarch64.tagp are used to implement a tagged stack frame pointer in a virtual register. Differential Revision: https://reviews.llvm.org/D64172 llvm-svn: 366360
43 lines
900 B
LLVM
43 lines
900 B
LLVM
; RUN: llc < %s -mtriple=aarch64 -mattr=+mte | FileCheck %s
|
|
|
|
define i8* @irg_imm16(i8* %p) {
|
|
entry:
|
|
; CHECK-LABEL: irg_imm16:
|
|
; CHECK: mov w[[R:[0-9]+]], #16
|
|
; CHECK: irg x0, x0, x[[R]]
|
|
; CHECK: ret
|
|
%q = call i8* @llvm.aarch64.irg(i8* %p, i64 16)
|
|
ret i8* %q
|
|
}
|
|
|
|
define i8* @irg_imm0(i8* %p) {
|
|
entry:
|
|
; CHECK-LABEL: irg_imm0:
|
|
; CHECK: irg x0, x0{{$}}
|
|
; CHECK: ret
|
|
%q = call i8* @llvm.aarch64.irg(i8* %p, i64 0)
|
|
ret i8* %q
|
|
}
|
|
|
|
define i8* @irg_reg(i8* %p, i64 %ex) {
|
|
entry:
|
|
; CHECK-LABEL: irg_reg:
|
|
; CHECK: irg x0, x0, x1
|
|
; CHECK: ret
|
|
%q = call i8* @llvm.aarch64.irg(i8* %p, i64 %ex)
|
|
ret i8* %q
|
|
}
|
|
|
|
; undef argument in irg is treated specially
|
|
define i8* @irg_sp() {
|
|
entry:
|
|
; CHECK-LABEL: irg_sp:
|
|
; CHECK: irg x0, sp{{$}}
|
|
; CHECK: ret
|
|
%q = call i8* @llvm.aarch64.irg.sp(i64 0)
|
|
ret i8* %q
|
|
}
|
|
|
|
declare i8* @llvm.aarch64.irg(i8* %p, i64 %exclude)
|
|
declare i8* @llvm.aarch64.irg.sp(i64 %exclude)
|