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