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