1 ; RUN: llc < %s -mtriple=aarch64 -mattr=+mte | FileCheck %s
3 define i8* @tagp2(i8* %p, i8* %tag) {
6 ; CHECK: subp [[R:x[0-9]+]], x0, x1
7 ; CHECK: add [[R]], [[R]], x1
8 ; CHECK: addg x0, [[R]], #0, #2
10 %q = call i8* @llvm.aarch64.tagp.p0i8(i8* %p, i8* %tag, i64 2)
14 define i8* @irg_tagp_unrelated(i8* %p, i8* %q) {
16 ; CHECK-LABEL: irg_tagp_unrelated:
17 ; CHECK: irg [[R0:x[0-9]+]], x0{{$}}
18 ; CHECK: subp [[R:x[0-9]+]], [[R0]], x1
19 ; CHECK: add [[R]], [[R0]], x1
20 ; CHECK: addg x0, [[R]], #0, #1
22 %p1 = call i8* @llvm.aarch64.irg(i8* %p, i64 0)
23 %q1 = call i8* @llvm.aarch64.tagp.p0i8(i8* %p1, i8* %q, i64 1)
27 define i8* @tagp_alloca(i8* %tag) {
29 ; CHECK-LABEL: tagp_alloca:
30 ; CHECK: mov [[R0:x[0-9]+]], sp{{$}}
31 ; CHECK: subp [[R:x[0-9]+]], [[R0]], x0{{$}}
32 ; CHECK: add [[R]], [[R0]], x0{{$}}
33 ; CHECK: addg x0, [[R]], #0, #3
35 %a = alloca i8, align 16
36 %q = call i8* @llvm.aarch64.tagp.p0i8(i8* %a, i8* %tag, i64 3)
40 declare i8* @llvm.aarch64.irg(i8* %p, i64 %exclude)
41 declare i8* @llvm.aarch64.tagp.p0i8(i8* %p, i8* %tag, i64 %ofs)