• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -S -instsimplify -instcombine < %s | FileCheck %s
2
3; CHECK-LABEL: define void @checkNonnullLaunder()
4define void @checkNonnullLaunder() {
5; CHECK:   %[[p:.*]] = call i8* @llvm.launder.invariant.group.p0i8(i8* nonnull %0)
6; CHECK:   call void @use(i8* nonnull %[[p]])
7entry:
8  %0 = alloca i8, align 8
9
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)
13
14  ret void
15}
16
17; CHECK-LABEL: define void @checkNonnullStrip()
18define void @checkNonnullStrip() {
19; CHECK:   %[[p:.*]] = call i8* @llvm.strip.invariant.group.p0i8(i8* nonnull %0)
20; CHECK:   call void @use(i8* nonnull %[[p]])
21entry:
22  %0 = alloca i8, align 8
23
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)
27
28  ret void
29}
30
31declare i8* @llvm.launder.invariant.group.p0i8(i8*)
32declare i8* @llvm.strip.invariant.group.p0i8(i8*)
33
34declare void @use(i8*)
35