1 ; RUN: opt < %s -instcombine -S | FileCheck %s
3 ; x != y ? x : y -> x if it's the right kind of != and at least
4 ; one of x and y is not negative zero.
8 define double @f0(double %x) nounwind readnone {
10 %cmp = fcmp une double %x, -1.0
11 %cond = select i1 %cmp, double %x, double -1.0
15 ; CHECK: ret double -1.000000e+00
16 define double @f1(double %x) nounwind readnone {
18 %cmp = fcmp une double %x, -1.0
19 %cond = select i1 %cmp, double -1.0, double %x
23 ; CHECK: ret double %cond
24 define double @f2(double %x, double %y) nounwind readnone {
26 %cmp = fcmp une double %x, %y
27 %cond = select i1 %cmp, double %x, double %y
31 ; CHECK: ret double %cond
32 define double @f3(double %x, double %y) nounwind readnone {
34 %cmp = fcmp une double %x, %y
35 %cond = select i1 %cmp, double %y, double %x
39 ; CHECK: ret double %cond
40 define double @f4(double %x) nounwind readnone {
42 %cmp = fcmp one double %x, -1.0
43 %cond = select i1 %cmp, double %x, double -1.0
47 ; CHECK: ret double %cond
48 define double @f5(double %x) nounwind readnone {
50 %cmp = fcmp one double %x, -1.0
51 %cond = select i1 %cmp, double -1.0, double %x