Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt < %s -instcombine -S | FileCheck %s
      2 
      3 ; CHECK: @t1
      4 define zeroext i8 @t1(float %x, float %y) nounwind {
      5        %a = fcmp ueq float %x, %y             ; <i1> [#uses=1]
      6        %b = fcmp uno float %x, %y               ; <i1> [#uses=1]
      7        %c = or i1 %a, %b
      8 ; CHECK-NOT: fcmp uno
      9 ; CHECK: fcmp ueq
     10        %retval = zext i1 %c to i8
     11        ret i8 %retval
     12 }
     13 
     14 ; CHECK: @t2
     15 define zeroext i8 @t2(float %x, float %y) nounwind {
     16        %a = fcmp olt float %x, %y             ; <i1> [#uses=1]
     17        %b = fcmp oeq float %x, %y               ; <i1> [#uses=1]
     18 ; CHECK-NOT: fcmp olt
     19 ; CHECK-NOT: fcmp oeq
     20 ; CHECK: fcmp ole
     21        %c = or i1 %a, %b
     22        %retval = zext i1 %c to i8
     23        ret i8 %retval
     24 }
     25 
     26 ; CHECK: @t3
     27 define zeroext i8 @t3(float %x, float %y) nounwind {
     28        %a = fcmp ult float %x, %y             ; <i1> [#uses=1]
     29        %b = fcmp uge float %x, %y               ; <i1> [#uses=1]
     30        %c = or i1 %a, %b
     31        %retval = zext i1 %c to i8
     32 ; CHECK: ret i8 1
     33        ret i8 %retval
     34 }
     35 
     36 ; CHECK: @t4
     37 define zeroext i8 @t4(float %x, float %y) nounwind {
     38        %a = fcmp ult float %x, %y             ; <i1> [#uses=1]
     39        %b = fcmp ugt float %x, %y               ; <i1> [#uses=1]
     40        %c = or i1 %a, %b
     41 ; CHECK-NOT: fcmp ult
     42 ; CHECK-NOT: fcmp ugt
     43 ; CHECK: fcmp une
     44        %retval = zext i1 %c to i8
     45        ret i8 %retval
     46 }
     47 
     48 ; CHECK: @t5
     49 define zeroext i8 @t5(float %x, float %y) nounwind {
     50        %a = fcmp olt float %x, %y             ; <i1> [#uses=1]
     51        %b = fcmp oge float %x, %y               ; <i1> [#uses=1]
     52        %c = or i1 %a, %b
     53 ; CHECK-NOT: fcmp olt
     54 ; CHECK-NOT: fcmp oge
     55 ; CHECK: fcmp ord
     56        %retval = zext i1 %c to i8
     57        ret i8 %retval
     58 }
     59