1; RUN: opt < %s -analyze -basicaa -da | FileCheck %s 2 3; ModuleID = 'Propagating.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 < 100; i++) 9;; for (long int j = 0; j < 100; j++) { 10;; A[i + 1][i + j] = i; 11;; *B++ = A[i][i + j]; 12 13define void @prop0([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 14entry: 15 br label %for.cond1.preheader 16 17; CHECK: da analyze - none! 18; CHECK: da analyze - consistent flow [1 -1]! 19; CHECK: da analyze - confused! 20; CHECK: da analyze - none! 21; CHECK: da analyze - confused! 22; CHECK: da analyze - none! 23 24for.cond1.preheader: ; preds = %entry, %for.inc9 25 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc9 ] 26 %i.03 = phi i64 [ 0, %entry ], [ %inc10, %for.inc9 ] 27 br label %for.body3 28 29for.body3: ; preds = %for.cond1.preheader, %for.body3 30 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 31 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 32 %conv = trunc i64 %i.03 to i32 33 %add = add nsw i64 %i.03, %j.02 34 %add4 = add nsw i64 %i.03, 1 35 %arrayidx5 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add4, i64 %add 36 store i32 %conv, i32* %arrayidx5, align 4 37 %add6 = add nsw i64 %i.03, %j.02 38 %arrayidx8 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.03, i64 %add6 39 %0 = load i32, i32* %arrayidx8, align 4 40 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 41 store i32 %0, i32* %B.addr.11, align 4 42 %inc = add nsw i64 %j.02, 1 43 %exitcond = icmp ne i64 %inc, 100 44 br i1 %exitcond, label %for.body3, label %for.inc9 45 46for.inc9: ; preds = %for.body3 47 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 48 %inc10 = add nsw i64 %i.03, 1 49 %exitcond5 = icmp ne i64 %inc10, 100 50 br i1 %exitcond5, label %for.cond1.preheader, label %for.end11 51 52for.end11: ; preds = %for.inc9 53 ret void 54} 55 56 57;; for (long int i = 0; i < 100; i++) 58;; for (long int j = 0; j < 100; j++) 59;; for (long int k = 0; k < 100; k++) { 60;; A[j - i][i + 1][j + k] = i; 61;; *B++ = A[j - i][i][j + k]; 62 63define void @prop1([100 x [100 x i32]]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 64entry: 65 br label %for.cond1.preheader 66 67; CHECK: da analyze - none! 68; CHECK: da analyze - consistent flow [1 1 -1]! 69; CHECK: da analyze - confused! 70; CHECK: da analyze - none! 71; CHECK: da analyze - confused! 72; CHECK: da analyze - none! 73 74for.cond1.preheader: ; preds = %entry, %for.inc18 75 %B.addr.06 = phi i32* [ %B, %entry ], [ %scevgep7, %for.inc18 ] 76 %i.05 = phi i64 [ 0, %entry ], [ %inc19, %for.inc18 ] 77 br label %for.cond4.preheader 78 79for.cond4.preheader: ; preds = %for.cond1.preheader, %for.inc15 80 %B.addr.14 = phi i32* [ %B.addr.06, %for.cond1.preheader ], [ %scevgep, %for.inc15 ] 81 %j.03 = phi i64 [ 0, %for.cond1.preheader ], [ %inc16, %for.inc15 ] 82 br label %for.body6 83 84for.body6: ; preds = %for.cond4.preheader, %for.body6 85 %k.02 = phi i64 [ 0, %for.cond4.preheader ], [ %inc, %for.body6 ] 86 %B.addr.21 = phi i32* [ %B.addr.14, %for.cond4.preheader ], [ %incdec.ptr, %for.body6 ] 87 %conv = trunc i64 %i.05 to i32 88 %add = add nsw i64 %j.03, %k.02 89 %add7 = add nsw i64 %i.05, 1 90 %sub = sub nsw i64 %j.03, %i.05 91 %arrayidx9 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %A, i64 %sub, i64 %add7, i64 %add 92 store i32 %conv, i32* %arrayidx9, align 4 93 %add10 = add nsw i64 %j.03, %k.02 94 %sub11 = sub nsw i64 %j.03, %i.05 95 %arrayidx14 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %A, i64 %sub11, i64 %i.05, i64 %add10 96 %0 = load i32, i32* %arrayidx14, align 4 97 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.21, i64 1 98 store i32 %0, i32* %B.addr.21, align 4 99 %inc = add nsw i64 %k.02, 1 100 %exitcond = icmp ne i64 %inc, 100 101 br i1 %exitcond, label %for.body6, label %for.inc15 102 103for.inc15: ; preds = %for.body6 104 %scevgep = getelementptr i32, i32* %B.addr.14, i64 100 105 %inc16 = add nsw i64 %j.03, 1 106 %exitcond8 = icmp ne i64 %inc16, 100 107 br i1 %exitcond8, label %for.cond4.preheader, label %for.inc18 108 109for.inc18: ; preds = %for.inc15 110 %scevgep7 = getelementptr i32, i32* %B.addr.06, i64 10000 111 %inc19 = add nsw i64 %i.05, 1 112 %exitcond9 = icmp ne i64 %inc19, 100 113 br i1 %exitcond9, label %for.cond1.preheader, label %for.end20 114 115for.end20: ; preds = %for.inc18 116 ret void 117} 118 119 120;; for (long int i = 0; i < 100; i++) 121;; for (long int j = 0; j < 100; j++) { 122;; A[i - 1][2*i] = i; 123;; *B++ = A[i][i + j + 110]; 124 125define void @prop2([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 126entry: 127 br label %for.cond1.preheader 128 129; CHECK: da analyze - consistent output [0 S]! 130; CHECK: da analyze - none! 131; CHECK: da analyze - confused! 132; CHECK: da analyze - none! 133; CHECK: da analyze - confused! 134; CHECK: da analyze - none! 135 136for.cond1.preheader: ; preds = %entry, %for.inc8 137 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc8 ] 138 %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ] 139 br label %for.body3 140 141for.body3: ; preds = %for.cond1.preheader, %for.body3 142 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 143 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 144 %conv = trunc i64 %i.03 to i32 145 %mul = shl nsw i64 %i.03, 1 146 %sub = add nsw i64 %i.03, -1 147 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %sub, i64 %mul 148 store i32 %conv, i32* %arrayidx4, align 4 149 %add = add nsw i64 %i.03, %j.02 150 %add5 = add nsw i64 %add, 110 151 %arrayidx7 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.03, i64 %add5 152 %0 = load i32, i32* %arrayidx7, align 4 153 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 154 store i32 %0, i32* %B.addr.11, align 4 155 %inc = add nsw i64 %j.02, 1 156 %exitcond = icmp ne i64 %inc, 100 157 br i1 %exitcond, label %for.body3, label %for.inc8 158 159for.inc8: ; preds = %for.body3 160 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 161 %inc9 = add nsw i64 %i.03, 1 162 %exitcond5 = icmp ne i64 %inc9, 100 163 br i1 %exitcond5, label %for.cond1.preheader, label %for.end10 164 165for.end10: ; preds = %for.inc8 166 ret void 167} 168 169 170;; for (long int i = 0; i < 100; i++) 171;; for (long int j = 0; j < 100; j++) { 172;; A[i][2*j + i] = i; 173;; *B++ = A[i][2*j - i + 5]; 174 175define void @prop3([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 176entry: 177 br label %for.cond1.preheader 178 179; CHECK: da analyze - none! 180; CHECK: da analyze - none! 181; CHECK: da analyze - confused! 182; CHECK: da analyze - none! 183; CHECK: da analyze - confused! 184; CHECK: da analyze - none! 185 186for.cond1.preheader: ; preds = %entry, %for.inc9 187 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc9 ] 188 %i.03 = phi i64 [ 0, %entry ], [ %inc10, %for.inc9 ] 189 br label %for.body3 190 191for.body3: ; preds = %for.cond1.preheader, %for.body3 192 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 193 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 194 %conv = trunc i64 %i.03 to i32 195 %mul = shl nsw i64 %j.02, 1 196 %add = add nsw i64 %mul, %i.03 197 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.03, i64 %add 198 store i32 %conv, i32* %arrayidx4, align 4 199 %mul5 = shl nsw i64 %j.02, 1 200 %sub = sub nsw i64 %mul5, %i.03 201 %add6 = add nsw i64 %sub, 5 202 %arrayidx8 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.03, i64 %add6 203 %0 = load i32, i32* %arrayidx8, align 4 204 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 205 store i32 %0, i32* %B.addr.11, align 4 206 %inc = add nsw i64 %j.02, 1 207 %exitcond = icmp ne i64 %inc, 100 208 br i1 %exitcond, label %for.body3, label %for.inc9 209 210for.inc9: ; preds = %for.body3 211 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 212 %inc10 = add nsw i64 %i.03, 1 213 %exitcond5 = icmp ne i64 %inc10, 100 214 br i1 %exitcond5, label %for.cond1.preheader, label %for.end11 215 216for.end11: ; preds = %for.inc9 217 ret void 218} 219 220 221;; for (long int i = 0; i < 100; i++) 222;; for (long int j = 0; j < 100; j++) { 223;; A[i + 2][2*i + j + 1] = i; 224;; *B++ = A[i][2*i + j]; 225 226define void @prop4([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 227entry: 228 br label %for.cond1.preheader 229 230; CHECK: da analyze - none! 231; CHECK: da analyze - consistent flow [2 -3]! 232; CHECK: da analyze - confused! 233; CHECK: da analyze - none! 234; CHECK: da analyze - confused! 235; CHECK: da analyze - none! 236 237for.cond1.preheader: ; preds = %entry, %for.inc11 238 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc11 ] 239 %i.03 = phi i64 [ 0, %entry ], [ %inc12, %for.inc11 ] 240 br label %for.body3 241 242for.body3: ; preds = %for.cond1.preheader, %for.body3 243 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 244 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 245 %conv = trunc i64 %i.03 to i32 246 %mul = shl nsw i64 %i.03, 1 247 %add = add nsw i64 %mul, %j.02 248 %add4 = add nsw i64 %add, 1 249 %add5 = add nsw i64 %i.03, 2 250 %arrayidx6 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add5, i64 %add4 251 store i32 %conv, i32* %arrayidx6, align 4 252 %mul7 = shl nsw i64 %i.03, 1 253 %add8 = add nsw i64 %mul7, %j.02 254 %arrayidx10 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %i.03, i64 %add8 255 %0 = load i32, i32* %arrayidx10, align 4 256 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 257 store i32 %0, i32* %B.addr.11, align 4 258 %inc = add nsw i64 %j.02, 1 259 %exitcond = icmp ne i64 %inc, 100 260 br i1 %exitcond, label %for.body3, label %for.inc11 261 262for.inc11: ; preds = %for.body3 263 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 264 %inc12 = add nsw i64 %i.03, 1 265 %exitcond5 = icmp ne i64 %inc12, 100 266 br i1 %exitcond5, label %for.cond1.preheader, label %for.end13 267 268for.end13: ; preds = %for.inc11 269 ret void 270} 271 272 273;; for (long int i = 0; i < 100; i++) 274;; for (long int j = 0; j < 100; j++) { 275;; A[3*i - 18][22 - i][2*i + j] = i; 276;; *B++ = A[i][i][3*i + j]; 277 278define void @prop5([100 x [100 x i32]]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 279entry: 280 br label %for.cond1.preheader 281 282; CHECK: da analyze - none! 283; CHECK: da analyze - flow [< -16] splitable! 284; CHECK: da analyze - split level = 1, iteration = 11! 285; CHECK: da analyze - confused! 286; CHECK: da analyze - none! 287; CHECK: da analyze - confused! 288; CHECK: da analyze - none! 289 290for.cond1.preheader: ; preds = %entry, %for.inc13 291 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc13 ] 292 %i.03 = phi i64 [ 0, %entry ], [ %inc14, %for.inc13 ] 293 br label %for.body3 294 295for.body3: ; preds = %for.cond1.preheader, %for.body3 296 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 297 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 298 %conv = trunc i64 %i.03 to i32 299 %mul = shl nsw i64 %i.03, 1 300 %add = add nsw i64 %mul, %j.02 301 %sub = sub nsw i64 22, %i.03 302 %mul4 = mul nsw i64 %i.03, 3 303 %sub5 = add nsw i64 %mul4, -18 304 %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %A, i64 %sub5, i64 %sub, i64 %add 305 store i32 %conv, i32* %arrayidx7, align 4 306 %mul8 = mul nsw i64 %i.03, 3 307 %add9 = add nsw i64 %mul8, %j.02 308 %arrayidx12 = getelementptr inbounds [100 x [100 x i32]], [100 x [100 x i32]]* %A, i64 %i.03, i64 %i.03, i64 %add9 309 %0 = load i32, i32* %arrayidx12, align 4 310 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 311 store i32 %0, i32* %B.addr.11, align 4 312 %inc = add nsw i64 %j.02, 1 313 %exitcond = icmp ne i64 %inc, 100 314 br i1 %exitcond, label %for.body3, label %for.inc13 315 316for.inc13: ; preds = %for.body3 317 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 318 %inc14 = add nsw i64 %i.03, 1 319 %exitcond5 = icmp ne i64 %inc14, 100 320 br i1 %exitcond5, label %for.cond1.preheader, label %for.end15 321 322for.end15: ; preds = %for.inc13 323 ret void 324} 325 326 327;; for (long int i = 0; i < 100; i++) 328;; for (long int j = 0; j < 100; j++) { 329;; A[i + 1][4*i + j + 2] = i; 330;; *B++ = A[2*i][8*i + j]; 331 332define void @prop6([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 333entry: 334 br label %for.cond1.preheader 335 336; CHECK: da analyze - none! 337; CHECK: da analyze - flow [=> -2]! 338; CHECK: da analyze - confused! 339; CHECK: da analyze - none! 340; CHECK: da analyze - confused! 341; CHECK: da analyze - none! 342 343for.cond1.preheader: ; preds = %entry, %for.inc12 344 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc12 ] 345 %i.03 = phi i64 [ 0, %entry ], [ %inc13, %for.inc12 ] 346 br label %for.body3 347 348for.body3: ; preds = %for.cond1.preheader, %for.body3 349 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 350 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 351 %conv = trunc i64 %i.03 to i32 352 %mul = shl nsw i64 %i.03, 2 353 %add = add nsw i64 %mul, %j.02 354 %add4 = add nsw i64 %add, 2 355 %add5 = add nsw i64 %i.03, 1 356 %arrayidx6 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add5, i64 %add4 357 store i32 %conv, i32* %arrayidx6, align 4 358 %mul7 = shl nsw i64 %i.03, 3 359 %add8 = add nsw i64 %mul7, %j.02 360 %mul9 = shl nsw i64 %i.03, 1 361 %arrayidx11 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %mul9, i64 %add8 362 %0 = load i32, i32* %arrayidx11, align 4 363 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 364 store i32 %0, i32* %B.addr.11, align 4 365 %inc = add nsw i64 %j.02, 1 366 %exitcond = icmp ne i64 %inc, 100 367 br i1 %exitcond, label %for.body3, label %for.inc12 368 369for.inc12: ; preds = %for.body3 370 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 371 %inc13 = add nsw i64 %i.03, 1 372 %exitcond5 = icmp ne i64 %inc13, 100 373 br i1 %exitcond5, label %for.cond1.preheader, label %for.end14 374 375for.end14: ; preds = %for.inc12 376 ret void 377} 378 379 380;; for (long int i = 0; i < 100; i++) 381;; for (long int j = 0; j < 100; j++) { 382;; A[2*i + 4][-5*i + j + 2] = i; 383;; *B++ = A[-2*i + 20][5*i + j]; 384 385define void @prop7([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 386entry: 387 br label %for.cond1.preheader 388 389; CHECK: da analyze - none! 390; CHECK: da analyze - flow [* -38] splitable! 391; CHECK: da analyze - split level = 1, iteration = 4! 392; CHECK: da analyze - confused! 393; CHECK: da analyze - none! 394; CHECK: da analyze - confused! 395; CHECK: da analyze - none! 396 397for.cond1.preheader: ; preds = %entry, %for.inc14 398 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc14 ] 399 %i.03 = phi i64 [ 0, %entry ], [ %inc15, %for.inc14 ] 400 br label %for.body3 401 402for.body3: ; preds = %for.cond1.preheader, %for.body3 403 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 404 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 405 %conv = trunc i64 %i.03 to i32 406 %mul = mul nsw i64 %i.03, -5 407 %add = add nsw i64 %mul, %j.02 408 %add4 = add nsw i64 %add, 2 409 %mul5 = shl nsw i64 %i.03, 1 410 %add6 = add nsw i64 %mul5, 4 411 %arrayidx7 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add6, i64 %add4 412 store i32 %conv, i32* %arrayidx7, align 4 413 %mul8 = mul nsw i64 %i.03, 5 414 %add9 = add nsw i64 %mul8, %j.02 415 %mul10 = mul nsw i64 %i.03, -2 416 %add11 = add nsw i64 %mul10, 20 417 %arrayidx13 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add11, i64 %add9 418 %0 = load i32, i32* %arrayidx13, align 4 419 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 420 store i32 %0, i32* %B.addr.11, align 4 421 %inc = add nsw i64 %j.02, 1 422 %exitcond = icmp ne i64 %inc, 100 423 br i1 %exitcond, label %for.body3, label %for.inc14 424 425for.inc14: ; preds = %for.body3 426 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 427 %inc15 = add nsw i64 %i.03, 1 428 %exitcond5 = icmp ne i64 %inc15, 100 429 br i1 %exitcond5, label %for.cond1.preheader, label %for.end16 430 431for.end16: ; preds = %for.inc14 432 ret void 433} 434 435 436;; for (long int i = 0; i < 100; i++) 437;; for (long int j = 0; j < 100; j++) { 438;; A[4][j + 2] = i; 439;; *B++ = A[-2*i + 4][5*i + j]; 440 441define void @prop8([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 442entry: 443 br label %for.cond1.preheader 444 445; CHECK: da analyze - consistent output [S 0]! 446; CHECK: da analyze - flow [p<= 2]! 447; CHECK: da analyze - confused! 448; CHECK: da analyze - none! 449; CHECK: da analyze - confused! 450; CHECK: da analyze - none! 451 452for.cond1.preheader: ; preds = %entry, %for.inc10 453 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc10 ] 454 %i.03 = phi i64 [ 0, %entry ], [ %inc11, %for.inc10 ] 455 br label %for.body3 456 457for.body3: ; preds = %for.cond1.preheader, %for.body3 458 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 459 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 460 %conv = trunc i64 %i.03 to i32 461 %add = add nsw i64 %j.02, 2 462 %arrayidx4 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 4, i64 %add 463 store i32 %conv, i32* %arrayidx4, align 4 464 %mul = mul nsw i64 %i.03, 5 465 %add5 = add nsw i64 %mul, %j.02 466 %mul6 = mul nsw i64 %i.03, -2 467 %add7 = add nsw i64 %mul6, 4 468 %arrayidx9 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add7, i64 %add5 469 %0 = load i32, i32* %arrayidx9, align 4 470 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 471 store i32 %0, i32* %B.addr.11, align 4 472 %inc = add nsw i64 %j.02, 1 473 %exitcond = icmp ne i64 %inc, 100 474 br i1 %exitcond, label %for.body3, label %for.inc10 475 476for.inc10: ; preds = %for.body3 477 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 478 %inc11 = add nsw i64 %i.03, 1 479 %exitcond5 = icmp ne i64 %inc11, 100 480 br i1 %exitcond5, label %for.cond1.preheader, label %for.end12 481 482for.end12: ; preds = %for.inc10 483 ret void 484} 485 486 487;; for (long int i = 0; i < 100; i++) 488;; for (long int j = 0; j < 100; j++) { 489;; A[2*i + 4][5*i + j + 2] = i; 490;; *B++ = A[4][j]; 491 492define void @prop9([100 x i32]* %A, i32* %B, i32 %n) nounwind uwtable ssp { 493entry: 494 br label %for.cond1.preheader 495 496; CHECK: da analyze - none! 497; CHECK: da analyze - flow [p<= 2]! 498; CHECK: da analyze - confused! 499; CHECK: da analyze - consistent input [S 0]! 500; CHECK: da analyze - confused! 501; CHECK: da analyze - none! 502 503for.cond1.preheader: ; preds = %entry, %for.inc10 504 %B.addr.04 = phi i32* [ %B, %entry ], [ %scevgep, %for.inc10 ] 505 %i.03 = phi i64 [ 0, %entry ], [ %inc11, %for.inc10 ] 506 br label %for.body3 507 508for.body3: ; preds = %for.cond1.preheader, %for.body3 509 %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] 510 %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] 511 %conv = trunc i64 %i.03 to i32 512 %mul = mul nsw i64 %i.03, 5 513 %add = add nsw i64 %mul, %j.02 514 %add4 = add nsw i64 %add, 2 515 %mul5 = shl nsw i64 %i.03, 1 516 %add6 = add nsw i64 %mul5, 4 517 %arrayidx7 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 %add6, i64 %add4 518 store i32 %conv, i32* %arrayidx7, align 4 519 %arrayidx9 = getelementptr inbounds [100 x i32], [100 x i32]* %A, i64 4, i64 %j.02 520 %0 = load i32, i32* %arrayidx9, align 4 521 %incdec.ptr = getelementptr inbounds i32, i32* %B.addr.11, i64 1 522 store i32 %0, i32* %B.addr.11, align 4 523 %inc = add nsw i64 %j.02, 1 524 %exitcond = icmp ne i64 %inc, 100 525 br i1 %exitcond, label %for.body3, label %for.inc10 526 527for.inc10: ; preds = %for.body3 528 %scevgep = getelementptr i32, i32* %B.addr.04, i64 100 529 %inc11 = add nsw i64 %i.03, 1 530 %exitcond5 = icmp ne i64 %inc11, 100 531 br i1 %exitcond5, label %for.cond1.preheader, label %for.end12 532 533for.end12: ; preds = %for.inc10 534 ret void 535} 536