Home | History | Annotate | Download | only in InstCombine
      1 ; RUN: opt -instcombine -S < %s | FileCheck %s
      2 
      3 ; CHECK: @foo1
      4 define float @foo1(float %a) #0 {
      5 ; CHECK-NOT: xor
      6   %b = fcmp ogt float %a, 0.000000e+00
      7   %c = select i1 %b, float %a, float 0.000000e+00
      8   %d = fcmp olt float %c, 1.000000e+00
      9   %f = select i1 %d, float %c, float 1.000000e+00
     10   ret float %f
     11 }
     12 
     13 ; CHECK: @foo2
     14 define float @foo2(float %a) #0 {
     15 ; CHECK-NOT: xor
     16   %b = fcmp ogt float %a, 0.000000e+00
     17   %c = select i1 %b, float %a, float 0.000000e+00
     18   %d = fcmp olt float %c, 1.000000e+00
     19   %e = select i1 %b, float %a, float 0.000000e+00
     20   %f = select i1 %d, float %e, float 1.000000e+00
     21   ret float %f
     22 }
     23 
     24 attributes #0 = { nounwind readnone ssp uwtable }
     25