1 ; RUN: llc < %s -march=x86-64 -mattr=+64bit,+sse3 -print-failed-fuse-candidates |& \
2 ; RUN: grep fail | count 1
4 declare float @test_f(float %f)
5 declare double @test_d(double %f)
6 declare <4 x float> @test_vf(<4 x float> %f)
7 declare <2 x double> @test_vd(<2 x double> %f)
8 declare float @llvm.sqrt.f32(float)
9 declare double @llvm.sqrt.f64(double)
11 declare <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float>)
12 declare <4 x float> @llvm.x86.sse.sqrt.ps(<4 x float>)
13 declare <4 x float> @llvm.x86.sse.rcp.ps(<4 x float>)
14 declare <4 x float> @llvm.x86.sse.min.ps(<4 x float>, <4 x float>)
15 declare <4 x float> @llvm.x86.sse.max.ps(<4 x float>, <4 x float>)
16 declare <4 x float> @llvm.x86.sse.cmp.ps(<4 x float>, <4 x float>, i8)
17 declare <4 x float> @llvm.x86.sse3.addsub.ps(<4 x float>, <4 x float>)
18 declare <4 x float> @llvm.x86.sse3.hadd.ps(<4 x float>, <4 x float>)
19 declare <4 x float> @llvm.x86.sse3.hsub.ps(<4 x float>, <4 x float>)
20 declare <2 x double> @llvm.x86.sse2.sqrt.pd(<2 x double>)
21 declare <2 x double> @llvm.x86.sse2.min.pd(<2 x double>, <2 x double>)
22 declare <2 x double> @llvm.x86.sse2.max.pd(<2 x double>, <2 x double>)
23 declare <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double>, <2 x double>, i8)
24 declare <2 x double> @llvm.x86.sse3.addsub.pd(<2 x double>, <2 x double>)
25 declare <2 x double> @llvm.x86.sse3.hadd.pd(<2 x double>, <2 x double>)
26 declare <2 x double> @llvm.x86.sse3.hsub.pd(<2 x double>, <2 x double>)
28 define float @foo(float %f) {
29 %a = call float @test_f(float %f)
30 %t = call float @llvm.sqrt.f32(float %f)
33 define double @doo(double %f) {
34 %a = call double @test_d(double %f)
35 %t = call double @llvm.sqrt.f64(double %f)
38 define <4 x float> @a0(<4 x float> %f) {
39 %a = call <4 x float> @test_vf(<4 x float> %f)
40 %t = call <4 x float> @llvm.x86.sse.rsqrt.ps(<4 x float> %f)
43 define <4 x float> @a1(<4 x float> %f) {
44 %a = call <4 x float> @test_vf(<4 x float> %f)
45 %t = call <4 x float> @llvm.x86.sse.sqrt.ps(<4 x float> %f)
48 define <4 x float> @a2(<4 x float> %f) {
49 %a = call <4 x float> @test_vf(<4 x float> %f)
50 %t = call <4 x float> @llvm.x86.sse.rcp.ps(<4 x float> %f)
53 define <4 x float> @b3(<4 x float> %f) {
54 %y = call <4 x float> @test_vf(<4 x float> %f)
55 %t = call <4 x float> @llvm.x86.sse.min.ps(<4 x float> %y, <4 x float> %f)
58 define <4 x float> @b4(<4 x float> %f) {
59 %y = call <4 x float> @test_vf(<4 x float> %f)
60 %t = call <4 x float> @llvm.x86.sse.max.ps(<4 x float> %y, <4 x float> %f)
63 define <4 x float> @b5(<4 x float> %f) {
64 %y = call <4 x float> @test_vf(<4 x float> %f)
65 %t = call <4 x float> @llvm.x86.sse.cmp.ps(<4 x float> %y, <4 x float> %f, i8 7)
68 define <4 x float> @b6(<4 x float> %f) {
69 %y = call <4 x float> @test_vf(<4 x float> %f)
70 %t = call <4 x float> @llvm.x86.sse3.addsub.ps(<4 x float> %y, <4 x float> %f)
73 define <4 x float> @b7(<4 x float> %f) {
74 %y = call <4 x float> @test_vf(<4 x float> %f)
75 %t = call <4 x float> @llvm.x86.sse3.hadd.ps(<4 x float> %y, <4 x float> %f)
78 define <4 x float> @b8(<4 x float> %f) {
79 %y = call <4 x float> @test_vf(<4 x float> %f)
80 %t = call <4 x float> @llvm.x86.sse3.hsub.ps(<4 x float> %y, <4 x float> %f)
83 define <2 x double> @c1(<2 x double> %f) {
84 %a = call <2 x double> @test_vd(<2 x double> %f)
85 %t = call <2 x double> @llvm.x86.sse2.sqrt.pd(<2 x double> %f)
88 define <2 x double> @d3(<2 x double> %f) {
89 %y = call <2 x double> @test_vd(<2 x double> %f)
90 %t = call <2 x double> @llvm.x86.sse2.min.pd(<2 x double> %y, <2 x double> %f)
93 define <2 x double> @d4(<2 x double> %f) {
94 %y = call <2 x double> @test_vd(<2 x double> %f)
95 %t = call <2 x double> @llvm.x86.sse2.max.pd(<2 x double> %y, <2 x double> %f)
98 define <2 x double> @d5(<2 x double> %f) {
99 %y = call <2 x double> @test_vd(<2 x double> %f)
100 %t = call <2 x double> @llvm.x86.sse2.cmp.pd(<2 x double> %y, <2 x double> %f, i8 7)
103 define <2 x double> @d6(<2 x double> %f) {
104 %y = call <2 x double> @test_vd(<2 x double> %f)
105 %t = call <2 x double> @llvm.x86.sse3.addsub.pd(<2 x double> %y, <2 x double> %f)
108 define <2 x double> @d7(<2 x double> %f) {
109 %y = call <2 x double> @test_vd(<2 x double> %f)
110 %t = call <2 x double> @llvm.x86.sse3.hadd.pd(<2 x double> %y, <2 x double> %f)
113 define <2 x double> @d8(<2 x double> %f) {
114 %y = call <2 x double> @test_vd(<2 x double> %f)
115 %t = call <2 x double> @llvm.x86.sse3.hsub.pd(<2 x double> %y, <2 x double> %f)
119 ; This one should fail to fuse.
120 define <2 x double> @z0(<2 x double> %f) {
121 %y = call <2 x double> @test_vd(<2 x double> %f)
122 %t = call <2 x double> @llvm.x86.sse3.hsub.pd(<2 x double> %f, <2 x double> %y)