1 ; RUN: opt -S -instsimplify -instcombine < %s | FileCheck %s
3 ; CHECK-LABEL: define void @checkNonnullLaunder()
4 define void @checkNonnullLaunder() {
5 ; CHECK: %[[p:.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nonnull %0)
6 ; CHECK: call void @use(i8* nonnull %[[p]])
8 %0 = alloca i8, align 8
10 %p = call i8* @llvm.launder.invariant.group.p0i8(i8* %0)
11 %p2 = call i8* @llvm.launder.invariant.group.p0i8(i8* %p)
12 call void @use(i8* %p2)
17 ; CHECK-LABEL: define void @checkNonnullStrip()
18 define void @checkNonnullStrip() {
19 ; CHECK: %[[p:.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* nonnull %0)
20 ; CHECK: call void @use(i8* nonnull %[[p]])
22 %0 = alloca i8, align 8
24 %p = call i8* @llvm.strip.invariant.group.p0i8(i8* %0)
25 %p2 = call i8* @llvm.strip.invariant.group.p0i8(i8* %p)
26 call void @use(i8* %p2)
31 declare i8* @llvm.launder.invariant.group.p0i8(i8*)
32 declare i8* @llvm.strip.invariant.group.p0i8(i8*)
34 declare void @use(i8*)