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