1; RUN: opt < %s -analyze -basicaa -da | FileCheck %s 2 3; ModuleID = 'ExactRDIV.bc' 4target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128" 5target triple = "x86_64-apple-macosx10.6.0" 6 7 8;; for (long int i = 0; i < 10; i++) 9;; A[4*i + 10] = i; 10;; for (long int j = 0; j < 10; j++) 11;; *B++ = A[2*j + 1]; 12 13define void @rdiv0(i32* %A, i32* %B) nounwind uwtable ssp { 14entry: 15 br label %for.body 16 17; CHECK: da analyze - none! 18; CHECK: da analyze - none! 19; CHECK: da analyze - confused! 20; CHECK: da analyze - none! 21; CHECK: da analyze - confused! 22; CHECK: da analyze - none! 23 24for.body: ; preds = %entry, %for.body 25 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 26 %conv = trunc i64 %i.03 to i32 27 %mul = shl nsw i64 %i.03, 2 28 %add = add nsw i64 %mul, 10 29 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add 30 store i32 %conv, i32* %arrayidx, align 4 31 %inc = add nsw i64 %i.03, 1 32 %exitcond5 = icmp ne i64 %inc, 10 33 br i1 %exitcond5, label %for.body, label %for.body4.preheader 34 35for.body4.preheader: ; preds = %for.body 36 br label %for.body4 37 38for.body4: ; preds = %for.body4.preheader, %for.body4 39 %j.02 = phi i64 [ %inc9, %for.body4 ], [ 0, %for.body4.preheader ] 40 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 41 %mul5 = shl nsw i64 %j.02, 1 42 %add64 = or i64 %mul5, 1 43 %arrayidx7 = getelementptr inbounds i32, i32* %A, i64 %add64 44 %0 = load i32, i32* %arrayidx7, align 4 45 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 46 store i32 %0, i32* %B.addr.01, align 4 47 %inc9 = add nsw i64 %j.02, 1 48 %exitcond = icmp ne i64 %inc9, 10 49 br i1 %exitcond, label %for.body4, label %for.end10 50 51for.end10: ; preds = %for.body4 52 ret void 53} 54 55 56;; for (long int i = 0; i < 5; i++) 57;; A[11*i - 45] = i; 58;; for (long int j = 0; j < 10; j++) 59;; *B++ = A[j]; 60 61define void @rdiv1(i32* %A, i32* %B) nounwind uwtable ssp { 62entry: 63 br label %for.body 64 65; CHECK: da analyze - none! 66; CHECK: da analyze - none! 67; CHECK: da analyze - confused! 68; CHECK: da analyze - none! 69; CHECK: da analyze - confused! 70; CHECK: da analyze - none! 71 72for.body: ; preds = %entry, %for.body 73 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 74 %conv = trunc i64 %i.03 to i32 75 %mul = mul nsw i64 %i.03, 11 76 %sub = add nsw i64 %mul, -45 77 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub 78 store i32 %conv, i32* %arrayidx, align 4 79 %inc = add nsw i64 %i.03, 1 80 %exitcond4 = icmp ne i64 %inc, 5 81 br i1 %exitcond4, label %for.body, label %for.body4.preheader 82 83for.body4.preheader: ; preds = %for.body 84 br label %for.body4 85 86for.body4: ; preds = %for.body4.preheader, %for.body4 87 %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ] 88 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 89 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %j.02 90 %0 = load i32, i32* %arrayidx5, align 4 91 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 92 store i32 %0, i32* %B.addr.01, align 4 93 %inc7 = add nsw i64 %j.02, 1 94 %exitcond = icmp ne i64 %inc7, 10 95 br i1 %exitcond, label %for.body4, label %for.end8 96 97for.end8: ; preds = %for.body4 98 ret void 99} 100 101 102;; for (long int i = 0; i <= 5; i++) 103;; A[11*i - 45] = i; 104;; for (long int j = 0; j < 10; j++) 105;; *B++ = A[j]; 106 107define void @rdiv2(i32* %A, i32* %B) nounwind uwtable ssp { 108entry: 109 br label %for.body 110 111; CHECK: da analyze - none! 112; CHECK: da analyze - none! 113; CHECK: da analyze - confused! 114; CHECK: da analyze - none! 115; CHECK: da analyze - confused! 116; CHECK: da analyze - none! 117 118for.body: ; preds = %entry, %for.body 119 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 120 %conv = trunc i64 %i.03 to i32 121 %mul = mul nsw i64 %i.03, 11 122 %sub = add nsw i64 %mul, -45 123 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub 124 store i32 %conv, i32* %arrayidx, align 4 125 %inc = add nsw i64 %i.03, 1 126 %exitcond4 = icmp ne i64 %inc, 6 127 br i1 %exitcond4, label %for.body, label %for.body4.preheader 128 129for.body4.preheader: ; preds = %for.body 130 br label %for.body4 131 132for.body4: ; preds = %for.body4.preheader, %for.body4 133 %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ] 134 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 135 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %j.02 136 %0 = load i32, i32* %arrayidx5, align 4 137 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 138 store i32 %0, i32* %B.addr.01, align 4 139 %inc7 = add nsw i64 %j.02, 1 140 %exitcond = icmp ne i64 %inc7, 10 141 br i1 %exitcond, label %for.body4, label %for.end8 142 143for.end8: ; preds = %for.body4 144 ret void 145} 146 147 148;; for (long int i = 0; i < 5; i++) 149;; A[11*i - 45] = i; 150;; for (long int j = 0; j <= 10; j++) 151;; *B++ = A[j]; 152 153define void @rdiv3(i32* %A, i32* %B) nounwind uwtable ssp { 154entry: 155 br label %for.body 156 157; CHECK: da analyze - none! 158; CHECK: da analyze - none! 159; CHECK: da analyze - confused! 160; CHECK: da analyze - none! 161; CHECK: da analyze - confused! 162; CHECK: da analyze - none! 163 164for.body: ; preds = %entry, %for.body 165 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 166 %conv = trunc i64 %i.03 to i32 167 %mul = mul nsw i64 %i.03, 11 168 %sub = add nsw i64 %mul, -45 169 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub 170 store i32 %conv, i32* %arrayidx, align 4 171 %inc = add nsw i64 %i.03, 1 172 %exitcond4 = icmp ne i64 %inc, 5 173 br i1 %exitcond4, label %for.body, label %for.body4.preheader 174 175for.body4.preheader: ; preds = %for.body 176 br label %for.body4 177 178for.body4: ; preds = %for.body4.preheader, %for.body4 179 %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ] 180 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 181 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %j.02 182 %0 = load i32, i32* %arrayidx5, align 4 183 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 184 store i32 %0, i32* %B.addr.01, align 4 185 %inc7 = add nsw i64 %j.02, 1 186 %exitcond = icmp ne i64 %inc7, 11 187 br i1 %exitcond, label %for.body4, label %for.end8 188 189for.end8: ; preds = %for.body4 190 ret void 191} 192 193 194;; for (long int i = 0; i <= 5; i++) 195;; A[11*i - 45] = i; 196;; for (long int j = 0; j <= 10; j++) 197;; *B++ = A[j]; 198 199define void @rdiv4(i32* %A, i32* %B) nounwind uwtable ssp { 200entry: 201 br label %for.body 202 203; CHECK: da analyze - none! 204; CHECK: da analyze - flow [|<]! 205; CHECK: da analyze - confused! 206; CHECK: da analyze - none! 207; CHECK: da analyze - confused! 208; CHECK: da analyze - none! 209 210for.body: ; preds = %entry, %for.body 211 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 212 %conv = trunc i64 %i.03 to i32 213 %mul = mul nsw i64 %i.03, 11 214 %sub = add nsw i64 %mul, -45 215 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub 216 store i32 %conv, i32* %arrayidx, align 4 217 %inc = add nsw i64 %i.03, 1 218 %exitcond4 = icmp ne i64 %inc, 6 219 br i1 %exitcond4, label %for.body, label %for.body4.preheader 220 221for.body4.preheader: ; preds = %for.body 222 br label %for.body4 223 224for.body4: ; preds = %for.body4.preheader, %for.body4 225 %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ] 226 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 227 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %j.02 228 %0 = load i32, i32* %arrayidx5, align 4 229 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 230 store i32 %0, i32* %B.addr.01, align 4 231 %inc7 = add nsw i64 %j.02, 1 232 %exitcond = icmp ne i64 %inc7, 11 233 br i1 %exitcond, label %for.body4, label %for.end8 234 235for.end8: ; preds = %for.body4 236 ret void 237} 238 239 240;; for (long int i = 0; i < 5; i++) 241;; A[-11*i + 45] = i; 242;; for (long int j = 0; j < 10; j++) 243;; *B++ = A[-j]; 244 245define void @rdiv5(i32* %A, i32* %B) nounwind uwtable ssp { 246entry: 247 br label %for.body 248 249; CHECK: da analyze - none! 250; CHECK: da analyze - none! 251; CHECK: da analyze - confused! 252; CHECK: da analyze - none! 253; CHECK: da analyze - confused! 254; CHECK: da analyze - none! 255 256for.body: ; preds = %entry, %for.body 257 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 258 %conv = trunc i64 %i.03 to i32 259 %mul = mul nsw i64 %i.03, -11 260 %add = add nsw i64 %mul, 45 261 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add 262 store i32 %conv, i32* %arrayidx, align 4 263 %inc = add nsw i64 %i.03, 1 264 %exitcond4 = icmp ne i64 %inc, 5 265 br i1 %exitcond4, label %for.body, label %for.body4.preheader 266 267for.body4.preheader: ; preds = %for.body 268 br label %for.body4 269 270for.body4: ; preds = %for.body4.preheader, %for.body4 271 %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ] 272 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 273 %sub = sub nsw i64 0, %j.02 274 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %sub 275 %0 = load i32, i32* %arrayidx5, align 4 276 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 277 store i32 %0, i32* %B.addr.01, align 4 278 %inc7 = add nsw i64 %j.02, 1 279 %exitcond = icmp ne i64 %inc7, 10 280 br i1 %exitcond, label %for.body4, label %for.end8 281 282for.end8: ; preds = %for.body4 283 ret void 284} 285 286 287;; for (long int i = 0; i <= 5; i++) 288;; A[-11*i + 45] = i; 289;; for (long int j = 0; j < 10; j++) 290;; *B++ = A[-j]; 291 292define void @rdiv6(i32* %A, i32* %B) nounwind uwtable ssp { 293entry: 294 br label %for.body 295 296; CHECK: da analyze - none! 297; CHECK: da analyze - none! 298; CHECK: da analyze - confused! 299; CHECK: da analyze - none! 300; CHECK: da analyze - confused! 301; CHECK: da analyze - none! 302 303for.body: ; preds = %entry, %for.body 304 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 305 %conv = trunc i64 %i.03 to i32 306 %mul = mul nsw i64 %i.03, -11 307 %add = add nsw i64 %mul, 45 308 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add 309 store i32 %conv, i32* %arrayidx, align 4 310 %inc = add nsw i64 %i.03, 1 311 %exitcond4 = icmp ne i64 %inc, 6 312 br i1 %exitcond4, label %for.body, label %for.body4.preheader 313 314for.body4.preheader: ; preds = %for.body 315 br label %for.body4 316 317for.body4: ; preds = %for.body4.preheader, %for.body4 318 %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ] 319 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 320 %sub = sub nsw i64 0, %j.02 321 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %sub 322 %0 = load i32, i32* %arrayidx5, align 4 323 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 324 store i32 %0, i32* %B.addr.01, align 4 325 %inc7 = add nsw i64 %j.02, 1 326 %exitcond = icmp ne i64 %inc7, 10 327 br i1 %exitcond, label %for.body4, label %for.end8 328 329for.end8: ; preds = %for.body4 330 ret void 331} 332 333 334;; for (long int i = 0; i < 5; i++) 335;; A[-11*i + 45] = i; 336;; for (long int j = 0; j <= 10; j++) 337;; *B++ = A[-j]; 338 339define void @rdiv7(i32* %A, i32* %B) nounwind uwtable ssp { 340entry: 341 br label %for.body 342 343; CHECK: da analyze - none! 344; CHECK: da analyze - none! 345; CHECK: da analyze - confused! 346; CHECK: da analyze - none! 347; CHECK: da analyze - confused! 348; CHECK: da analyze - none! 349 350for.body: ; preds = %entry, %for.body 351 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 352 %conv = trunc i64 %i.03 to i32 353 %mul = mul nsw i64 %i.03, -11 354 %add = add nsw i64 %mul, 45 355 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add 356 store i32 %conv, i32* %arrayidx, align 4 357 %inc = add nsw i64 %i.03, 1 358 %exitcond4 = icmp ne i64 %inc, 5 359 br i1 %exitcond4, label %for.body, label %for.body4.preheader 360 361for.body4.preheader: ; preds = %for.body 362 br label %for.body4 363 364for.body4: ; preds = %for.body4.preheader, %for.body4 365 %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ] 366 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 367 %sub = sub nsw i64 0, %j.02 368 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %sub 369 %0 = load i32, i32* %arrayidx5, align 4 370 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 371 store i32 %0, i32* %B.addr.01, align 4 372 %inc7 = add nsw i64 %j.02, 1 373 %exitcond = icmp ne i64 %inc7, 11 374 br i1 %exitcond, label %for.body4, label %for.end8 375 376for.end8: ; preds = %for.body4 377 ret void 378} 379 380 381;; for (long int i = 0; i <= 5; i++) 382;; A[-11*i + 45] = i; 383;; for (long int j = 0; j <= 10; j++) 384;; *B++ = A[-j]; 385 386define void @rdiv8(i32* %A, i32* %B) nounwind uwtable ssp { 387entry: 388 br label %for.body 389 390; CHECK: da analyze - none! 391; CHECK: da analyze - flow [|<]! 392; CHECK: da analyze - confused! 393; CHECK: da analyze - none! 394; CHECK: da analyze - confused! 395; CHECK: da analyze - none! 396 397for.body: ; preds = %entry, %for.body 398 %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] 399 %conv = trunc i64 %i.03 to i32 400 %mul = mul nsw i64 %i.03, -11 401 %add = add nsw i64 %mul, 45 402 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %add 403 store i32 %conv, i32* %arrayidx, align 4 404 %inc = add nsw i64 %i.03, 1 405 %exitcond4 = icmp ne i64 %inc, 6 406 br i1 %exitcond4, label %for.body, label %for.body4.preheader 407 408for.body4.preheader: ; preds = %for.body 409 br label %for.body4 410 411for.body4: ; preds = %for.body4.preheader, %for.body4 412 %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body4.preheader ] 413 %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body4.preheader ] 414 %sub = sub nsw i64 0, %j.02 415 %arrayidx5 = getelementptr inbounds i32, i32* %A, i64 %sub 416 %0 = load i32, i32* %arrayidx5, align 4 417 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1 418 store i32 %0, i32* %B.addr.01, align 4 419 %inc7 = add nsw i64 %j.02, 1 420 %exitcond = icmp ne i64 %inc7, 11 421 br i1 %exitcond, label %for.body4, label %for.end8 422 423for.end8: ; preds = %for.body4 424 ret void 425} 426 427 428;; for (long int i = 0; i < 5; i++) 429;; for (long int j = 0; j < 10; j++) { 430;; A[11*i - j] = i; 431;; *B++ = A[45]; 432 433define void @rdiv9(i32* %A, i32* %B) nounwind uwtable ssp { 434entry: 435 br label %for.cond1.preheader 436 437; CHECK: da analyze - none! 438; CHECK: da analyze - none! 439; CHECK: da analyze - confused! 440; CHECK: da analyze - consistent input [S S]! 441; CHECK: da analyze - confused! 442; CHECK: da analyze - none! 443 444for.cond1.preheader: ; preds = %entry, %for.inc5 445 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc5 ] 446 %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ] 447 br label %for.body3 448 449for.body3: ; preds = %for.cond1.preheader, %for.body3 450 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 451 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 452 %conv = trunc i64 %i.03 to i32 453 %mul = mul nsw i64 %i.03, 11 454 %sub = sub nsw i64 %mul, %j.02 455 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub 456 store i32 %conv, i32* %arrayidx, align 4 457 %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 45 458 %0 = load i32, i32* %arrayidx4, align 4 459 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 460 store i32 %0, i32* %B.addr.11, align 4 461 %inc = add nsw i64 %j.02, 1 462 %exitcond = icmp ne i64 %inc, 10 463 br i1 %exitcond, label %for.body3, label %for.inc5 464 465for.inc5: ; preds = %for.body3 466 %scevgep = getelementptr i32, i32* %B.addr.04, i64 10 467 %inc6 = add nsw i64 %i.03, 1 468 %exitcond5 = icmp ne i64 %inc6, 5 469 br i1 %exitcond5, label %for.cond1.preheader, label %for.end7 470 471for.end7: ; preds = %for.inc5 472 ret void 473} 474 475 476 477;; for (long int i = 0; i <= 5; i++) 478;; for (long int j = 0; j < 10; j++) { 479;; A[11*i - j] = i; 480;; *B++ = A[45]; 481 482define void @rdiv10(i32* %A, i32* %B) nounwind uwtable ssp { 483entry: 484 br label %for.cond1.preheader 485 486; CHECK: da analyze - none! 487; CHECK: da analyze - none! 488; CHECK: da analyze - confused! 489; CHECK: da analyze - consistent input [S S]! 490; CHECK: da analyze - confused! 491; CHECK: da analyze - none! 492 493for.cond1.preheader: ; preds = %entry, %for.inc5 494 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc5 ] 495 %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ] 496 br label %for.body3 497 498for.body3: ; preds = %for.cond1.preheader, %for.body3 499 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 500 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 501 %conv = trunc i64 %i.03 to i32 502 %mul = mul nsw i64 %i.03, 11 503 %sub = sub nsw i64 %mul, %j.02 504 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub 505 store i32 %conv, i32* %arrayidx, align 4 506 %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 45 507 %0 = load i32, i32* %arrayidx4, align 4 508 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 509 store i32 %0, i32* %B.addr.11, align 4 510 %inc = add nsw i64 %j.02, 1 511 %exitcond = icmp ne i64 %inc, 10 512 br i1 %exitcond, label %for.body3, label %for.inc5 513 514for.inc5: ; preds = %for.body3 515 %scevgep = getelementptr i32, i32* %B.addr.04, i64 10 516 %inc6 = add nsw i64 %i.03, 1 517 %exitcond5 = icmp ne i64 %inc6, 6 518 br i1 %exitcond5, label %for.cond1.preheader, label %for.end7 519 520for.end7: ; preds = %for.inc5 521 ret void 522} 523 524 525;; for (long int i = 0; i < 5; i++) 526;; for (long int j = 0; j <= 10; j++) { 527;; A[11*i - j] = i; 528;; *B++ = A[45]; 529 530define void @rdiv11(i32* %A, i32* %B) nounwind uwtable ssp { 531entry: 532 br label %for.cond1.preheader 533 534; CHECK: da analyze - none! 535; CHECK: da analyze - none! 536; CHECK: da analyze - confused! 537; CHECK: da analyze - consistent input [S S]! 538; CHECK: da analyze - confused! 539; CHECK: da analyze - none! 540 541for.cond1.preheader: ; preds = %entry, %for.inc5 542 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc5 ] 543 %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ] 544 br label %for.body3 545 546for.body3: ; preds = %for.cond1.preheader, %for.body3 547 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 548 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 549 %conv = trunc i64 %i.03 to i32 550 %mul = mul nsw i64 %i.03, 11 551 %sub = sub nsw i64 %mul, %j.02 552 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub 553 store i32 %conv, i32* %arrayidx, align 4 554 %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 45 555 %0 = load i32, i32* %arrayidx4, align 4 556 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 557 store i32 %0, i32* %B.addr.11, align 4 558 %inc = add nsw i64 %j.02, 1 559 %exitcond = icmp ne i64 %inc, 11 560 br i1 %exitcond, label %for.body3, label %for.inc5 561 562for.inc5: ; preds = %for.body3 563 %scevgep = getelementptr i32, i32* %B.addr.04, i64 11 564 %inc6 = add nsw i64 %i.03, 1 565 %exitcond5 = icmp ne i64 %inc6, 5 566 br i1 %exitcond5, label %for.cond1.preheader, label %for.end7 567 568for.end7: ; preds = %for.inc5 569 ret void 570} 571 572 573;; for (long int i = 0; i <= 5; i++) 574;; for (long int j = 0; j <= 10; j++) { 575;; A[11*i - j] = i; 576;; *B++ = A[45]; 577 578define void @rdiv12(i32* %A, i32* %B) nounwind uwtable ssp { 579entry: 580 br label %for.cond1.preheader 581 582; CHECK: da analyze - none! 583; CHECK: da analyze - flow [* *|<]! 584; CHECK: da analyze - confused! 585; CHECK: da analyze - consistent input [S S]! 586; CHECK: da analyze - confused! 587; CHECK: da analyze - none! 588 589for.cond1.preheader: ; preds = %entry, %for.inc5 590 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc5 ] 591 %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ] 592 br label %for.body3 593 594for.body3: ; preds = %for.cond1.preheader, %for.body3 595 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 596 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 597 %conv = trunc i64 %i.03 to i32 598 %mul = mul nsw i64 %i.03, 11 599 %sub = sub nsw i64 %mul, %j.02 600 %arrayidx = getelementptr inbounds i32, i32* %A, i64 %sub 601 store i32 %conv, i32* %arrayidx, align 4 602 %arrayidx4 = getelementptr inbounds i32, i32* %A, i64 45 603 %0 = load i32, i32* %arrayidx4, align 4 604 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 605 store i32 %0, i32* %B.addr.11, align 4 606 %inc = add nsw i64 %j.02, 1 607 %exitcond = icmp ne i64 %inc, 11 608 br i1 %exitcond, label %for.body3, label %for.inc5 609 610for.inc5: ; preds = %for.body3 611 %scevgep = getelementptr i32, i32* %B.addr.04, i64 11 612 %inc6 = add nsw i64 %i.03, 1 613 %exitcond5 = icmp ne i64 %inc6, 6 614 br i1 %exitcond5, label %for.cond1.preheader, label %for.end7 615 616for.end7: ; preds = %for.inc5 617 ret void 618} 619