• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -instcombine -S | FileCheck %s
2
3; PR1738
4define i1 @test1(double %X, double %Y) {
5        %tmp9 = fcmp ord double %X, 0.000000e+00
6        %tmp13 = fcmp ord double %Y, 0.000000e+00
7        %bothcond = and i1 %tmp13, %tmp9
8        ret i1 %bothcond
9; CHECK:  fcmp ord double %Y, %X
10}
11
12define i1 @test2(i1 %X, i1 %Y) {
13  %a = and i1 %X, %Y
14  %b = and i1 %a, %X
15  ret i1 %b
16; CHECK: @test2
17; CHECK-NEXT: and i1 %X, %Y
18; CHECK-NEXT: ret
19}
20
21define i32 @test3(i32 %X, i32 %Y) {
22  %a = and i32 %X, %Y
23  %b = and i32 %Y, %a
24  ret i32 %b
25; CHECK: @test3
26; CHECK-NEXT: and i32 %X, %Y
27; CHECK-NEXT: ret
28}
29
30define i1 @test4(i32 %X) {
31  %a = icmp ult i32 %X, 31
32  %b = icmp slt i32 %X, 0
33  %c = and i1 %a, %b
34  ret i1 %c
35; CHECK: @test4
36; CHECK-NEXT: ret i1 false
37}
38