1 ; RUN: llc < %s -march=x86-64 -asm-verbose=false | FileCheck %s
3 ; Currently, floating-point selects are lowered to CFG triangles.
4 ; This means that one side of the select is always unconditionally
5 ; evaluated, however with MachineSink we can sink the other side so
6 ; that it's conditionally evaluated.
10 ; CHECK-NEXT: testb $1, %dil
14 define double @foo(double %x, double %y, i1 %c) nounwind {
15 %a = fdiv double %x, 3.2
16 %b = fdiv double %y, 3.3
17 %z = select i1 %c, double %a, double %b
21 ; Hoist floating-point constant-pool loads out of loops.
26 define void @bar(double* nocapture %p, i64 %n) nounwind {
28 %0 = icmp sgt i64 %n, 0
29 br i1 %0, label %bb, label %return
32 %i.03 = phi i64 [ 0, %entry ], [ %3, %bb ]
33 %scevgep = getelementptr double* %p, i64 %i.03
34 %1 = load double* %scevgep, align 8
35 %2 = fdiv double 3.200000e+00, %1
36 store double %2, double* %scevgep, align 8
37 %3 = add nsw i64 %i.03, 1
38 %exitcond = icmp eq i64 %3, %n
39 br i1 %exitcond, label %return, label %bb