1 ; RUN: llc -march=x86-64 -mcpu=core2 < %s | FileCheck %s
3 ; cmp with single-use load, should not form cmov.
4 define i32 @test1(double %a, double* nocapture %b, i32 %x, i32 %y) {
5 %load = load double, double* %b, align 8
6 %cmp = fcmp olt double %load, %a
7 %cond = select i1 %cmp, i32 %x, i32 %y
16 ; Sanity check: no load.
17 define i32 @test2(double %a, double %b, i32 %x, i32 %y) {
18 %cmp = fcmp ogt double %a, %b
19 %cond = select i1 %cmp, i32 %x, i32 %y
26 ; Multiple uses of %a, should not form cmov.
27 define i32 @test3(i32 %a, i32* nocapture %b, i32 %x) {
28 %load = load i32, i32* %b, align 4
29 %cmp = icmp ult i32 %load, %a
30 %cond = select i1 %cmp, i32 %a, i32 %x
39 ; Multiple uses of the load.
40 define i32 @test4(i32 %a, i32* nocapture %b, i32 %x, i32 %y) {
41 %load = load i32, i32* %b, align 4
42 %cmp = icmp ult i32 %load, %a
43 %cond = select i1 %cmp, i32 %x, i32 %y
44 %add = add i32 %cond, %load
51 ; Multiple uses of the cmp.
52 define i32 @test5(i32 %a, i32* nocapture %b, i32 %x, i32 %y) {
53 %load = load i32, i32* %b, align 4
54 %cmp = icmp ult i32 %load, %a
55 %cmp1 = icmp ugt i32 %load, %a
56 %cond = select i1 %cmp1, i32 %a, i32 %y
57 %cond5 = select i1 %cmp, i32 %cond, i32 %x