1 ; RUN: llc < %s -mtriple=aarch64 -mattr=+mte | FileCheck %s
3 define ptr @tagp2(ptr %p, ptr %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 ptr @llvm.aarch64.tagp.p0(ptr %p, ptr %tag, i64 2)
14 define ptr @irg_tagp_unrelated(ptr %p, ptr %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 ptr @llvm.aarch64.irg(ptr %p, i64 0)
23 %q1 = call ptr @llvm.aarch64.tagp.p0(ptr %p1, ptr %q, i64 1)
27 define ptr @tagp_alloca(ptr %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 ptr @llvm.aarch64.tagp.p0(ptr %a, ptr %tag, i64 3)
40 declare ptr @llvm.aarch64.irg(ptr %p, i64 %exclude)
41 declare ptr @llvm.aarch64.tagp.p0(ptr %p, ptr %tag, i64 %ofs)