1 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu > %t
3 ; RUN: not grep movap %t
4 ; RUN: grep {\\.quad.*0} %t
6 ; Remat should be able to fold the zero constant into the div instructions
7 ; as a constant-pool load.
9 define void @foo(double* nocapture %x, double* nocapture %y) nounwind {
11 %tmp1 = load double* %x ; <double> [#uses=1]
12 %arrayidx4 = getelementptr inbounds double* %x, i64 1 ; <double*> [#uses=1]
13 %tmp5 = load double* %arrayidx4 ; <double> [#uses=1]
14 %arrayidx8 = getelementptr inbounds double* %x, i64 2 ; <double*> [#uses=1]
15 %tmp9 = load double* %arrayidx8 ; <double> [#uses=1]
16 %arrayidx12 = getelementptr inbounds double* %x, i64 3 ; <double*> [#uses=1]
17 %tmp13 = load double* %arrayidx12 ; <double> [#uses=1]
18 %arrayidx16 = getelementptr inbounds double* %x, i64 4 ; <double*> [#uses=1]
19 %tmp17 = load double* %arrayidx16 ; <double> [#uses=1]
20 %arrayidx20 = getelementptr inbounds double* %x, i64 5 ; <double*> [#uses=1]
21 %tmp21 = load double* %arrayidx20 ; <double> [#uses=1]
22 %arrayidx24 = getelementptr inbounds double* %x, i64 6 ; <double*> [#uses=1]
23 %tmp25 = load double* %arrayidx24 ; <double> [#uses=1]
24 %arrayidx28 = getelementptr inbounds double* %x, i64 7 ; <double*> [#uses=1]
25 %tmp29 = load double* %arrayidx28 ; <double> [#uses=1]
26 %arrayidx32 = getelementptr inbounds double* %x, i64 8 ; <double*> [#uses=1]
27 %tmp33 = load double* %arrayidx32 ; <double> [#uses=1]
28 %arrayidx36 = getelementptr inbounds double* %x, i64 9 ; <double*> [#uses=1]
29 %tmp37 = load double* %arrayidx36 ; <double> [#uses=1]
30 %arrayidx40 = getelementptr inbounds double* %x, i64 10 ; <double*> [#uses=1]
31 %tmp41 = load double* %arrayidx40 ; <double> [#uses=1]
32 %arrayidx44 = getelementptr inbounds double* %x, i64 11 ; <double*> [#uses=1]
33 %tmp45 = load double* %arrayidx44 ; <double> [#uses=1]
34 %arrayidx48 = getelementptr inbounds double* %x, i64 12 ; <double*> [#uses=1]
35 %tmp49 = load double* %arrayidx48 ; <double> [#uses=1]
36 %arrayidx52 = getelementptr inbounds double* %x, i64 13 ; <double*> [#uses=1]
37 %tmp53 = load double* %arrayidx52 ; <double> [#uses=1]
38 %arrayidx56 = getelementptr inbounds double* %x, i64 14 ; <double*> [#uses=1]
39 %tmp57 = load double* %arrayidx56 ; <double> [#uses=1]
40 %arrayidx60 = getelementptr inbounds double* %x, i64 15 ; <double*> [#uses=1]
41 %tmp61 = load double* %arrayidx60 ; <double> [#uses=1]
42 %arrayidx64 = getelementptr inbounds double* %x, i64 16 ; <double*> [#uses=1]
43 %tmp65 = load double* %arrayidx64 ; <double> [#uses=1]
44 %div = fdiv double %tmp1, 0.000000e+00 ; <double> [#uses=1]
45 store double %div, double* %y
46 %div70 = fdiv double %tmp5, 2.000000e-01 ; <double> [#uses=1]
47 %arrayidx72 = getelementptr inbounds double* %y, i64 1 ; <double*> [#uses=1]
48 store double %div70, double* %arrayidx72
49 %div74 = fdiv double %tmp9, 2.000000e-01 ; <double> [#uses=1]
50 %arrayidx76 = getelementptr inbounds double* %y, i64 2 ; <double*> [#uses=1]
51 store double %div74, double* %arrayidx76
52 %div78 = fdiv double %tmp13, 2.000000e-01 ; <double> [#uses=1]
53 %arrayidx80 = getelementptr inbounds double* %y, i64 3 ; <double*> [#uses=1]
54 store double %div78, double* %arrayidx80
55 %div82 = fdiv double %tmp17, 2.000000e-01 ; <double> [#uses=1]
56 %arrayidx84 = getelementptr inbounds double* %y, i64 4 ; <double*> [#uses=1]
57 store double %div82, double* %arrayidx84
58 %div86 = fdiv double %tmp21, 2.000000e-01 ; <double> [#uses=1]
59 %arrayidx88 = getelementptr inbounds double* %y, i64 5 ; <double*> [#uses=1]
60 store double %div86, double* %arrayidx88
61 %div90 = fdiv double %tmp25, 2.000000e-01 ; <double> [#uses=1]
62 %arrayidx92 = getelementptr inbounds double* %y, i64 6 ; <double*> [#uses=1]
63 store double %div90, double* %arrayidx92
64 %div94 = fdiv double %tmp29, 2.000000e-01 ; <double> [#uses=1]
65 %arrayidx96 = getelementptr inbounds double* %y, i64 7 ; <double*> [#uses=1]
66 store double %div94, double* %arrayidx96
67 %div98 = fdiv double %tmp33, 2.000000e-01 ; <double> [#uses=1]
68 %arrayidx100 = getelementptr inbounds double* %y, i64 8 ; <double*> [#uses=1]
69 store double %div98, double* %arrayidx100
70 %div102 = fdiv double %tmp37, 2.000000e-01 ; <double> [#uses=1]
71 %arrayidx104 = getelementptr inbounds double* %y, i64 9 ; <double*> [#uses=1]
72 store double %div102, double* %arrayidx104
73 %div106 = fdiv double %tmp41, 2.000000e-01 ; <double> [#uses=1]
74 %arrayidx108 = getelementptr inbounds double* %y, i64 10 ; <double*> [#uses=1]
75 store double %div106, double* %arrayidx108
76 %div110 = fdiv double %tmp45, 2.000000e-01 ; <double> [#uses=1]
77 %arrayidx112 = getelementptr inbounds double* %y, i64 11 ; <double*> [#uses=1]
78 store double %div110, double* %arrayidx112
79 %div114 = fdiv double %tmp49, 2.000000e-01 ; <double> [#uses=1]
80 %arrayidx116 = getelementptr inbounds double* %y, i64 12 ; <double*> [#uses=1]
81 store double %div114, double* %arrayidx116
82 %div118 = fdiv double %tmp53, 2.000000e-01 ; <double> [#uses=1]
83 %arrayidx120 = getelementptr inbounds double* %y, i64 13 ; <double*> [#uses=1]
84 store double %div118, double* %arrayidx120
85 %div122 = fdiv double %tmp57, 2.000000e-01 ; <double> [#uses=1]
86 %arrayidx124 = getelementptr inbounds double* %y, i64 14 ; <double*> [#uses=1]
87 store double %div122, double* %arrayidx124
88 %div126 = fdiv double %tmp61, 2.000000e-01 ; <double> [#uses=1]
89 %arrayidx128 = getelementptr inbounds double* %y, i64 15 ; <double*> [#uses=1]
90 store double %div126, double* %arrayidx128
91 %div130 = fdiv double %tmp65, 0.000000e+00 ; <double> [#uses=1]
92 %arrayidx132 = getelementptr inbounds double* %y, i64 16 ; <double*> [#uses=1]
93 store double %div130, double* %arrayidx132