File: llvm-doloop_04-e25bf76.stdout

package info (click to toggle)
lfortran 0.58.0-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 54,512 kB
  • sloc: cpp: 162,179; f90: 68,251; python: 17,476; ansic: 6,278; yacc: 2,334; sh: 1,317; fortran: 892; makefile: 33; javascript: 15
file content (367 lines) | stat: -rw-r--r-- 14,851 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
; ModuleID = 'LFortran'
source_filename = "LFortran"

%string_descriptor = type <{ i8*, i64 }>

@"ERROR STOP" = private unnamed_addr constant [11 x i8] c"ERROR STOP\00", align 1
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@2 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [3 x i8] c"I4\00", align 1
@3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@4 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@5 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@6 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info.1 = private unnamed_addr constant [3 x i8] c"I4\00", align 1
@7 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@8 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@9 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@10 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@11 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
@12 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@13 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define i32 @main(i32 %0, i8** %1) {
.entry:
  %i = alloca i32, align 4
  %j = alloca i32, align 4
  %k = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %i1 = alloca i32, align 4
  %j2 = alloca i32, align 4
  %k3 = alloca i32, align 4
  store i32 0, i32* %j2, align 4
  store i32 2, i32* %k3, align 4
  %2 = load i32, i32* %k3, align 4
  %3 = sub i32 1, %2
  store i32 %3, i32* %i1, align 4
  br label %loop.head

loop.head:                                        ; preds = %loop.body, %.entry
  %4 = load i32, i32* %k3, align 4
  %5 = icmp sgt i32 %4, 0
  %6 = load i32, i32* %i1, align 4
  %7 = load i32, i32* %k3, align 4
  %8 = add i32 %6, %7
  %9 = icmp sle i32 %8, 10
  %10 = icmp eq i1 %5, false
  %11 = select i1 %10, i1 %5, i1 %9
  %12 = load i32, i32* %k3, align 4
  %13 = icmp sle i32 %12, 0
  %14 = load i32, i32* %i1, align 4
  %15 = load i32, i32* %k3, align 4
  %16 = add i32 %14, %15
  %17 = icmp sge i32 %16, 10
  %18 = icmp eq i1 %13, false
  %19 = select i1 %18, i1 %13, i1 %17
  %20 = icmp eq i1 %11, false
  %21 = select i1 %20, i1 %19, i1 %11
  br i1 %21, label %loop.body, label %loop.end

loop.body:                                        ; preds = %loop.head
  %22 = load i32, i32* %i1, align 4
  %23 = load i32, i32* %k3, align 4
  %24 = add i32 %22, %23
  store i32 %24, i32* %i1, align 4
  %25 = load i32, i32* %j2, align 4
  %26 = load i32, i32* %i1, align 4
  %27 = add i32 %25, %26
  store i32 %27, i32* %j2, align 4
  br label %loop.head

loop.end:                                         ; preds = %loop.head
  %28 = load i32, i32* %j2, align 4
  %29 = icmp ne i32 %28, 25
  br i1 %29, label %then, label %else

then:                                             ; preds = %loop.end
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont

else:                                             ; preds = %loop.end
  br label %ifcont

ifcont:                                           ; preds = %else, %then
  %30 = alloca i64, align 8
  %31 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info, i32 0, i32 0), i64* %30, i32 0, i32 0, i32* %j2)
  %32 = load i64, i64* %30, align 4
  %stringFormat_desc = alloca %string_descriptor, align 8
  %33 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %31, i8** %33, align 8
  %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %32, i64* %34, align 4
  %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %36 = load i8*, i8** %35, align 8
  %37 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %38 = load i64, i64* %37, align 4
  %39 = trunc i64 %38 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %36, i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
  call void @_lfortran_free(i8* %31)
  store i32 0, i32* %j2, align 4
  store i32 -2, i32* %k3, align 4
  %40 = load i32, i32* %k3, align 4
  %41 = sub i32 10, %40
  store i32 %41, i32* %i1, align 4
  br label %loop.head4

loop.head4:                                       ; preds = %loop.body5, %ifcont
  %42 = load i32, i32* %k3, align 4
  %43 = icmp sgt i32 %42, 0
  %44 = load i32, i32* %i1, align 4
  %45 = load i32, i32* %k3, align 4
  %46 = add i32 %44, %45
  %47 = icmp sle i32 %46, 1
  %48 = icmp eq i1 %43, false
  %49 = select i1 %48, i1 %43, i1 %47
  %50 = load i32, i32* %k3, align 4
  %51 = icmp sle i32 %50, 0
  %52 = load i32, i32* %i1, align 4
  %53 = load i32, i32* %k3, align 4
  %54 = add i32 %52, %53
  %55 = icmp sge i32 %54, 1
  %56 = icmp eq i1 %51, false
  %57 = select i1 %56, i1 %51, i1 %55
  %58 = icmp eq i1 %49, false
  %59 = select i1 %58, i1 %57, i1 %49
  br i1 %59, label %loop.body5, label %loop.end6

loop.body5:                                       ; preds = %loop.head4
  %60 = load i32, i32* %i1, align 4
  %61 = load i32, i32* %k3, align 4
  %62 = add i32 %60, %61
  store i32 %62, i32* %i1, align 4
  %63 = load i32, i32* %j2, align 4
  %64 = load i32, i32* %i1, align 4
  %65 = add i32 %63, %64
  store i32 %65, i32* %j2, align 4
  br label %loop.head4

loop.end6:                                        ; preds = %loop.head4
  %66 = load i32, i32* %j2, align 4
  %67 = icmp ne i32 %66, 30
  br i1 %67, label %then7, label %else8

then7:                                            ; preds = %loop.end6
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @5, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @4, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont9

else8:                                            ; preds = %loop.end6
  br label %ifcont9

ifcont9:                                          ; preds = %else8, %then7
  %68 = alloca i64, align 8
  %69 = call i8* (i8*, i64, i8*, i64*, i32, i32, ...) @_lcompilers_string_format_fortran(i8* null, i64 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @serialization_info.1, i32 0, i32 0), i64* %68, i32 0, i32 0, i32* %j2)
  %70 = load i64, i64* %68, align 4
  %stringFormat_desc10 = alloca %string_descriptor, align 8
  %71 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0
  store i8* %69, i8** %71, align 8
  %72 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1
  store i64 %70, i64* %72, align 4
  %73 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 0
  %74 = load i8*, i8** %73, align 8
  %75 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc10, i32 0, i32 1
  %76 = load i64, i64* %75, align 4
  %77 = trunc i64 %76 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %74, i32 %77, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1)
  call void @_lfortran_free(i8* %69)
  store i32 0, i32* %j2, align 4
  store i32 0, i32* %i1, align 4
  br label %a.head

a.head:                                           ; preds = %ifcont13, %ifcont9
  %78 = load i32, i32* %i1, align 4
  %79 = add i32 %78, 1
  %80 = icmp sle i32 %79, 10
  br i1 %80, label %a.body, label %a.end

a.body:                                           ; preds = %a.head
  %81 = load i32, i32* %i1, align 4
  %82 = add i32 %81, 1
  store i32 %82, i32* %i1, align 4
  %83 = load i32, i32* %j2, align 4
  %84 = load i32, i32* %i1, align 4
  %85 = add i32 %83, %84
  store i32 %85, i32* %j2, align 4
  %86 = load i32, i32* %i1, align 4
  %87 = icmp eq i32 %86, 2
  br i1 %87, label %then11, label %else12

then11:                                           ; preds = %a.body
  br label %a.end

unreachable_after_exit:                           ; No predecessors!
  br label %ifcont13

else12:                                           ; preds = %a.body
  br label %ifcont13

ifcont13:                                         ; preds = %else12, %unreachable_after_exit
  br label %a.head

a.end:                                            ; preds = %then11, %a.head
  %88 = load i32, i32* %j2, align 4
  %89 = icmp ne i32 %88, 3
  br i1 %89, label %then14, label %else15

then14:                                           ; preds = %a.end
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @9, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @8, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont16

else15:                                           ; preds = %a.end
  br label %ifcont16

ifcont16:                                         ; preds = %else15, %then14
  store i32 0, i32* %j2, align 4
  store i32 -1, i32* %i1, align 4
  br label %b.head

b.head:                                           ; preds = %ifcont20, %ifcont16
  %90 = load i32, i32* %i1, align 4
  %91 = add i32 %90, 2
  %92 = icmp sle i32 %91, 10
  br i1 %92, label %b.body, label %b.end

b.body:                                           ; preds = %b.head
  %93 = load i32, i32* %i1, align 4
  %94 = add i32 %93, 2
  store i32 %94, i32* %i1, align 4
  %95 = load i32, i32* %j2, align 4
  %96 = load i32, i32* %i1, align 4
  %97 = add i32 %95, %96
  store i32 %97, i32* %j2, align 4
  %98 = load i32, i32* %i1, align 4
  %99 = icmp eq i32 %98, 3
  br i1 %99, label %then17, label %else19

then17:                                           ; preds = %b.body
  br label %b.end

unreachable_after_exit18:                         ; No predecessors!
  br label %ifcont20

else19:                                           ; preds = %b.body
  br label %ifcont20

ifcont20:                                         ; preds = %else19, %unreachable_after_exit18
  br label %b.head

b.end:                                            ; preds = %then17, %b.head
  %100 = load i32, i32* %j2, align 4
  %101 = icmp ne i32 %100, 4
  br i1 %101, label %then21, label %else22

then21:                                           ; preds = %b.end
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @11, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @10, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont23

else22:                                           ; preds = %b.end
  br label %ifcont23

ifcont23:                                         ; preds = %else22, %then21
  store i32 0, i32* %j2, align 4
  store i32 1, i32* %i1, align 4
  br label %c.head

c.head:                                           ; preds = %ifcont27, %ifcont23
  br i1 true, label %c.body, label %c.end

c.body:                                           ; preds = %c.head
  %102 = load i32, i32* %j2, align 4
  %103 = load i32, i32* %i1, align 4
  %104 = add i32 %102, %103
  store i32 %104, i32* %j2, align 4
  %105 = load i32, i32* %i1, align 4
  %106 = icmp eq i32 %105, 2
  br i1 %106, label %then24, label %else26

then24:                                           ; preds = %c.body
  br label %c.end

unreachable_after_exit25:                         ; No predecessors!
  br label %ifcont27

else26:                                           ; preds = %c.body
  br label %ifcont27

ifcont27:                                         ; preds = %else26, %unreachable_after_exit25
  %107 = load i32, i32* %i1, align 4
  %108 = add i32 %107, 1
  store i32 %108, i32* %i1, align 4
  br label %c.head

c.end:                                            ; preds = %then24, %c.head
  %109 = load i32, i32* %j2, align 4
  %110 = icmp ne i32 %109, 3
  br i1 %110, label %then28, label %else29

then28:                                           ; preds = %c.end
  call void (i8*, ...) @_lcompilers_print_error(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @13, i32 0, i32 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @"ERROR STOP", i32 0, i32 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @12, i32 0, i32 0))
  call void @exit(i32 1)
  br label %ifcont30

else29:                                           ; preds = %c.end
  br label %ifcont30

ifcont30:                                         ; preds = %else29, %then28
  store i32 2, i32* %k3, align 4
  %111 = load i32, i32* %k3, align 4
  %112 = sub i32 1, %111
  store i32 %112, i32* %i1, align 4
  br label %loop.head31

loop.head31:                                      ; preds = %goto_target, %ifcont30
  %113 = load i32, i32* %k3, align 4
  %114 = icmp sgt i32 %113, 0
  %115 = load i32, i32* %i1, align 4
  %116 = load i32, i32* %k3, align 4
  %117 = add i32 %115, %116
  %118 = icmp sle i32 %117, 10
  %119 = icmp eq i1 %114, false
  %120 = select i1 %119, i1 %114, i1 %118
  %121 = load i32, i32* %k3, align 4
  %122 = icmp sle i32 %121, 0
  %123 = load i32, i32* %i1, align 4
  %124 = load i32, i32* %k3, align 4
  %125 = add i32 %123, %124
  %126 = icmp sge i32 %125, 10
  %127 = icmp eq i1 %122, false
  %128 = select i1 %127, i1 %122, i1 %126
  %129 = icmp eq i1 %120, false
  %130 = select i1 %129, i1 %128, i1 %120
  br i1 %130, label %loop.body32, label %loop.end33

loop.body32:                                      ; preds = %loop.head31
  %131 = load i32, i32* %i1, align 4
  %132 = load i32, i32* %k3, align 4
  %133 = add i32 %131, %132
  store i32 %133, i32* %i1, align 4
  br label %goto_target

goto_target:                                      ; preds = %loop.body32
  br label %loop.head31

loop.end33:                                       ; preds = %loop.head31
  call void @_lpython_free_argv()
  br label %return

return:                                           ; preds = %loop.end33
  ret i32 0
}

declare void @_lpython_call_initial_functions(i32, i8**)

declare void @_lcompilers_print_error(i8*, ...)

declare void @exit(i32)

declare i8* @_lcompilers_string_format_fortran(i8*, i64, i8*, i64*, i32, i32, ...)

declare void @_lfortran_printf(i8*, i8*, i32, i8*, i32)

declare void @_lfortran_free(i8*)

declare void @_lpython_free_argv()