1; RUN: llc -march=hexagon -machine-sink-split=0 < %s 2; REQUIRES: asserts 3 4target triple = "hexagon-unknown-linux-gnu" 5 6%s.0 = type { double, double, double, double, double, double, i32, double, double, double, double, i8*, 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 i8*], [32 x i8*], [32 x i8], i32 } 7 8@g0 = external unnamed_addr constant [6 x i8], align 8 9 10; Function Attrs: nounwind 11define i32 @f0(double %a0) #0 { 12b0: 13 %v0 = call double bitcast (double (...)* @f1 to double (i8*)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @g0, i32 0, i32 0)) #0 14 %v1 = call i32 bitcast (i32 (...)* @f2 to i32 ()*)() #0 15 %v2 = call i8* @f3(i32 undef) 16 br i1 undef, label %b1, label %b2 17 18b1: ; preds = %b0 19 unreachable 20 21b2: ; preds = %b0 22 br i1 undef, label %b3, label %b4 23 24b3: ; preds = %b2 25 unreachable 26 27b4: ; preds = %b2 28 %v3 = mul i32 %v1, 12 29 br i1 undef, label %b5, label %b6 30 31b5: ; preds = %b4 32 ret i32 0 33 34b6: ; preds = %b4 35 %v4 = call i32 bitcast (i32 (...)* @f2 to i32 ()*)() #0 36 br i1 undef, label %b7, label %b24 37 38b7: ; preds = %b6 39 switch i32 undef, label %b8 [ 40 i32 0, label %b15 41 i32 1, label %b14 42 i32 2, label %b13 43 i32 3, label %b12 44 i32 4, label %b11 45 i32 5, label %b10 46 i32 6, label %b9 47 ] 48 49b8: ; preds = %b7 50 unreachable 51 52b9: ; preds = %b7 53 br label %b10 54 55b10: ; preds = %b9, %b7 56 unreachable 57 58b11: ; preds = %b7 59 unreachable 60 61b12: ; preds = %b7 62 br label %b13 63 64b13: ; preds = %b12, %b7 65 unreachable 66 67b14: ; preds = %b7 68 %v5 = call %s.0* bitcast (%s.0* (...)* @f4 to %s.0* (i32)*)(i32 0) #0 69 %v6 = icmp ult i32 %v4, 8 70 br i1 %v6, label %b16, label %b15 71 72b15: ; preds = %b14, %b7 73 unreachable 74 75b16: ; preds = %b14 76 %v7 = and i32 %v4, 3 77 br i1 undef, label %b17, label %b18 78 79b17: ; preds = %b16 80 br i1 undef, label %b19, label %b18 81 82b18: ; preds = %b18, %b17, %b16 83 %v8 = phi i32 [ %v10, %b18 ], [ 0, %b16 ], [ undef, %b17 ] 84 %v9 = shl i32 %v8, 5 85 %v10 = add nsw i32 %v8, 4 86 %v11 = icmp eq i32 %v10, %v4 87 br i1 %v11, label %b19, label %b18 88 89b19: ; preds = %b18, %b17 90 br i1 undef, label %b20, label %b23 91 92b20: ; preds = %b19 93 %v12 = icmp eq i32 %v7, 2 94 br i1 %v12, label %b21, label %b22 95 96b21: ; preds = %b20 97 %v13 = getelementptr i8, i8* %v2, i32 0 98 %v14 = bitcast i8* %v13 to double* 99 %v15 = or i32 0, 16 100 %v16 = getelementptr i8, i8* %v2, i32 %v15 101 %v17 = bitcast i8* %v16 to double* 102 %v18 = load double, double* undef, align 8, !tbaa !0 103 %v19 = fcmp olt double -1.000000e+11, %v18 104 %v20 = select i1 %v19, double %v18, double -1.000000e+11 105 %v21 = load double, double* %v14, align 8, !tbaa !0 106 %v22 = fcmp olt double -1.000000e+11, %v21 107 %v23 = select i1 %v22, double %v21, double -1.000000e+11 108 %v24 = load double, double* %v17, align 8, !tbaa !0 109 %v25 = fcmp olt double -1.000000e+11, %v24 110 %v26 = select i1 %v25, double %v24, double -1.000000e+11 111 %v27 = fcmp ogt double 1.000000e+11, %v18 112 %v28 = select i1 %v27, double %v18, double 1.000000e+11 113 %v29 = fcmp ogt double 1.000000e+11, %v21 114 %v30 = select i1 %v29, double %v21, double 1.000000e+11 115 %v31 = fcmp ogt double 1.000000e+11, %v24 116 %v32 = select i1 %v31, double %v24, double 1.000000e+11 117 %v33 = add i32 0, 1 118 %v34 = getelementptr i8, i8* %v2, i32 32 119 br label %b22 120 121b22: ; preds = %b21, %b20 122 %v35 = phi double [ %v20, %b21 ], [ -1.000000e+11, %b20 ] 123 %v36 = phi double [ %v28, %b21 ], [ 1.000000e+11, %b20 ] 124 %v37 = phi double [ %v23, %b21 ], [ -1.000000e+11, %b20 ] 125 %v38 = phi double [ %v30, %b21 ], [ 1.000000e+11, %b20 ] 126 %v39 = phi double [ %v26, %b21 ], [ -1.000000e+11, %b20 ] 127 %v40 = phi double [ %v32, %b21 ], [ 1.000000e+11, %b20 ] 128 %v41 = phi i8* [ %v34, %b21 ], [ %v2, %b20 ] 129 %v42 = phi i32 [ %v33, %b21 ], [ 0, %b20 ] 130 %v43 = shl nsw i32 %v42, 5 131 %v44 = bitcast i8* %v41 to double* 132 %v45 = or i32 %v43, 8 133 %v46 = getelementptr i8, i8* %v2, i32 %v45 134 %v47 = bitcast i8* %v46 to double* 135 %v48 = load double, double* %v44, align 8, !tbaa !0 136 %v49 = select i1 undef, double %v48, double %v35 137 %v50 = load double, double* %v47, align 8, !tbaa !0 138 %v51 = fcmp olt double %v37, %v50 139 %v52 = select i1 %v51, double %v50, double %v37 140 %v53 = load double, double* undef, align 8, !tbaa !0 141 %v54 = fcmp olt double %v39, %v53 142 %v55 = select i1 %v54, double %v53, double %v39 143 %v56 = fcmp ogt double %v36, %v48 144 %v57 = select i1 %v56, double %v48, double %v36 145 %v58 = fcmp ogt double %v38, %v50 146 %v59 = select i1 %v58, double %v50, double %v38 147 %v60 = select i1 undef, double %v53, double %v40 148 %v61 = add i32 %v42, 1 149 br i1 undef, label %b24, label %b23 150 151b23: ; preds = %b23, %b22, %b19 152 %v62 = phi double [ %v79, %b23 ], [ 1.000000e+11, %b19 ], [ %v57, %b22 ] 153 %v63 = phi double [ %v81, %b23 ], [ 1.000000e+11, %b19 ], [ %v59, %b22 ] 154 %v64 = phi i32 [ %v82, %b23 ], [ 0, %b19 ], [ %v61, %b22 ] 155 %v65 = shl i32 %v64, 5 156 %v66 = load double, double* undef, align 8, !tbaa !0 157 %v67 = load double, double* undef, align 8, !tbaa !0 158 %v68 = select i1 undef, double %v66, double %v62 159 %v69 = select i1 undef, double %v67, double %v63 160 %v70 = load double, double* undef, align 8, !tbaa !0 161 %v71 = select i1 false, double 0.000000e+00, double %v68 162 %v72 = select i1 undef, double %v70, double %v69 163 %v73 = bitcast i8* undef to double* 164 %v74 = load double, double* undef, align 8, !tbaa !0 165 %v75 = fcmp ogt double %v71, 0.000000e+00 166 %v76 = select i1 %v75, double 0.000000e+00, double %v71 167 %v77 = select i1 undef, double %v74, double %v72 168 %v78 = load double, double* undef, align 8, !tbaa !0 169 %v79 = select i1 undef, double %v78, double %v76 170 %v80 = fcmp ogt double %v77, 0.000000e+00 171 %v81 = select i1 %v80, double 0.000000e+00, double %v77 172 %v82 = add i32 %v64, 4 173 %v83 = icmp eq i32 %v82, %v4 174 br i1 %v83, label %b24, label %b23 175 176b24: ; preds = %b23, %b22, %b6 177 %v84 = phi double [ -1.000000e+11, %b6 ], [ %v49, %b22 ], [ undef, %b23 ] 178 %v85 = phi double [ -1.000000e+11, %b6 ], [ %v52, %b22 ], [ 0.000000e+00, %b23 ] 179 %v86 = phi double [ -1.000000e+11, %b6 ], [ %v55, %b22 ], [ 0.000000e+00, %b23 ] 180 %v87 = phi double [ 1.000000e+11, %b6 ], [ %v60, %b22 ], [ undef, %b23 ] 181 %v88 = fsub double %v84, undef 182 %v89 = fsub double %v85, undef 183 %v90 = fadd double undef, 1.000000e+00 184 %v91 = fptosi double %v90 to i32 185 %v92 = fsub double %v86, %v87 186 %v93 = fdiv double %v92, %v0 187 %v94 = fadd double %v93, 1.000000e+00 188 %v95 = fptosi double %v94 to i32 189 br i1 undef, label %b25, label %b27 190 191b25: ; preds = %b24 192 %v96 = fdiv double %v88, 0.000000e+00 193 %v97 = fadd double %v96, 1.000000e+00 194 %v98 = fptosi double %v97 to i32 195 %v99 = fdiv double %v89, 0.000000e+00 196 %v100 = fadd double %v99, 1.000000e+00 197 %v101 = fptosi double %v100 to i32 198 %v102 = fadd double undef, 1.000000e+00 199 %v103 = fptosi double %v102 to i32 200 %v104 = call i8* @f3(i32 undef) 201 br i1 false, label %b26, label %b27 202 203b26: ; preds = %b25 204 unreachable 205 206b27: ; preds = %b25, %b24 207 %v105 = phi i8* [ %v104, %b25 ], [ undef, %b24 ] 208 %v106 = phi i32 [ %v103, %b25 ], [ %v95, %b24 ] 209 %v107 = phi i32 [ %v101, %b25 ], [ %v91, %b24 ] 210 %v108 = phi i32 [ %v98, %b25 ], [ undef, %b24 ] 211 %v109 = phi double [ 0.000000e+00, %b25 ], [ %v0, %b24 ] 212 %v110 = mul i32 %v108, 232 213 %v111 = icmp sgt i32 %v106, 0 214 %v112 = mul i32 %v107, 232 215 %v113 = mul i32 %v112, %v108 216 %v114 = fmul double %v109, 5.000000e-01 217 %v115 = and i32 %v106, 3 218 %v116 = icmp ult i32 %v106, 4 219 br label %b28 220 221b28: ; preds = %b35, %b27 222 %v117 = phi i32 [ %v146, %b35 ], [ 0, %b27 ] 223 %v118 = mul i32 %v117, 232 224 br i1 undef, label %b29, label %b35 225 226b29: ; preds = %b28 227 %v119 = add i32 %v118, 8 228 %v120 = add i32 %v118, 16 229 br i1 %v111, label %b30, label %b35 230 231b30: ; preds = %b34, %b29 232 %v121 = phi i32 [ %v144, %b34 ], [ 0, %b29 ] 233 %v122 = mul i32 %v110, %v121 234 %v123 = add i32 %v119, %v122 235 %v124 = add i32 %v120, %v122 236 %v125 = sitofp i32 %v121 to double 237 %v126 = fmul double %v125, %v109 238 %v127 = fadd double %v126, %v114 239 %v128 = fadd double %v127, undef 240 switch i32 %v115, label %b33 [ 241 i32 2, label %b31 242 i32 1, label %b32 243 ] 244 245b31: ; preds = %b30 246 %v129 = add i32 %v123, 0 247 %v130 = getelementptr i8, i8* %v105, i32 %v129 248 %v131 = bitcast i8* %v130 to double* 249 store double %v128, double* %v131, align 8, !tbaa !0 250 br label %b32 251 252b32: ; preds = %b31, %b30 253 %v132 = add nsw i32 0, 1 254 br i1 %v116, label %b34, label %b33 255 256b33: ; preds = %b33, %b32, %b30 257 %v133 = phi i32 [ %v142, %b33 ], [ 0, %b30 ], [ %v132, %b32 ] 258 %v134 = mul i32 %v113, %v133 259 %v135 = add i32 %v124, %v134 260 %v136 = getelementptr i8, i8* %v105, i32 %v135 261 %v137 = bitcast i8* %v136 to double* 262 %v138 = sitofp i32 %v133 to double 263 store double undef, double* %v137, align 8, !tbaa !0 264 %v139 = fmul double undef, %v109 265 %v140 = fadd double %v139, %v114 266 %v141 = fadd double %v140, %v87 267 store double %v141, double* undef, align 8, !tbaa !0 268 %v142 = add nsw i32 %v133, 4 269 %v143 = icmp eq i32 %v142, %v106 270 br i1 %v143, label %b34, label %b33 271 272b34: ; preds = %b33, %b32 273 %v144 = add i32 %v121, 1 274 %v145 = icmp eq i32 %v144, %v107 275 br i1 %v145, label %b35, label %b30 276 277b35: ; preds = %b34, %b29, %b28 278 %v146 = add i32 %v117, 1 279 br label %b28 280} 281 282declare double @f1(...) 283 284declare i32 @f2(...) 285 286; Function Attrs: nounwind 287declare noalias i8* @f3(i32) #0 288 289declare %s.0* @f4(...) 290 291attributes #0 = { nounwind } 292 293!0 = !{!1, !1, i64 0} 294!1 = !{!"double", !2} 295!2 = !{!"omnipotent char", !3} 296!3 = !{!"Simple C/C++ TBAA"} 297