llvm-project

Форк
0
544 строки · 20.3 Кб
1
; RUN: opt < %s -disable-output "-passes=print<da>" -aa-pipeline=basic-aa 2>&1 \
2
; RUN: | FileCheck %s
3

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 < 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

13
define void @prop0(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
14
entry:
15
  br label %for.cond1.preheader
16

17
; CHECK-LABEL: prop0
18
; CHECK: da analyze - none!
19
; CHECK: da analyze - flow [< >]!
20
; CHECK: da analyze - confused!
21
; CHECK: da analyze - none!
22
; CHECK: da analyze - confused!
23
; CHECK: da analyze - none!
24

25
for.cond1.preheader:                              ; preds = %entry, %for.inc9
26
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc9 ]
27
  %i.03 = phi i64 [ 0, %entry ], [ %inc10, %for.inc9 ]
28
  br label %for.body3
29

30
for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
31
  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
32
  %B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
33
  %conv = trunc i64 %i.03 to i32
34
  %add = add nsw i64 %i.03, %j.02
35
  %add4 = add nsw i64 %i.03, 1
36
  %arrayidx5 = getelementptr inbounds [100 x i32], ptr %A, i64 %add4, i64 %add
37
  store i32 %conv, ptr %arrayidx5, align 4
38
  %add6 = add nsw i64 %i.03, %j.02
39
  %arrayidx8 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add6
40
  %0 = load i32, ptr %arrayidx8, align 4
41
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
42
  store i32 %0, ptr %B.addr.11, align 4
43
  %inc = add nsw i64 %j.02, 1
44
  %exitcond = icmp ne i64 %inc, 100
45
  br i1 %exitcond, label %for.body3, label %for.inc9
46

47
for.inc9:                                         ; preds = %for.body3
48
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
49
  %inc10 = add nsw i64 %i.03, 1
50
  %exitcond5 = icmp ne i64 %inc10, 100
51
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end11
52

53
for.end11:                                        ; preds = %for.inc9
54
  ret void
55
}
56

57

58
;;  for (long int i = 0; i < 100; i++)
59
;;    for (long int j = 0; j < 100; j++)
60
;;      for (long int k = 0; k < 100; k++) {
61
;;        A[j - i][i + 1][j + k] = i;
62
;;        *B++ = A[j - i][i][j + k];
63

64
define void @prop1(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
65
entry:
66
  br label %for.cond1.preheader
67

68
; CHECK-LABEL: prop1
69
; CHECK: da analyze - output [* * *]!
70
; CHECK: da analyze - flow [<> <> *]!
71
; CHECK: da analyze - confused!
72
; CHECK: da analyze - input [* * *]!
73
; CHECK: da analyze - confused!
74
; CHECK: da analyze - none!
75

76
for.cond1.preheader:                              ; preds = %entry, %for.inc18
77
  %B.addr.06 = phi ptr [ %B, %entry ], [ %scevgep7, %for.inc18 ]
78
  %i.05 = phi i64 [ 0, %entry ], [ %inc19, %for.inc18 ]
79
  br label %for.cond4.preheader
80

81
for.cond4.preheader:                              ; preds = %for.cond1.preheader, %for.inc15
82
  %B.addr.14 = phi ptr [ %B.addr.06, %for.cond1.preheader ], [ %scevgep, %for.inc15 ]
83
  %j.03 = phi i64 [ 0, %for.cond1.preheader ], [ %inc16, %for.inc15 ]
84
  br label %for.body6
85

86
for.body6:                                        ; preds = %for.cond4.preheader, %for.body6
87
  %k.02 = phi i64 [ 0, %for.cond4.preheader ], [ %inc, %for.body6 ]
88
  %B.addr.21 = phi ptr [ %B.addr.14, %for.cond4.preheader ], [ %incdec.ptr, %for.body6 ]
89
  %conv = trunc i64 %i.05 to i32
90
  %add = add nsw i64 %j.03, %k.02
91
  %add7 = add nsw i64 %i.05, 1
92
  %sub = sub nsw i64 %j.03, %i.05
93
  %arrayidx9 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %sub, i64 %add7, i64 %add
94
  store i32 %conv, ptr %arrayidx9, align 4
95
  %add10 = add nsw i64 %j.03, %k.02
96
  %sub11 = sub nsw i64 %j.03, %i.05
97
  %arrayidx14 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %sub11, i64 %i.05, i64 %add10
98
  %0 = load i32, ptr %arrayidx14, align 4
99
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.21, i64 1
100
  store i32 %0, ptr %B.addr.21, align 4
101
  %inc = add nsw i64 %k.02, 1
102
  %exitcond = icmp ne i64 %inc, 100
103
  br i1 %exitcond, label %for.body6, label %for.inc15
104

105
for.inc15:                                        ; preds = %for.body6
106
  %scevgep = getelementptr i32, ptr %B.addr.14, i64 100
107
  %inc16 = add nsw i64 %j.03, 1
108
  %exitcond8 = icmp ne i64 %inc16, 100
109
  br i1 %exitcond8, label %for.cond4.preheader, label %for.inc18
110

111
for.inc18:                                        ; preds = %for.inc15
112
  %scevgep7 = getelementptr i32, ptr %B.addr.06, i64 10000
113
  %inc19 = add nsw i64 %i.05, 1
114
  %exitcond9 = icmp ne i64 %inc19, 100
115
  br i1 %exitcond9, label %for.cond1.preheader, label %for.end20
116

117
for.end20:                                        ; preds = %for.inc18
118
  ret void
119
}
120

121

122
;;  for (long int i = 0; i < 100; i++)
123
;;    for (long int j = 0; j ptr]!
124
;;    for (long int j = 0; j < 100; j++) {
125
;;      A[i - 1][2*i] = i;
126
;;      *B++ = A[i][i + j + 110];
127

128
define void @prop2(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
129
entry:
130
  br label %for.cond1.preheader
131

132
; CHECK-LABEL: prop2
133
; CHECK: da analyze - consistent output [0 S]!
134
; CHECK: da analyze - flow [> *]!
135
; CHECK: da analyze - confused!
136
; CHECK: da analyze - none!
137
; CHECK: da analyze - confused!
138
; CHECK: da analyze - none!
139

140
for.cond1.preheader:                              ; preds = %entry, %for.inc8
141
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc8 ]
142
  %i.03 = phi i64 [ 0, %entry ], [ %inc9, %for.inc8 ]
143
  br label %for.body3
144

145
for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
146
  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
147
  %B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
148
  %conv = trunc i64 %i.03 to i32
149
  %mul = shl nsw i64 %i.03, 1
150
  %sub = add nsw i64 %i.03, -1
151
  %arrayidx4 = getelementptr inbounds [100 x i32], ptr %A, i64 %sub, i64 %mul
152
  store i32 %conv, ptr %arrayidx4, align 4
153
  %add = add nsw i64 %i.03, %j.02
154
  %add5 = add nsw i64 %add, 110
155
  %arrayidx7 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add5
156
  %0 = load i32, ptr %arrayidx7, align 4
157
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
158
  store i32 %0, ptr %B.addr.11, align 4
159
  %inc = add nsw i64 %j.02, 1
160
  %exitcond = icmp ne i64 %inc, 100
161
  br i1 %exitcond, label %for.body3, label %for.inc8
162

163
for.inc8:                                         ; preds = %for.body3
164
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
165
  %inc9 = add nsw i64 %i.03, 1
166
  %exitcond5 = icmp ne i64 %inc9, 100
167
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end10
168

169
for.end10:                                        ; preds = %for.inc8
170
  ret void
171
}
172

173

174
;;  for (long int i = 0; i < 100; i++)
175
;;    for (long int j = 0; j < 100; j++) {
176
;;      A[i][2*j + i] = i;
177
;;      *B++ = A[i][2*j - i + 5];
178

179
define void @prop3(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
180
entry:
181
  br label %for.cond1.preheader
182

183
; CHECK-LABEL: prop3
184
; CHECK: da analyze - output [* *]!
185
; CHECK: da analyze - flow [<> *]!
186
; CHECK: da analyze - confused!
187
; CHECK: da analyze - input [* *]!
188
; CHECK: da analyze - confused!
189
; CHECK: da analyze - none!
190

191
for.cond1.preheader:                              ; preds = %entry, %for.inc9
192
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc9 ]
193
  %i.03 = phi i64 [ 0, %entry ], [ %inc10, %for.inc9 ]
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 ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
199
  %conv = trunc i64 %i.03 to i32
200
  %mul = shl nsw i64 %j.02, 1
201
  %add = add nsw i64 %mul, %i.03
202
  %arrayidx4 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add
203
  store i32 %conv, ptr %arrayidx4, align 4
204
  %mul5 = shl nsw i64 %j.02, 1
205
  %sub = sub nsw i64 %mul5, %i.03
206
  %add6 = add nsw i64 %sub, 5
207
  %arrayidx8 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add6
208
  %0 = load i32, ptr %arrayidx8, align 4
209
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
210
  store i32 %0, ptr %B.addr.11, align 4
211
  %inc = add nsw i64 %j.02, 1
212
  %exitcond = icmp ne i64 %inc, 100
213
  br i1 %exitcond, label %for.body3, label %for.inc9
214

215
for.inc9:                                         ; preds = %for.body3
216
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
217
  %inc10 = add nsw i64 %i.03, 1
218
  %exitcond5 = icmp ne i64 %inc10, 100
219
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end11
220

221
for.end11:                                        ; preds = %for.inc9
222
  ret void
223
}
224

225

226
;;  for (long int i = 0; i < 100; i++)
227
;;    for (long int j = 0; j < 100; j++) {
228
;;      A[i + 2][2*i + j + 1] = i;
229
;;      *B++ = A[i][2*i + j];
230

231
define void @prop4(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
232
entry:
233
  br label %for.cond1.preheader
234

235
; CHECK-LABEL: prop4
236
; CHECK: da analyze - none!
237
; CHECK: da analyze - flow [< <>]!
238
; CHECK: da analyze - confused!
239
; CHECK: da analyze - none!
240
; CHECK: da analyze - confused!
241
; CHECK: da analyze - none!
242

243
for.cond1.preheader:                              ; preds = %entry, %for.inc11
244
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc11 ]
245
  %i.03 = phi i64 [ 0, %entry ], [ %inc12, %for.inc11 ]
246
  br label %for.body3
247

248
for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
249
  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
250
  %B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
251
  %conv = trunc i64 %i.03 to i32
252
  %mul = shl nsw i64 %i.03, 1
253
  %add = add nsw i64 %mul, %j.02
254
  %add4 = add nsw i64 %add, 1
255
  %add5 = add nsw i64 %i.03, 2
256
  %arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 %add5, i64 %add4
257
  store i32 %conv, ptr %arrayidx6, align 4
258
  %mul7 = shl nsw i64 %i.03, 1
259
  %add8 = add nsw i64 %mul7, %j.02
260
  %arrayidx10 = getelementptr inbounds [100 x i32], ptr %A, i64 %i.03, i64 %add8
261
  %0 = load i32, ptr %arrayidx10, align 4
262
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
263
  store i32 %0, ptr %B.addr.11, align 4
264
  %inc = add nsw i64 %j.02, 1
265
  %exitcond = icmp ne i64 %inc, 100
266
  br i1 %exitcond, label %for.body3, label %for.inc11
267

268
for.inc11:                                        ; preds = %for.body3
269
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
270
  %inc12 = add nsw i64 %i.03, 1
271
  %exitcond5 = icmp ne i64 %inc12, 100
272
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end13
273

274
for.end13:                                        ; preds = %for.inc11
275
  ret void
276
}
277

278

279
;;  for (long int i = 0; i < 100; i++)
280
;;    for (long int j = 0; j < 100; j++) {
281
;;      A[3*i - 18][22 - i][2*i + j] = i;
282
;;      *B++ = A[i][i][3*i + j];
283

284
define void @prop5(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
285
entry:
286
  br label %for.cond1.preheader
287

288
; CHECK-LABEL: prop5
289
; CHECK: da analyze - none!
290
; CHECK: da analyze - flow [* *|<]!
291
; CHECK: da analyze - confused!
292
; CHECK: da analyze - none!
293
; CHECK: da analyze - confused!
294
; CHECK: da analyze - none!
295

296
for.cond1.preheader:                              ; preds = %entry, %for.inc13
297
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc13 ]
298
  %i.03 = phi i64 [ 0, %entry ], [ %inc14, %for.inc13 ]
299
  br label %for.body3
300

301
for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
302
  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
303
  %B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
304
  %conv = trunc i64 %i.03 to i32
305
  %mul = shl nsw i64 %i.03, 1
306
  %add = add nsw i64 %mul, %j.02
307
  %sub = sub nsw i64 22, %i.03
308
  %mul4 = mul nsw i64 %i.03, 3
309
  %sub5 = add nsw i64 %mul4, -18
310
  %arrayidx7 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %sub5, i64 %sub, i64 %add
311
  store i32 %conv, ptr %arrayidx7, align 4
312
  %mul8 = mul nsw i64 %i.03, 3
313
  %add9 = add nsw i64 %mul8, %j.02
314
  %arrayidx12 = getelementptr inbounds [100 x [100 x i32]], ptr %A, i64 %i.03, i64 %i.03, i64 %add9
315
  %0 = load i32, ptr %arrayidx12, align 4
316
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
317
  store i32 %0, ptr %B.addr.11, align 4
318
  %inc = add nsw i64 %j.02, 1
319
  %exitcond = icmp ne i64 %inc, 100
320
  br i1 %exitcond, label %for.body3, label %for.inc13
321

322
for.inc13:                                        ; preds = %for.body3
323
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
324
  %inc14 = add nsw i64 %i.03, 1
325
  %exitcond5 = icmp ne i64 %inc14, 100
326
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end15
327

328
for.end15:                                        ; preds = %for.inc13
329
  ret void
330
}
331

332

333
;;  for (long int i = 0; i < 100; i++)
334
;;    for (long int j = 0; j < 100; j++) {
335
;;      A[i + 1][4*i + j + 2] = i;
336
;;      *B++ = A[2*i][8*i + j];
337

338
define void @prop6(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
339
entry:
340
  br label %for.cond1.preheader
341

342
; CHECK-LABEL: prop6
343
; CHECK: da analyze - none!
344
; CHECK: da analyze - flow [=> <>]!
345
; CHECK: da analyze - confused!
346
; CHECK: da analyze - none!
347
; CHECK: da analyze - confused!
348
; CHECK: da analyze - none!
349

350
for.cond1.preheader:                              ; preds = %entry, %for.inc12
351
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc12 ]
352
  %i.03 = phi i64 [ 0, %entry ], [ %inc13, %for.inc12 ]
353
  br label %for.body3
354

355
for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
356
  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
357
  %B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
358
  %conv = trunc i64 %i.03 to i32
359
  %mul = shl nsw i64 %i.03, 2
360
  %add = add nsw i64 %mul, %j.02
361
  %add4 = add nsw i64 %add, 2
362
  %add5 = add nsw i64 %i.03, 1
363
  %arrayidx6 = getelementptr inbounds [100 x i32], ptr %A, i64 %add5, i64 %add4
364
  store i32 %conv, ptr %arrayidx6, align 4
365
  %mul7 = shl nsw i64 %i.03, 3
366
  %add8 = add nsw i64 %mul7, %j.02
367
  %mul9 = shl nsw i64 %i.03, 1
368
  %arrayidx11 = getelementptr inbounds [100 x i32], ptr %A, i64 %mul9, i64 %add8
369
  %0 = load i32, ptr %arrayidx11, align 4
370
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
371
  store i32 %0, ptr %B.addr.11, align 4
372
  %inc = add nsw i64 %j.02, 1
373
  %exitcond = icmp ne i64 %inc, 100
374
  br i1 %exitcond, label %for.body3, label %for.inc12
375

376
for.inc12:                                        ; preds = %for.body3
377
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
378
  %inc13 = add nsw i64 %i.03, 1
379
  %exitcond5 = icmp ne i64 %inc13, 100
380
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end14
381

382
for.end14:                                        ; preds = %for.inc12
383
  ret void
384
}
385

386

387
;;  for (long int i = 0; i < 100; i++)
388
;;    for (long int j = 0; j < 100; j++) {
389
;;      A[2*i + 4][-5*i + j + 2] = i;
390
;;      *B++ = A[-2*i + 20][5*i + j];
391

392
define void @prop7(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
393
entry:
394
  br label %for.cond1.preheader
395

396
; CHECK-LABEL: prop7
397
; CHECK: da analyze - none!
398
; CHECK: da analyze - flow [* <>]!
399
; CHECK: da analyze - confused!
400
; CHECK: da analyze - none!
401
; CHECK: da analyze - confused!
402
; CHECK: da analyze - none!
403

404
for.cond1.preheader:                              ; preds = %entry, %for.inc14
405
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc14 ]
406
  %i.03 = phi i64 [ 0, %entry ], [ %inc15, %for.inc14 ]
407
  br label %for.body3
408

409
for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
410
  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
411
  %B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
412
  %conv = trunc i64 %i.03 to i32
413
  %mul = mul nsw i64 %i.03, -5
414
  %add = add nsw i64 %mul, %j.02
415
  %add4 = add nsw i64 %add, 2
416
  %mul5 = shl nsw i64 %i.03, 1
417
  %add6 = add nsw i64 %mul5, 4
418
  %arrayidx7 = getelementptr inbounds [100 x i32], ptr %A, i64 %add6, i64 %add4
419
  store i32 %conv, ptr %arrayidx7, align 4
420
  %mul8 = mul nsw i64 %i.03, 5
421
  %add9 = add nsw i64 %mul8, %j.02
422
  %mul10 = mul nsw i64 %i.03, -2
423
  %add11 = add nsw i64 %mul10, 20
424
  %arrayidx13 = getelementptr inbounds [100 x i32], ptr %A, i64 %add11, i64 %add9
425
  %0 = load i32, ptr %arrayidx13, align 4
426
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
427
  store i32 %0, ptr %B.addr.11, align 4
428
  %inc = add nsw i64 %j.02, 1
429
  %exitcond = icmp ne i64 %inc, 100
430
  br i1 %exitcond, label %for.body3, label %for.inc14
431

432
for.inc14:                                        ; preds = %for.body3
433
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
434
  %inc15 = add nsw i64 %i.03, 1
435
  %exitcond5 = icmp ne i64 %inc15, 100
436
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end16
437

438
for.end16:                                        ; preds = %for.inc14
439
  ret void
440
}
441

442

443
;;  for (long int i = 0; i < 100; i++)
444
;;    for (long int j = 0; j < 100; j++) {
445
;;      A[4][j + 2] = i;
446
;;      *B++ = A[-2*i + 4][5*i + j];
447

448
define void @prop8(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
449
entry:
450
  br label %for.cond1.preheader
451

452
; CHECK-LABEL: prop8
453
; CHECK: da analyze - consistent output [S 0]!
454
; CHECK: da analyze - flow [=> <]!
455
; CHECK: da analyze - confused!
456
; CHECK: da analyze - none!
457
; CHECK: da analyze - confused!
458
; CHECK: da analyze - none!
459

460
for.cond1.preheader:                              ; preds = %entry, %for.inc10
461
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc10 ]
462
  %i.03 = phi i64 [ 0, %entry ], [ %inc11, %for.inc10 ]
463
  br label %for.body3
464

465
for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
466
  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
467
  %B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
468
  %conv = trunc i64 %i.03 to i32
469
  %add = add nsw i64 %j.02, 2
470
  %arrayidx4 = getelementptr inbounds [100 x i32], ptr %A, i64 4, i64 %add
471
  store i32 %conv, ptr %arrayidx4, align 4
472
  %mul = mul nsw i64 %i.03, 5
473
  %add5 = add nsw i64 %mul, %j.02
474
  %mul6 = mul nsw i64 %i.03, -2
475
  %add7 = add nsw i64 %mul6, 4
476
  %arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 %add7, i64 %add5
477
  %0 = load i32, ptr %arrayidx9, align 4
478
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
479
  store i32 %0, ptr %B.addr.11, align 4
480
  %inc = add nsw i64 %j.02, 1
481
  %exitcond = icmp ne i64 %inc, 100
482
  br i1 %exitcond, label %for.body3, label %for.inc10
483

484
for.inc10:                                        ; preds = %for.body3
485
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
486
  %inc11 = add nsw i64 %i.03, 1
487
  %exitcond5 = icmp ne i64 %inc11, 100
488
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end12
489

490
for.end12:                                        ; preds = %for.inc10
491
  ret void
492
}
493

494

495
;;  for (long int i = 0; i < 100; i++)
496
;;    for (long int j = 0; j < 100; j++) {
497
;;      A[2*i + 4][5*i + j + 2] = i;
498
;;      *B++ = A[4][j];
499

500
define void @prop9(ptr %A, ptr %B, i32 %n) nounwind uwtable ssp {
501
entry:
502
  br label %for.cond1.preheader
503

504
; CHECK-LABEL: prop9
505
; CHECK: da analyze - none!
506
; CHECK: da analyze - flow [<= <]!
507
; CHECK: da analyze - confused!
508
; CHECK: da analyze - consistent input [S 0]!
509
; CHECK: da analyze - confused!
510
; CHECK: da analyze - none!
511

512
for.cond1.preheader:                              ; preds = %entry, %for.inc10
513
  %B.addr.04 = phi ptr [ %B, %entry ], [ %scevgep, %for.inc10 ]
514
  %i.03 = phi i64 [ 0, %entry ], [ %inc11, %for.inc10 ]
515
  br label %for.body3
516

517
for.body3:                                        ; preds = %for.cond1.preheader, %for.body3
518
  %j.02 = phi i64 [ 0, %for.cond1.preheader ], [ %inc, %for.body3 ]
519
  %B.addr.11 = phi ptr [ %B.addr.04, %for.cond1.preheader ], [ %incdec.ptr, %for.body3 ]
520
  %conv = trunc i64 %i.03 to i32
521
  %mul = mul nsw i64 %i.03, 5
522
  %add = add nsw i64 %mul, %j.02
523
  %add4 = add nsw i64 %add, 2
524
  %mul5 = shl nsw i64 %i.03, 1
525
  %add6 = add nsw i64 %mul5, 4
526
  %arrayidx7 = getelementptr inbounds [100 x i32], ptr %A, i64 %add6, i64 %add4
527
  store i32 %conv, ptr %arrayidx7, align 4
528
  %arrayidx9 = getelementptr inbounds [100 x i32], ptr %A, i64 4, i64 %j.02
529
  %0 = load i32, ptr %arrayidx9, align 4
530
  %incdec.ptr = getelementptr inbounds i32, ptr %B.addr.11, i64 1
531
  store i32 %0, ptr %B.addr.11, align 4
532
  %inc = add nsw i64 %j.02, 1
533
  %exitcond = icmp ne i64 %inc, 100
534
  br i1 %exitcond, label %for.body3, label %for.inc10
535

536
for.inc10:                                        ; preds = %for.body3
537
  %scevgep = getelementptr i32, ptr %B.addr.04, i64 100
538
  %inc11 = add nsw i64 %i.03, 1
539
  %exitcond5 = icmp ne i64 %inc11, 100
540
  br i1 %exitcond5, label %for.cond1.preheader, label %for.end12
541

542
for.end12:                                        ; preds = %for.inc10
543
  ret void
544
}
545

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.