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