1 ; RUN: opt -S -passes=instsimplify,instcombine < %s | FileCheck %s
3 ; CHECK-LABEL: define void @checkNonnullIrg()
4 define void @checkNonnullIrg() {
5 ; CHECK: %[[p:.*]] = call ptr @llvm.aarch64.irg(ptr nonnull
6 ; CHECK: call void @use(ptr nonnull %[[p]])
8 %0 = alloca i8, align 16
10 %p = call ptr @llvm.aarch64.irg(ptr %0, i64 5)
11 call void @use(ptr %p)
16 ; CHECK-LABEL: define void @checkNonnullTagp(
17 define void @checkNonnullTagp(ptr %tag) {
18 ; CHECK: %[[p:.*]] = call ptr @llvm.aarch64.tagp.p0(ptr nonnull %a, ptr %tag, i64 1)
19 ; CHECK: %[[p2:.*]] = call ptr @llvm.aarch64.tagp.p0(ptr nonnull %[[p]], ptr %tag, i64 2)
20 ; CHECK: call void @use(ptr nonnull %[[p2]])
22 %a = alloca i8, align 8
24 %p = call ptr @llvm.aarch64.tagp.p0(ptr %a, ptr %tag, i64 1)
25 %p2 = call ptr @llvm.aarch64.tagp.p0(ptr %p, ptr %tag, i64 2)
26 call void @use(ptr %p2)
31 declare ptr @llvm.aarch64.irg(ptr, i64)
32 declare ptr @llvm.aarch64.tagp.p0(ptr, ptr, i64)
34 declare void @use(ptr)