1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2 ; RUN: opt < %s -passes=newgvn -S | FileCheck %s
4 define i32 @test1(i32 %arg) {
6 ; CHECK-NEXT: [[CMP:%.*]] = icmp sge i32 [[ARG:%.*]], 5
7 ; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
8 ; CHECK-NEXT: ret i32 [[ARG]]
10 %cmp = icmp sge i32 %arg, 5
11 call void @llvm.assume(i1 %cmp)
15 define i32 @test2(i32 %arg, i1 %b) {
16 ; CHECK-LABEL: @test2(
17 ; CHECK-NEXT: br label [[BB:%.*]]
19 ; CHECK-NEXT: [[A:%.*]] = phi i32 [ 1, [[TMP0:%.*]] ], [ 2, [[BB]] ]
20 ; CHECK-NEXT: [[CMP:%.*]] = icmp eq i32 [[ARG:%.*]], [[A]]
21 ; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
22 ; CHECK-NEXT: br i1 [[B:%.*]], label [[BB]], label [[END:%.*]]
24 ; CHECK-NEXT: ret i32 [[ARG]]
29 %a = phi i32 [ 1, %0 ], [ 2, %bb ]
30 %cmp = icmp eq i32 %arg, %a
31 call void @llvm.assume(i1 %cmp)
32 br i1 %b, label %bb, label %end
38 declare void @llvm.assume(i1 %cond)