1 ; RUN: llc -march=hexagon -machine-sink-split=0 < %s
4 target triple = "hexagon-unknown-linux-gnu"
6 %s.0 = type { double, double, double, double, double, double, i32, double, double, double, double, ptr, i8, [9 x i8], double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, [200 x ptr], [32 x ptr], [32 x i8], i32 }
8 @g0 = external unnamed_addr constant [6 x i8], align 8
10 ; Function Attrs: nounwind
11 define i32 @f0(double %a0) #0 {
13 %v0 = call double @f1(ptr @g0) #0
14 %v1 = call i32 @f2() #0
15 %v2 = call ptr @f3(i32 undef)
16 br i1 undef, label %b1, label %b2
22 br i1 undef, label %b3, label %b4
29 br i1 undef, label %b5, label %b6
35 %v4 = call i32 @f2() #0
36 br i1 undef, label %b7, label %b24
39 switch i32 undef, label %b8 [
55 b10: ; preds = %b9, %b7
64 b13: ; preds = %b12, %b7
68 %v5 = call ptr @f4(i32 0) #0
69 %v6 = icmp ult i32 %v4, 8
70 br i1 %v6, label %b16, label %b15
72 b15: ; preds = %b14, %b7
77 br i1 undef, label %b17, label %b18
80 br i1 undef, label %b19, label %b18
82 b18: ; preds = %b18, %b17, %b16
83 %v8 = phi i32 [ %v10, %b18 ], [ 0, %b16 ], [ undef, %b17 ]
85 %v10 = add nsw i32 %v8, 4
86 %v11 = icmp eq i32 %v10, %v4
87 br i1 %v11, label %b19, label %b18
89 b19: ; preds = %b18, %b17
90 br i1 undef, label %b20, label %b23
93 %v12 = icmp eq i32 %v7, 2
94 br i1 %v12, label %b21, label %b22
98 %v16 = getelementptr i8, ptr %v2, i32 %v15
99 %v18 = load double, ptr undef, align 8, !tbaa !0
100 %v19 = fcmp olt double -1.000000e+11, %v18
101 %v20 = select i1 %v19, double %v18, double -1.000000e+11
102 %v21 = load double, ptr %v2, align 8, !tbaa !0
103 %v22 = fcmp olt double -1.000000e+11, %v21
104 %v23 = select i1 %v22, double %v21, double -1.000000e+11
105 %v24 = load double, ptr %v16, align 8, !tbaa !0
106 %v25 = fcmp olt double -1.000000e+11, %v24
107 %v26 = select i1 %v25, double %v24, double -1.000000e+11
108 %v27 = fcmp ogt double 1.000000e+11, %v18
109 %v28 = select i1 %v27, double %v18, double 1.000000e+11
110 %v29 = fcmp ogt double 1.000000e+11, %v21
111 %v30 = select i1 %v29, double %v21, double 1.000000e+11
112 %v31 = fcmp ogt double 1.000000e+11, %v24
113 %v32 = select i1 %v31, double %v24, double 1.000000e+11
115 %v34 = getelementptr i8, ptr %v2, i32 32
118 b22: ; preds = %b21, %b20
119 %v35 = phi double [ %v20, %b21 ], [ -1.000000e+11, %b20 ]
120 %v36 = phi double [ %v28, %b21 ], [ 1.000000e+11, %b20 ]
121 %v37 = phi double [ %v23, %b21 ], [ -1.000000e+11, %b20 ]
122 %v38 = phi double [ %v30, %b21 ], [ 1.000000e+11, %b20 ]
123 %v39 = phi double [ %v26, %b21 ], [ -1.000000e+11, %b20 ]
124 %v40 = phi double [ %v32, %b21 ], [ 1.000000e+11, %b20 ]
125 %v41 = phi ptr [ %v34, %b21 ], [ %v2, %b20 ]
126 %v42 = phi i32 [ %v33, %b21 ], [ 0, %b20 ]
127 %v43 = shl nsw i32 %v42, 5
128 %v45 = or i32 %v43, 8
129 %v46 = getelementptr i8, ptr %v2, i32 %v45
130 %v48 = load double, ptr %v41, align 8, !tbaa !0
131 %v49 = select i1 undef, double %v48, double %v35
132 %v50 = load double, ptr %v46, align 8, !tbaa !0
133 %v51 = fcmp olt double %v37, %v50
134 %v52 = select i1 %v51, double %v50, double %v37
135 %v53 = load double, ptr undef, align 8, !tbaa !0
136 %v54 = fcmp olt double %v39, %v53
137 %v55 = select i1 %v54, double %v53, double %v39
138 %v56 = fcmp ogt double %v36, %v48
139 %v57 = select i1 %v56, double %v48, double %v36
140 %v58 = fcmp ogt double %v38, %v50
141 %v59 = select i1 %v58, double %v50, double %v38
142 %v60 = select i1 undef, double %v53, double %v40
143 %v61 = add i32 %v42, 1
144 br i1 undef, label %b24, label %b23
146 b23: ; preds = %b23, %b22, %b19
147 %v62 = phi double [ %v79, %b23 ], [ 1.000000e+11, %b19 ], [ %v57, %b22 ]
148 %v63 = phi double [ %v81, %b23 ], [ 1.000000e+11, %b19 ], [ %v59, %b22 ]
149 %v64 = phi i32 [ %v82, %b23 ], [ 0, %b19 ], [ %v61, %b22 ]
150 %v65 = shl i32 %v64, 5
151 %v66 = load double, ptr undef, align 8, !tbaa !0
152 %v67 = load double, ptr undef, align 8, !tbaa !0
153 %v68 = select i1 undef, double %v66, double %v62
154 %v69 = select i1 undef, double %v67, double %v63
155 %v70 = load double, ptr undef, align 8, !tbaa !0
156 %v71 = select i1 false, double 0.000000e+00, double %v68
157 %v72 = select i1 undef, double %v70, double %v69
158 %v74 = load double, ptr undef, align 8, !tbaa !0
159 %v75 = fcmp ogt double %v71, 0.000000e+00
160 %v76 = select i1 %v75, double 0.000000e+00, double %v71
161 %v77 = select i1 undef, double %v74, double %v72
162 %v78 = load double, ptr undef, align 8, !tbaa !0
163 %v79 = select i1 undef, double %v78, double %v76
164 %v80 = fcmp ogt double %v77, 0.000000e+00
165 %v81 = select i1 %v80, double 0.000000e+00, double %v77
166 %v82 = add i32 %v64, 4
167 %v83 = icmp eq i32 %v82, %v4
168 br i1 %v83, label %b24, label %b23
170 b24: ; preds = %b23, %b22, %b6
171 %v84 = phi double [ -1.000000e+11, %b6 ], [ %v49, %b22 ], [ undef, %b23 ]
172 %v85 = phi double [ -1.000000e+11, %b6 ], [ %v52, %b22 ], [ 0.000000e+00, %b23 ]
173 %v86 = phi double [ -1.000000e+11, %b6 ], [ %v55, %b22 ], [ 0.000000e+00, %b23 ]
174 %v87 = phi double [ 1.000000e+11, %b6 ], [ %v60, %b22 ], [ undef, %b23 ]
175 %v88 = fsub double %v84, undef
176 %v89 = fsub double %v85, undef
177 %v90 = fadd double undef, 1.000000e+00
178 %v91 = fptosi double %v90 to i32
179 %v92 = fsub double %v86, %v87
180 %v93 = fdiv double %v92, %v0
181 %v94 = fadd double %v93, 1.000000e+00
182 %v95 = fptosi double %v94 to i32
183 br i1 undef, label %b25, label %b27
186 %v96 = fdiv double %v88, 0.000000e+00
187 %v97 = fadd double %v96, 1.000000e+00
188 %v98 = fptosi double %v97 to i32
189 %v99 = fdiv double %v89, 0.000000e+00
190 %v100 = fadd double %v99, 1.000000e+00
191 %v101 = fptosi double %v100 to i32
192 %v102 = fadd double undef, 1.000000e+00
193 %v103 = fptosi double %v102 to i32
194 %v104 = call ptr @f3(i32 undef)
195 br i1 false, label %b26, label %b27
200 b27: ; preds = %b25, %b24
201 %v105 = phi ptr [ %v104, %b25 ], [ undef, %b24 ]
202 %v106 = phi i32 [ %v103, %b25 ], [ %v95, %b24 ]
203 %v107 = phi i32 [ %v101, %b25 ], [ %v91, %b24 ]
204 %v108 = phi i32 [ %v98, %b25 ], [ undef, %b24 ]
205 %v109 = phi double [ 0.000000e+00, %b25 ], [ %v0, %b24 ]
206 %v110 = mul i32 %v108, 232
207 %v111 = icmp sgt i32 %v106, 0
208 %v112 = mul i32 %v107, 232
209 %v113 = mul i32 %v112, %v108
210 %v114 = fmul double %v109, 5.000000e-01
211 %v115 = and i32 %v106, 3
212 %v116 = icmp ult i32 %v106, 4
215 b28: ; preds = %b35, %b27
216 %v117 = phi i32 [ %v146, %b35 ], [ 0, %b27 ]
217 %v118 = mul i32 %v117, 232
218 br i1 undef, label %b29, label %b35
221 %v119 = add i32 %v118, 8
222 %v120 = add i32 %v118, 16
223 br i1 %v111, label %b30, label %b35
225 b30: ; preds = %b34, %b29
226 %v121 = phi i32 [ %v144, %b34 ], [ 0, %b29 ]
227 %v122 = mul i32 %v110, %v121
228 %v123 = add i32 %v119, %v122
229 %v124 = add i32 %v120, %v122
230 %v125 = sitofp i32 %v121 to double
231 %v126 = fmul double %v125, %v109
232 %v127 = fadd double %v126, %v114
233 %v128 = fadd double %v127, undef
234 switch i32 %v115, label %b33 [
240 %v129 = add i32 %v123, 0
241 %v130 = getelementptr i8, ptr %v105, i32 %v129
242 store double %v128, ptr %v130, align 8, !tbaa !0
245 b32: ; preds = %b31, %b30
246 %v132 = add nsw i32 0, 1
247 br i1 %v116, label %b34, label %b33
249 b33: ; preds = %b33, %b32, %b30
250 %v133 = phi i32 [ %v142, %b33 ], [ 0, %b30 ], [ %v132, %b32 ]
251 %v134 = mul i32 %v113, %v133
252 %v135 = add i32 %v124, %v134
253 %v136 = getelementptr i8, ptr %v105, i32 %v135
254 %v138 = sitofp i32 %v133 to double
255 store double undef, ptr %v136, align 8, !tbaa !0
256 %v139 = fmul double undef, %v109
257 %v140 = fadd double %v139, %v114
258 %v141 = fadd double %v140, %v87
259 store double %v141, ptr undef, align 8, !tbaa !0
260 %v142 = add nsw i32 %v133, 4
261 %v143 = icmp eq i32 %v142, %v106
262 br i1 %v143, label %b34, label %b33
264 b34: ; preds = %b33, %b32
265 %v144 = add i32 %v121, 1
266 %v145 = icmp eq i32 %v144, %v107
267 br i1 %v145, label %b35, label %b30
269 b35: ; preds = %b34, %b29, %b28
270 %v146 = add i32 %v117, 1
274 declare double @f1(...)
278 ; Function Attrs: nounwind
279 declare noalias ptr @f3(i32) #0
283 attributes #0 = { nounwind }
285 !0 = !{!1, !1, i64 0}
286 !1 = !{!"double", !2}
287 !2 = !{!"omnipotent char", !3}
288 !3 = !{!"Simple C/C++ TBAA"}