1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
2 ; RUN: opt -passes=newgvn -S < %s | FileCheck %s
6 define void @test1(float %x, float %y) {
7 ; CHECK-LABEL: define void @test1
8 ; CHECK-SAME: (float [[X:%.*]], float [[Y:%.*]]) {
10 ; CHECK-NEXT: [[CMP1:%.*]] = fcmp oeq float [[Y]], [[X]]
11 ; CHECK-NEXT: call void @use(i1 [[CMP1]])
12 ; CHECK-NEXT: call void @use(i1 [[CMP1]])
13 ; CHECK-NEXT: ret void
16 %cmp1 = fcmp nnan oeq float %y, %x
17 %cmp2 = fcmp oeq float %x, %y
18 call void @use(i1 %cmp1)
19 call void @use(i1 %cmp2)
23 define void @test2(i8 %start, i8 %high) {
24 ; CHECK-LABEL: define void @test2
25 ; CHECK-SAME: (i8 [[START:%.*]], i8 [[HIGH:%.*]]) {
26 ; CHECK-NEXT: [[START1:%.*]] = add i8 [[START]], 4
27 ; CHECK-NEXT: [[T1:%.*]] = icmp ult i8 [[START1]], [[HIGH]]
28 ; CHECK-NEXT: call void @use(i1 [[T1]])
29 ; CHECK-NEXT: call void @use(i1 [[T1]])
30 ; CHECK-NEXT: ret void
32 %start1 = add nsw i8 %start, 4
33 %t1 = icmp ult i8 %start1, %high
34 call void @use(i1 %t1)
36 %start2 = add i8 %start, 4
37 %t2 = icmp ult i8 %start2, %high
38 call void @use(i1 %t2)