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