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