Sebastian Pop | 59b61b9 | 2012-10-11 07:32:34 +0000 | [diff] [blame^] | 1 | ; RUN: opt < %s -analyze -basicaa -da | FileCheck %s |
| 2 | |
| 3 | ; ModuleID = 'ExactRDIV.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 = 0; i < 10; i++) |
| 9 | ;; A[4*i + 10] = ... |
| 10 | ;; for (long int j = 0; j < 10; j++) |
| 11 | ;; ... = A[2*j + 1]; |
| 12 | |
| 13 | define void @rdiv0(i32* %A, i32* %B) nounwind uwtable ssp { |
| 14 | entry: |
| 15 | br label %for.body |
| 16 | |
| 17 | for.body: ; preds = %for.body, %entry |
| 18 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 19 | %conv = trunc i64 %i.03 to i32 |
| 20 | %mul = shl nsw i64 %i.03, 2 |
| 21 | %add = add nsw i64 %mul, 10 |
| 22 | %arrayidx = getelementptr inbounds i32* %A, i64 %add |
| 23 | store i32 %conv, i32* %arrayidx, align 4 |
| 24 | %inc = add nsw i64 %i.03, 1 |
| 25 | %cmp = icmp slt i64 %inc, 10 |
| 26 | br i1 %cmp, label %for.body, label %for.body4 |
| 27 | |
| 28 | for.body4: ; preds = %for.body4, %for.body |
| 29 | %j.02 = phi i64 [ %inc9, %for.body4 ], [ 0, %for.body ] |
| 30 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 31 | %mul5 = shl nsw i64 %j.02, 1 |
| 32 | %add64 = or i64 %mul5, 1 |
| 33 | %arrayidx7 = getelementptr inbounds i32* %A, i64 %add64 |
| 34 | %0 = load i32* %arrayidx7, align 4 |
| 35 | ; CHECK: da analyze - none! |
| 36 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 37 | store i32 %0, i32* %B.addr.01, align 4 |
| 38 | %inc9 = add nsw i64 %j.02, 1 |
| 39 | %cmp2 = icmp slt i64 %inc9, 10 |
| 40 | br i1 %cmp2, label %for.body4, label %for.end10 |
| 41 | |
| 42 | for.end10: ; preds = %for.body4 |
| 43 | ret void |
| 44 | } |
| 45 | |
| 46 | |
| 47 | ;; for (long int i = 0; i < 5; i++) |
| 48 | ;; A[11*i - 45] = ... |
| 49 | ;; for (long int j = 0; j < 10; j++) |
| 50 | ;; ... = A[j]; |
| 51 | |
| 52 | define void @rdiv1(i32* %A, i32* %B) nounwind uwtable ssp { |
| 53 | entry: |
| 54 | br label %for.body |
| 55 | |
| 56 | for.body: ; preds = %for.body, %entry |
| 57 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 58 | %conv = trunc i64 %i.03 to i32 |
| 59 | %mul = mul nsw i64 %i.03, 11 |
| 60 | %sub = add nsw i64 %mul, -45 |
| 61 | %arrayidx = getelementptr inbounds i32* %A, i64 %sub |
| 62 | store i32 %conv, i32* %arrayidx, align 4 |
| 63 | %inc = add nsw i64 %i.03, 1 |
| 64 | %cmp = icmp slt i64 %inc, 5 |
| 65 | br i1 %cmp, label %for.body, label %for.body4 |
| 66 | |
| 67 | for.body4: ; preds = %for.body4, %for.body |
| 68 | %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body ] |
| 69 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 70 | %arrayidx5 = getelementptr inbounds i32* %A, i64 %j.02 |
| 71 | %0 = load i32* %arrayidx5, align 4 |
| 72 | ; CHECK: da analyze - none! |
| 73 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 74 | store i32 %0, i32* %B.addr.01, align 4 |
| 75 | %inc7 = add nsw i64 %j.02, 1 |
| 76 | %cmp2 = icmp slt i64 %inc7, 10 |
| 77 | br i1 %cmp2, label %for.body4, label %for.end8 |
| 78 | |
| 79 | for.end8: ; preds = %for.body4 |
| 80 | ret void |
| 81 | } |
| 82 | |
| 83 | |
| 84 | ;; for (long int i = 0; i <= 5; i++) |
| 85 | ;; A[11*i - 45] = ... |
| 86 | ;; for (long int j = 0; j < 10; j++) |
| 87 | ;; ... = A[j]; |
| 88 | |
| 89 | define void @rdiv2(i32* %A, i32* %B) nounwind uwtable ssp { |
| 90 | entry: |
| 91 | br label %for.body |
| 92 | |
| 93 | for.body: ; preds = %for.body, %entry |
| 94 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 95 | %conv = trunc i64 %i.03 to i32 |
| 96 | %mul = mul nsw i64 %i.03, 11 |
| 97 | %sub = add nsw i64 %mul, -45 |
| 98 | %arrayidx = getelementptr inbounds i32* %A, i64 %sub |
| 99 | store i32 %conv, i32* %arrayidx, align 4 |
| 100 | %inc = add nsw i64 %i.03, 1 |
| 101 | %cmp = icmp slt i64 %inc, 6 |
| 102 | br i1 %cmp, label %for.body, label %for.body4 |
| 103 | |
| 104 | for.body4: ; preds = %for.body4, %for.body |
| 105 | %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body ] |
| 106 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 107 | %arrayidx5 = getelementptr inbounds i32* %A, i64 %j.02 |
| 108 | %0 = load i32* %arrayidx5, align 4 |
| 109 | ; CHECK: da analyze - none! |
| 110 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 111 | store i32 %0, i32* %B.addr.01, align 4 |
| 112 | %inc7 = add nsw i64 %j.02, 1 |
| 113 | %cmp2 = icmp slt i64 %inc7, 10 |
| 114 | br i1 %cmp2, label %for.body4, label %for.end8 |
| 115 | |
| 116 | for.end8: ; preds = %for.body4 |
| 117 | ret void |
| 118 | } |
| 119 | |
| 120 | |
| 121 | ;; for (long int i = 0; i < 5; i++) |
| 122 | ;; A[11*i - 45] = ... |
| 123 | ;; for (long int j = 0; j <= 10; j++) |
| 124 | ;; ... = A[j]; |
| 125 | |
| 126 | define void @rdiv3(i32* %A, i32* %B) nounwind uwtable ssp { |
| 127 | entry: |
| 128 | br label %for.body |
| 129 | |
| 130 | for.body: ; preds = %for.body, %entry |
| 131 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 132 | %conv = trunc i64 %i.03 to i32 |
| 133 | %mul = mul nsw i64 %i.03, 11 |
| 134 | %sub = add nsw i64 %mul, -45 |
| 135 | %arrayidx = getelementptr inbounds i32* %A, i64 %sub |
| 136 | store i32 %conv, i32* %arrayidx, align 4 |
| 137 | %inc = add nsw i64 %i.03, 1 |
| 138 | %cmp = icmp slt i64 %inc, 5 |
| 139 | br i1 %cmp, label %for.body, label %for.body4 |
| 140 | |
| 141 | for.body4: ; preds = %for.body4, %for.body |
| 142 | %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body ] |
| 143 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 144 | %arrayidx5 = getelementptr inbounds i32* %A, i64 %j.02 |
| 145 | %0 = load i32* %arrayidx5, align 4 |
| 146 | ; CHECK: da analyze - none! |
| 147 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 148 | store i32 %0, i32* %B.addr.01, align 4 |
| 149 | %inc7 = add nsw i64 %j.02, 1 |
| 150 | %cmp2 = icmp slt i64 %inc7, 11 |
| 151 | br i1 %cmp2, label %for.body4, label %for.end8 |
| 152 | |
| 153 | for.end8: ; preds = %for.body4 |
| 154 | ret void |
| 155 | } |
| 156 | |
| 157 | |
| 158 | ;; for (long int i = 0; i <= 5; i++) |
| 159 | ;; A[11*i - 45] = ... |
| 160 | ;; for (long int j = 0; j <= 10; j++) |
| 161 | ;; ... = A[j]; |
| 162 | |
| 163 | define void @rdiv4(i32* %A, i32* %B) nounwind uwtable ssp { |
| 164 | entry: |
| 165 | br label %for.body |
| 166 | |
| 167 | for.body: ; preds = %for.body, %entry |
| 168 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 169 | %conv = trunc i64 %i.03 to i32 |
| 170 | %mul = mul nsw i64 %i.03, 11 |
| 171 | %sub = add nsw i64 %mul, -45 |
| 172 | %arrayidx = getelementptr inbounds i32* %A, i64 %sub |
| 173 | store i32 %conv, i32* %arrayidx, align 4 |
| 174 | %inc = add nsw i64 %i.03, 1 |
| 175 | %cmp = icmp slt i64 %inc, 6 |
| 176 | br i1 %cmp, label %for.body, label %for.body4 |
| 177 | |
| 178 | for.body4: ; preds = %for.body4, %for.body |
| 179 | %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body ] |
| 180 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 181 | %arrayidx5 = getelementptr inbounds i32* %A, i64 %j.02 |
| 182 | %0 = load i32* %arrayidx5, align 4 |
| 183 | ; CHECK: da analyze - flow! |
| 184 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 185 | store i32 %0, i32* %B.addr.01, align 4 |
| 186 | %inc7 = add nsw i64 %j.02, 1 |
| 187 | %cmp2 = icmp slt i64 %inc7, 11 |
| 188 | br i1 %cmp2, label %for.body4, label %for.end8 |
| 189 | |
| 190 | for.end8: ; preds = %for.body4 |
| 191 | ret void |
| 192 | } |
| 193 | |
| 194 | |
| 195 | ;; for (long int i = 0; i < 5; i++) |
| 196 | ;; A[-11*i + 45] = ... |
| 197 | ;; for (long int j = 0; j < 10; j++) |
| 198 | ;; ... = A[-j]; |
| 199 | |
| 200 | define void @rdiv5(i32* %A, i32* %B) nounwind uwtable ssp { |
| 201 | entry: |
| 202 | br label %for.body |
| 203 | |
| 204 | for.body: ; preds = %for.body, %entry |
| 205 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 206 | %conv = trunc i64 %i.03 to i32 |
| 207 | %mul = mul nsw i64 %i.03, -11 |
| 208 | %add = add nsw i64 %mul, 45 |
| 209 | %arrayidx = getelementptr inbounds i32* %A, i64 %add |
| 210 | store i32 %conv, i32* %arrayidx, align 4 |
| 211 | %inc = add nsw i64 %i.03, 1 |
| 212 | %cmp = icmp slt i64 %inc, 5 |
| 213 | br i1 %cmp, label %for.body, label %for.body4 |
| 214 | |
| 215 | for.body4: ; preds = %for.body4, %for.body |
| 216 | %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body ] |
| 217 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 218 | %sub = sub nsw i64 0, %j.02 |
| 219 | %arrayidx5 = getelementptr inbounds i32* %A, i64 %sub |
| 220 | %0 = load i32* %arrayidx5, align 4 |
| 221 | ; CHECK: da analyze - none! |
| 222 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 223 | store i32 %0, i32* %B.addr.01, align 4 |
| 224 | %inc7 = add nsw i64 %j.02, 1 |
| 225 | %cmp2 = icmp slt i64 %inc7, 10 |
| 226 | br i1 %cmp2, label %for.body4, label %for.end8 |
| 227 | |
| 228 | for.end8: ; preds = %for.body4 |
| 229 | ret void |
| 230 | } |
| 231 | |
| 232 | |
| 233 | ;; for (long int i = 0; i <= 5; i++) |
| 234 | ;; A[-11*i + 45] = ... |
| 235 | ;; for (long int j = 0; j < 10; j++) |
| 236 | ;; ... = A[-j]; |
| 237 | |
| 238 | define void @rdiv6(i32* %A, i32* %B) nounwind uwtable ssp { |
| 239 | entry: |
| 240 | br label %for.body |
| 241 | |
| 242 | for.body: ; preds = %for.body, %entry |
| 243 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 244 | %conv = trunc i64 %i.03 to i32 |
| 245 | %mul = mul nsw i64 %i.03, -11 |
| 246 | %add = add nsw i64 %mul, 45 |
| 247 | %arrayidx = getelementptr inbounds i32* %A, i64 %add |
| 248 | store i32 %conv, i32* %arrayidx, align 4 |
| 249 | %inc = add nsw i64 %i.03, 1 |
| 250 | %cmp = icmp slt i64 %inc, 6 |
| 251 | br i1 %cmp, label %for.body, label %for.body4 |
| 252 | |
| 253 | for.body4: ; preds = %for.body4, %for.body |
| 254 | %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body ] |
| 255 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 256 | %sub = sub nsw i64 0, %j.02 |
| 257 | %arrayidx5 = getelementptr inbounds i32* %A, i64 %sub |
| 258 | %0 = load i32* %arrayidx5, align 4 |
| 259 | ; CHECK: da analyze - none! |
| 260 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 261 | store i32 %0, i32* %B.addr.01, align 4 |
| 262 | %inc7 = add nsw i64 %j.02, 1 |
| 263 | %cmp2 = icmp slt i64 %inc7, 10 |
| 264 | br i1 %cmp2, label %for.body4, label %for.end8 |
| 265 | |
| 266 | for.end8: ; preds = %for.body4 |
| 267 | ret void |
| 268 | } |
| 269 | |
| 270 | |
| 271 | ;; for (long int i = 0; i < 5; i++) |
| 272 | ;; A[-11*i + 45] = ... |
| 273 | ;; for (long int j = 0; j <= 10; j++) |
| 274 | ;; ... = A[-j]; |
| 275 | |
| 276 | define void @rdiv7(i32* %A, i32* %B) nounwind uwtable ssp { |
| 277 | entry: |
| 278 | br label %for.body |
| 279 | |
| 280 | for.body: ; preds = %for.body, %entry |
| 281 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 282 | %conv = trunc i64 %i.03 to i32 |
| 283 | %mul = mul nsw i64 %i.03, -11 |
| 284 | %add = add nsw i64 %mul, 45 |
| 285 | %arrayidx = getelementptr inbounds i32* %A, i64 %add |
| 286 | store i32 %conv, i32* %arrayidx, align 4 |
| 287 | %inc = add nsw i64 %i.03, 1 |
| 288 | %cmp = icmp slt i64 %inc, 5 |
| 289 | br i1 %cmp, label %for.body, label %for.body4 |
| 290 | |
| 291 | for.body4: ; preds = %for.body4, %for.body |
| 292 | %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body ] |
| 293 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 294 | %sub = sub nsw i64 0, %j.02 |
| 295 | %arrayidx5 = getelementptr inbounds i32* %A, i64 %sub |
| 296 | %0 = load i32* %arrayidx5, align 4 |
| 297 | ; CHECK: da analyze - none! |
| 298 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 299 | store i32 %0, i32* %B.addr.01, align 4 |
| 300 | %inc7 = add nsw i64 %j.02, 1 |
| 301 | %cmp2 = icmp slt i64 %inc7, 11 |
| 302 | br i1 %cmp2, label %for.body4, label %for.end8 |
| 303 | |
| 304 | for.end8: ; preds = %for.body4 |
| 305 | ret void |
| 306 | } |
| 307 | |
| 308 | |
| 309 | ;; for (long int i = 0; i <= 5; i++) |
| 310 | ;; A[-11*i + 45] = ... |
| 311 | ;; for (long int j = 0; j <= 10; j++) |
| 312 | ;; ... = A[-j]; |
| 313 | |
| 314 | define void @rdiv8(i32* %A, i32* %B) nounwind uwtable ssp { |
| 315 | entry: |
| 316 | br label %for.body |
| 317 | |
| 318 | for.body: ; preds = %for.body, %entry |
| 319 | %i.03 = phi i64 [ 0, %entry ], [ %inc, %for.body ] |
| 320 | %conv = trunc i64 %i.03 to i32 |
| 321 | %mul = mul nsw i64 %i.03, -11 |
| 322 | %add = add nsw i64 %mul, 45 |
| 323 | %arrayidx = getelementptr inbounds i32* %A, i64 %add |
| 324 | store i32 %conv, i32* %arrayidx, align 4 |
| 325 | %inc = add nsw i64 %i.03, 1 |
| 326 | %cmp = icmp slt i64 %inc, 6 |
| 327 | br i1 %cmp, label %for.body, label %for.body4 |
| 328 | |
| 329 | for.body4: ; preds = %for.body4, %for.body |
| 330 | %j.02 = phi i64 [ %inc7, %for.body4 ], [ 0, %for.body ] |
| 331 | %B.addr.01 = phi i32* [ %incdec.ptr, %for.body4 ], [ %B, %for.body ] |
| 332 | %sub = sub nsw i64 0, %j.02 |
| 333 | %arrayidx5 = getelementptr inbounds i32* %A, i64 %sub |
| 334 | %0 = load i32* %arrayidx5, align 4 |
| 335 | ; CHECK: da analyze - flow! |
| 336 | %incdec.ptr = getelementptr inbounds i32* %B.addr.01, i64 1 |
| 337 | store i32 %0, i32* %B.addr.01, align 4 |
| 338 | %inc7 = add nsw i64 %j.02, 1 |
| 339 | %cmp2 = icmp slt i64 %inc7, 11 |
| 340 | br i1 %cmp2, label %for.body4, label %for.end8 |
| 341 | |
| 342 | for.end8: ; preds = %for.body4 |
| 343 | ret void |
| 344 | } |
| 345 | |
| 346 | |
| 347 | ;; for (long int i = 0; i < 5; i++) |
| 348 | ;; for (long int j = 0; j < 10; j++) |
| 349 | ;; A[11*i - j] = ... |
| 350 | ;; ... = A[45]; |
| 351 | |
| 352 | define void @rdiv9(i32* %A, i32* %B) nounwind uwtable ssp { |
| 353 | entry: |
| 354 | br label %for.cond1.preheader |
| 355 | |
| 356 | for.cond1.preheader: ; preds = %for.inc5, %entry |
| 357 | %B.addr.04 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.inc5 ] |
| 358 | %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ] |
| 359 | br label %for.body3 |
| 360 | |
| 361 | for.body3: ; preds = %for.body3, %for.cond1.preheader |
| 362 | %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] |
| 363 | %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] |
| 364 | %conv = trunc i64 %i.03 to i32 |
| 365 | %mul = mul nsw i64 %i.03, 11 |
| 366 | %sub = sub nsw i64 %mul, %j.02 |
| 367 | %arrayidx = getelementptr inbounds i32* %A, i64 %sub |
| 368 | store i32 %conv, i32* %arrayidx, align 4 |
| 369 | %arrayidx4 = getelementptr inbounds i32* %A, i64 45 |
| 370 | %0 = load i32* %arrayidx4, align 4 |
| 371 | ; CHECK: da analyze - none! |
| 372 | %incdec.ptr = getelementptr inbounds i32* %B.addr.11, i64 1 |
| 373 | store i32 %0, i32* %B.addr.11, align 4 |
| 374 | %inc = add nsw i64 %j.02, 1 |
| 375 | %cmp2 = icmp slt i64 %inc, 10 |
| 376 | br i1 %cmp2, label %for.body3, label %for.inc5 |
| 377 | |
| 378 | for.inc5: ; preds = %for.body3 |
| 379 | %inc6 = add nsw i64 %i.03, 1 |
| 380 | %cmp = icmp slt i64 %inc6, 5 |
| 381 | br i1 %cmp, label %for.cond1.preheader, label %for.end7 |
| 382 | |
| 383 | for.end7: ; preds = %for.inc5 |
| 384 | ret void |
| 385 | } |
| 386 | |
| 387 | |
| 388 | ;; for (long int i = 0; i < 5; i++) |
| 389 | ;; for (long int j = 0; j <= 10; j++) |
| 390 | ;; A[11*i - j] = ... |
| 391 | ;; ... = A[45]; |
| 392 | |
| 393 | define void @rdiv10(i32* %A, i32* %B) nounwind uwtable ssp { |
| 394 | entry: |
| 395 | br label %for.cond1.preheader |
| 396 | |
| 397 | for.cond1.preheader: ; preds = %for.inc5, %entry |
| 398 | %B.addr.04 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.inc5 ] |
| 399 | %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ] |
| 400 | br label %for.body3 |
| 401 | |
| 402 | for.body3: ; preds = %for.body3, %for.cond1.preheader |
| 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, 11 |
| 407 | %sub = sub nsw i64 %mul, %j.02 |
| 408 | %arrayidx = getelementptr inbounds i32* %A, i64 %sub |
| 409 | store i32 %conv, i32* %arrayidx, align 4 |
| 410 | %arrayidx4 = getelementptr inbounds i32* %A, i64 45 |
| 411 | %0 = load i32* %arrayidx4, align 4 |
| 412 | ; CHECK: da analyze - none! |
| 413 | %incdec.ptr = getelementptr inbounds i32* %B.addr.11, i64 1 |
| 414 | store i32 %0, i32* %B.addr.11, align 4 |
| 415 | %inc = add nsw i64 %j.02, 1 |
| 416 | %cmp2 = icmp slt i64 %inc, 10 |
| 417 | br i1 %cmp2, label %for.body3, label %for.inc5 |
| 418 | |
| 419 | for.inc5: ; preds = %for.body3 |
| 420 | %inc6 = add nsw i64 %i.03, 1 |
| 421 | %cmp = icmp slt i64 %inc6, 6 |
| 422 | br i1 %cmp, label %for.cond1.preheader, label %for.end7 |
| 423 | |
| 424 | for.end7: ; preds = %for.inc5 |
| 425 | ret void |
| 426 | } |
| 427 | |
| 428 | |
| 429 | ;; for (long int i = 0; i <= 5; i++) |
| 430 | ;; for (long int j = 0; j <= 10; j++) |
| 431 | ;; A[11*i - j] = ... |
| 432 | ;; ... = A[45]; |
| 433 | |
| 434 | define void @rdiv11(i32* %A, i32* %B) nounwind uwtable ssp { |
| 435 | entry: |
| 436 | br label %for.cond1.preheader |
| 437 | |
| 438 | for.cond1.preheader: ; preds = %for.inc5, %entry |
| 439 | %B.addr.04 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.inc5 ] |
| 440 | %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ] |
| 441 | br label %for.body3 |
| 442 | |
| 443 | for.body3: ; preds = %for.body3, %for.cond1.preheader |
| 444 | %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] |
| 445 | %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] |
| 446 | %conv = trunc i64 %i.03 to i32 |
| 447 | %mul = mul nsw i64 %i.03, 11 |
| 448 | %sub = sub nsw i64 %mul, %j.02 |
| 449 | %arrayidx = getelementptr inbounds i32* %A, i64 %sub |
| 450 | store i32 %conv, i32* %arrayidx, align 4 |
| 451 | %arrayidx4 = getelementptr inbounds i32* %A, i64 45 |
| 452 | %0 = load i32* %arrayidx4, align 4 |
| 453 | ; CHECK: da analyze - none! |
| 454 | %incdec.ptr = getelementptr inbounds i32* %B.addr.11, i64 1 |
| 455 | store i32 %0, i32* %B.addr.11, align 4 |
| 456 | %inc = add nsw i64 %j.02, 1 |
| 457 | %cmp2 = icmp slt i64 %inc, 11 |
| 458 | br i1 %cmp2, label %for.body3, label %for.inc5 |
| 459 | |
| 460 | for.inc5: ; preds = %for.body3 |
| 461 | %inc6 = add nsw i64 %i.03, 1 |
| 462 | %cmp = icmp slt i64 %inc6, 5 |
| 463 | br i1 %cmp, label %for.cond1.preheader, label %for.end7 |
| 464 | |
| 465 | for.end7: ; preds = %for.inc5 |
| 466 | ret void |
| 467 | } |
| 468 | |
| 469 | |
| 470 | ;; for (long int i = 0; i < 5; i++) |
| 471 | ;; for (long int j = 0; j < 10; j++) |
| 472 | ;; A[11*i - j] = ... |
| 473 | ;; ... = A[45]; |
| 474 | |
| 475 | define void @rdiv12(i32* %A, i32* %B) nounwind uwtable ssp { |
| 476 | entry: |
| 477 | br label %for.cond1.preheader |
| 478 | |
| 479 | for.cond1.preheader: ; preds = %for.inc5, %entry |
| 480 | %B.addr.04 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.inc5 ] |
| 481 | %i.03 = phi i64 [ 0, %entry ], [ %inc6, %for.inc5 ] |
| 482 | br label %for.body3 |
| 483 | |
| 484 | for.body3: ; preds = %for.body3, %for.cond1.preheader |
| 485 | %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ] |
| 486 | %B.addr.11 = phi i32* [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ] |
| 487 | %conv = trunc i64 %i.03 to i32 |
| 488 | %mul = mul nsw i64 %i.03, 11 |
| 489 | %sub = sub nsw i64 %mul, %j.02 |
| 490 | %arrayidx = getelementptr inbounds i32* %A, i64 %sub |
| 491 | store i32 %conv, i32* %arrayidx, align 4 |
| 492 | %arrayidx4 = getelementptr inbounds i32* %A, i64 45 |
| 493 | %0 = load i32* %arrayidx4, align 4 |
| 494 | ; CHECK: da analyze - flow [* *|<]! |
| 495 | %incdec.ptr = getelementptr inbounds i32* %B.addr.11, i64 1 |
| 496 | store i32 %0, i32* %B.addr.11, align 4 |
| 497 | %inc = add nsw i64 %j.02, 1 |
| 498 | %cmp2 = icmp slt i64 %inc, 11 |
| 499 | br i1 %cmp2, label %for.body3, label %for.inc5 |
| 500 | |
| 501 | for.inc5: ; preds = %for.body3 |
| 502 | %inc6 = add nsw i64 %i.03, 1 |
| 503 | %cmp = icmp slt i64 %inc6, 6 |
| 504 | br i1 %cmp, label %for.cond1.preheader, label %for.end7 |
| 505 | |
| 506 | for.end7: ; preds = %for.inc5 |
| 507 | ret void |
| 508 | } |