• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -newgvn -S | FileCheck %s
2
3; CHECK-LABEL: @test1
4; CHECK: ret i32 %arg
5define i32 @test1(i32 %arg) {
6  %cmp = icmp sge i32 %arg, 5
7  call void @llvm.assume(i1 %cmp)
8  ret i32 %arg
9}
10
11; CHECK-LABEL: @test2
12; CHECK: ret i32 %arg
13define i32 @test2(i32 %arg, i1 %b) {
14  br label %bb
15
16bb:
17  %a = phi i32 [ 1, %0 ], [ 2, %bb ]
18  %cmp = icmp eq i32 %arg, %a
19  call void @llvm.assume(i1 %cmp)
20  br i1 %b, label %bb, label %end
21
22end:
23  ret i32 %arg
24}
25
26declare void @llvm.assume(i1 %cond)
27