1
; RUN: opt < %s -analyze -basicaa -da | FileCheck %s
3
; ModuleID = 'WeakZeroDstSIV.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"
8
;; for (long unsigned i = 0; i < 30; i++) {
12
define void @weakzerodst0(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
16
; CHECK: da analyze - none!
17
; CHECK: da analyze - flow [p<=|<]!
18
; CHECK: da analyze - confused!
19
; CHECK: da analyze - consistent input [S]!
20
; CHECK: da analyze - confused!
21
; CHECK: da analyze - none!
23
for.body: ; preds = %entry, %for.body
24
%i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
25
%B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
26
%conv = trunc i64 %i.02 to i32
27
%mul = shl i64 %i.02, 1
28
%add = add i64 %mul, 10
29
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
30
store i32 %conv, i32* %arrayidx, align 4
31
%arrayidx1 = getelementptr inbounds i32, i32* %A, i64 10
32
%0 = load i32, i32* %arrayidx1, align 4
33
%incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
34
store i32 %0, i32* %B.addr.01, align 4
35
%inc = add i64 %i.02, 1
36
%exitcond = icmp ne i64 %inc, 30
37
br i1 %exitcond, label %for.body, label %for.end
39
for.end: ; preds = %for.body
44
;; for (long unsigned i = 0; i < n; i++) {
48
define void @weakzerodst1(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
50
%cmp1 = icmp eq i64 %n, 0
51
br i1 %cmp1, label %for.end, label %for.body.preheader
53
; CHECK: da analyze - none!
54
; CHECK: da analyze - flow [p<=|<]!
55
; CHECK: da analyze - confused!
56
; CHECK: da analyze - consistent input [S]!
57
; CHECK: da analyze - confused!
58
; CHECK: da analyze - none!
60
for.body.preheader: ; preds = %entry
63
for.body: ; preds = %for.body.preheader, %for.body
64
%i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
65
%B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
66
%conv = trunc i64 %i.03 to i32
67
%mul = mul i64 %i.03, %n
68
%add = add i64 %mul, 10
69
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %add
70
store i32 %conv, i32* %arrayidx, align 4
71
%arrayidx1 = getelementptr inbounds i32, i32* %A, i64 10
72
%0 = load i32, i32* %arrayidx1, align 4
73
%incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
74
store i32 %0, i32* %B.addr.02, align 4
75
%inc = add i64 %i.03, 1
76
%exitcond = icmp ne i64 %inc, %n
77
br i1 %exitcond, label %for.body, label %for.end.loopexit
79
for.end.loopexit: ; preds = %for.body
82
for.end: ; preds = %for.end.loopexit, %entry
87
;; for (long unsigned i = 0; i < 5; i++) {
91
define void @weakzerodst2(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
95
; CHECK: da analyze - none!
96
; CHECK: da analyze - none!
97
; CHECK: da analyze - confused!
98
; CHECK: da analyze - consistent input [S]!
99
; CHECK: da analyze - confused!
100
; CHECK: da analyze - none!
102
for.body: ; preds = %entry, %for.body
103
%i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
104
%B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
105
%conv = trunc i64 %i.02 to i32
106
%mul = shl i64 %i.02, 1
107
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
108
store i32 %conv, i32* %arrayidx, align 4
109
%arrayidx1 = getelementptr inbounds i32, i32* %A, i64 10
110
%0 = load i32, i32* %arrayidx1, align 4
111
%incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
112
store i32 %0, i32* %B.addr.01, align 4
113
%inc = add i64 %i.02, 1
114
%exitcond = icmp ne i64 %inc, 5
115
br i1 %exitcond, label %for.body, label %for.end
117
for.end: ; preds = %for.body
122
;; for (long unsigned i = 0; i < 6; i++) {
126
define void @weakzerodst3(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
130
; CHECK: da analyze - none!
131
; CHECK: da analyze - flow [=>p|<]!
132
; CHECK: da analyze - confused!
133
; CHECK: da analyze - consistent input [S]!
134
; CHECK: da analyze - confused!
135
; CHECK: da analyze - none!
137
for.body: ; preds = %entry, %for.body
138
%i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
139
%B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
140
%conv = trunc i64 %i.02 to i32
141
%mul = shl i64 %i.02, 1
142
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
143
store i32 %conv, i32* %arrayidx, align 4
144
%arrayidx1 = getelementptr inbounds i32, i32* %A, i64 10
145
%0 = load i32, i32* %arrayidx1, align 4
146
%incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
147
store i32 %0, i32* %B.addr.01, align 4
148
%inc = add i64 %i.02, 1
149
%exitcond = icmp ne i64 %inc, 6
150
br i1 %exitcond, label %for.body, label %for.end
152
for.end: ; preds = %for.body
157
;; for (long unsigned i = 0; i < 7; i++) {
161
define void @weakzerodst4(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
165
; CHECK: da analyze - none!
166
; CHECK: da analyze - flow [*|<]!
167
; CHECK: da analyze - confused!
168
; CHECK: da analyze - consistent input [S]!
169
; CHECK: da analyze - confused!
170
; CHECK: da analyze - none!
172
for.body: ; preds = %entry, %for.body
173
%i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
174
%B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
175
%conv = trunc i64 %i.02 to i32
176
%mul = shl i64 %i.02, 1
177
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
178
store i32 %conv, i32* %arrayidx, align 4
179
%arrayidx1 = getelementptr inbounds i32, i32* %A, i64 10
180
%0 = load i32, i32* %arrayidx1, align 4
181
%incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
182
store i32 %0, i32* %B.addr.01, align 4
183
%inc = add i64 %i.02, 1
184
%exitcond = icmp ne i64 %inc, 7
185
br i1 %exitcond, label %for.body, label %for.end
187
for.end: ; preds = %for.body
192
;; for (long unsigned i = 0; i < 7; i++) {
196
define void @weakzerodst5(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
200
; CHECK: da analyze - none!
201
; CHECK: da analyze - none!
202
; CHECK: da analyze - confused!
203
; CHECK: da analyze - consistent input [S]!
204
; CHECK: da analyze - confused!
205
; CHECK: da analyze - none!
207
for.body: ; preds = %entry, %for.body
208
%i.02 = phi i64 [ 0, %entry ], [ %inc, %for.body ]
209
%B.addr.01 = phi i32* [ %B, %entry ], [ %incdec.ptr, %for.body ]
210
%conv = trunc i64 %i.02 to i32
211
%mul = shl i64 %i.02, 1
212
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
213
store i32 %conv, i32* %arrayidx, align 4
214
%arrayidx1 = getelementptr inbounds i32, i32* %A, i64 -10
215
%0 = load i32, i32* %arrayidx1, align 4
216
%incdec.ptr = getelementptr inbounds i32, i32* %B.addr.01, i64 1
217
store i32 %0, i32* %B.addr.01, align 4
218
%inc = add i64 %i.02, 1
219
%exitcond = icmp ne i64 %inc, 7
220
br i1 %exitcond, label %for.body, label %for.end
222
for.end: ; preds = %for.body
227
;; for (long unsigned i = 0; i < n; i++) {
231
define void @weakzerodst6(i32* %A, i32* %B, i64 %n) nounwind uwtable ssp {
233
%cmp1 = icmp eq i64 %n, 0
234
br i1 %cmp1, label %for.end, label %for.body.preheader
236
; CHECK: da analyze - none!
237
; CHECK: da analyze - none!
238
; CHECK: da analyze - confused!
239
; CHECK: da analyze - consistent input [S]!
240
; CHECK: da analyze - confused!
241
; CHECK: da analyze - none!
243
for.body.preheader: ; preds = %entry
246
for.body: ; preds = %for.body.preheader, %for.body
247
%i.03 = phi i64 [ %inc, %for.body ], [ 0, %for.body.preheader ]
248
%B.addr.02 = phi i32* [ %incdec.ptr, %for.body ], [ %B, %for.body.preheader ]
249
%conv = trunc i64 %i.03 to i32
250
%mul = mul i64 %i.03, 3
251
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %mul
252
store i32 %conv, i32* %arrayidx, align 4
253
%arrayidx1 = getelementptr inbounds i32, i32* %A, i64 10
254
%0 = load i32, i32* %arrayidx1, align 4
255
%incdec.ptr = getelementptr inbounds i32, i32* %B.addr.02, i64 1
256
store i32 %0, i32* %B.addr.02, align 4
257
%inc = add i64 %i.03, 1
258
%exitcond = icmp ne i64 %inc, %n
259
br i1 %exitcond, label %for.body, label %for.end.loopexit
261
for.end.loopexit: ; preds = %for.body
264
for.end: ; preds = %for.end.loopexit, %entry