File: llvm-doloop_04-e25bf76.stdout

package info (click to toggle)
lfortran 0.61.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 61,892 kB
  • sloc: cpp: 181,767; f90: 92,175; python: 17,616; ansic: 10,170; yacc: 2,377; sh: 1,444; fortran: 892; makefile: 38; javascript: 15
file content (390 lines) | stat: -rw-r--r-- 15,920 bytes parent folder | download | duplicates (2)
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
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
; 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:
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %__do_loop_inc = alloca i32, align 4
  %__do_loop_inc1 = alloca i32, align 4
  %__do_loop_inc2 = alloca i32, align 4
  %i = alloca i32, align 4
  %j = alloca i32, align 4
  %k = alloca i32, align 4
  store i32 0, i32* %j, align 4
  store i32 2, i32* %k, align 4
  %2 = load i32, i32* %k, align 4
  store i32 %2, i32* %__do_loop_inc, align 4
  %3 = load i32, i32* %__do_loop_inc, align 4
  %4 = sub i32 1, %3
  store i32 %4, i32* %i, align 4
  br label %loop.head

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

loop.body:                                        ; preds = %loop.head
  %23 = load i32, i32* %i, align 4
  %24 = load i32, i32* %__do_loop_inc, align 4
  %25 = add i32 %23, %24
  store i32 %25, i32* %i, align 4
  %26 = load i32, i32* %j, align 4
  %27 = load i32, i32* %i, align 4
  %28 = add i32 %26, %27
  store i32 %28, i32* %j, align 4
  br label %loop.head

loop.end:                                         ; preds = %loop.head
  %29 = load i32, i32* %j, align 4
  %30 = icmp ne i32 %29, 25
  br i1 %30, 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
  %31 = alloca i64, align 8
  %32 = 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* %31, i32 0, i32 0, i32* %j)
  %33 = load i64, i64* %31, align 4
  %stringFormat_desc = alloca %string_descriptor, align 8
  %34 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %32, i8** %34, align 8
  %35 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %33, i64* %35, align 4
  %36 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %37 = load i8*, i8** %36, align 8
  %38 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %39 = load i64, i64* %38, align 4
  %40 = trunc i64 %39 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %37, i32 %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
  %41 = icmp eq i8* %32, null
  br i1 %41, label %free_done, label %free_nonnull

free_nonnull:                                     ; preds = %ifcont
  call void @_lfortran_free(i8* %32)
  br label %free_done

free_done:                                        ; preds = %free_nonnull, %ifcont
  store i32 0, i32* %j, align 4
  store i32 -2, i32* %k, align 4
  %42 = load i32, i32* %k, align 4
  store i32 %42, i32* %__do_loop_inc1, align 4
  %43 = load i32, i32* %__do_loop_inc1, align 4
  %44 = sub i32 10, %43
  store i32 %44, i32* %i, align 4
  br label %loop.head1

loop.head1:                                       ; preds = %loop.body2, %free_done
  %45 = load i32, i32* %__do_loop_inc1, align 4
  %46 = icmp sgt i32 %45, 0
  %47 = load i32, i32* %i, align 4
  %48 = load i32, i32* %__do_loop_inc1, align 4
  %49 = add i32 %47, %48
  %50 = icmp sle i32 %49, 1
  %51 = icmp eq i1 %46, false
  %52 = select i1 %51, i1 %46, i1 %50
  %53 = load i32, i32* %__do_loop_inc1, align 4
  %54 = icmp sle i32 %53, 0
  %55 = load i32, i32* %i, align 4
  %56 = load i32, i32* %__do_loop_inc1, align 4
  %57 = add i32 %55, %56
  %58 = icmp sge i32 %57, 1
  %59 = icmp eq i1 %54, false
  %60 = select i1 %59, i1 %54, i1 %58
  %61 = icmp eq i1 %52, false
  %62 = select i1 %61, i1 %60, i1 %52
  br i1 %62, label %loop.body2, label %loop.end3

loop.body2:                                       ; preds = %loop.head1
  %63 = load i32, i32* %i, align 4
  %64 = load i32, i32* %__do_loop_inc1, align 4
  %65 = add i32 %63, %64
  store i32 %65, i32* %i, align 4
  %66 = load i32, i32* %j, align 4
  %67 = load i32, i32* %i, align 4
  %68 = add i32 %66, %67
  store i32 %68, i32* %j, align 4
  br label %loop.head1

loop.end3:                                        ; preds = %loop.head1
  %69 = load i32, i32* %j, align 4
  %70 = icmp ne i32 %69, 30
  br i1 %70, label %then4, label %else5

then4:                                            ; preds = %loop.end3
  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 %ifcont6

else5:                                            ; preds = %loop.end3
  br label %ifcont6

ifcont6:                                          ; preds = %else5, %then4
  %71 = alloca i64, align 8
  %72 = 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* %71, i32 0, i32 0, i32* %j)
  %73 = load i64, i64* %71, align 4
  %stringFormat_desc7 = alloca %string_descriptor, align 8
  %74 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0
  store i8* %72, i8** %74, align 8
  %75 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1
  store i64 %73, i64* %75, align 4
  %76 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 0
  %77 = load i8*, i8** %76, align 8
  %78 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc7, i32 0, i32 1
  %79 = load i64, i64* %78, align 4
  %80 = trunc i64 %79 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @7, i32 0, i32 0), i8* %77, i32 %80, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @6, i32 0, i32 0), i32 1)
  %81 = icmp eq i8* %72, null
  br i1 %81, label %free_done9, label %free_nonnull8

free_nonnull8:                                    ; preds = %ifcont6
  call void @_lfortran_free(i8* %72)
  br label %free_done9

free_done9:                                       ; preds = %free_nonnull8, %ifcont6
  store i32 0, i32* %j, align 4
  store i32 0, i32* %i, align 4
  br label %a.head

a.head:                                           ; preds = %ifcont12, %free_done9
  %82 = load i32, i32* %i, align 4
  %83 = add i32 %82, 1
  %84 = icmp sle i32 %83, 10
  br i1 %84, label %a.body, label %a.end

a.body:                                           ; preds = %a.head
  %85 = load i32, i32* %i, align 4
  %86 = add i32 %85, 1
  store i32 %86, i32* %i, align 4
  %87 = load i32, i32* %j, align 4
  %88 = load i32, i32* %i, align 4
  %89 = add i32 %87, %88
  store i32 %89, i32* %j, align 4
  %90 = load i32, i32* %i, align 4
  %91 = icmp eq i32 %90, 2
  br i1 %91, label %then10, label %else11

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

unreachable_after_exit:                           ; No predecessors!
  br label %ifcont12

else11:                                           ; preds = %a.body
  br label %ifcont12

ifcont12:                                         ; preds = %else11, %unreachable_after_exit
  br label %a.head

a.end:                                            ; preds = %then10, %a.head
  %92 = load i32, i32* %j, align 4
  %93 = icmp ne i32 %92, 3
  br i1 %93, label %then13, label %else14

then13:                                           ; 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 %ifcont15

else14:                                           ; preds = %a.end
  br label %ifcont15

ifcont15:                                         ; preds = %else14, %then13
  store i32 0, i32* %j, align 4
  store i32 -1, i32* %i, align 4
  br label %b.head

b.head:                                           ; preds = %ifcont19, %ifcont15
  %94 = load i32, i32* %i, align 4
  %95 = add i32 %94, 2
  %96 = icmp sle i32 %95, 10
  br i1 %96, label %b.body, label %b.end

b.body:                                           ; preds = %b.head
  %97 = load i32, i32* %i, align 4
  %98 = add i32 %97, 2
  store i32 %98, i32* %i, align 4
  %99 = load i32, i32* %j, align 4
  %100 = load i32, i32* %i, align 4
  %101 = add i32 %99, %100
  store i32 %101, i32* %j, align 4
  %102 = load i32, i32* %i, align 4
  %103 = icmp eq i32 %102, 3
  br i1 %103, label %then16, label %else18

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

unreachable_after_exit17:                         ; No predecessors!
  br label %ifcont19

else18:                                           ; preds = %b.body
  br label %ifcont19

ifcont19:                                         ; preds = %else18, %unreachable_after_exit17
  br label %b.head

b.end:                                            ; preds = %then16, %b.head
  %104 = load i32, i32* %j, align 4
  %105 = icmp ne i32 %104, 4
  br i1 %105, label %then20, label %else21

then20:                                           ; 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 %ifcont22

else21:                                           ; preds = %b.end
  br label %ifcont22

ifcont22:                                         ; preds = %else21, %then20
  store i32 0, i32* %j, align 4
  store i32 1, i32* %i, align 4
  br label %c.head

c.head:                                           ; preds = %ifcont26, %ifcont22
  br i1 true, label %c.body, label %c.end

c.body:                                           ; preds = %c.head
  %106 = load i32, i32* %j, align 4
  %107 = load i32, i32* %i, align 4
  %108 = add i32 %106, %107
  store i32 %108, i32* %j, align 4
  %109 = load i32, i32* %i, align 4
  %110 = icmp eq i32 %109, 2
  br i1 %110, label %then23, label %else25

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

unreachable_after_exit24:                         ; No predecessors!
  br label %ifcont26

else25:                                           ; preds = %c.body
  br label %ifcont26

ifcont26:                                         ; preds = %else25, %unreachable_after_exit24
  %111 = load i32, i32* %i, align 4
  %112 = add i32 %111, 1
  store i32 %112, i32* %i, align 4
  br label %c.head

c.end:                                            ; preds = %then23, %c.head
  %113 = load i32, i32* %j, align 4
  %114 = icmp ne i32 %113, 3
  br i1 %114, label %then27, label %else28

then27:                                           ; 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 %ifcont29

else28:                                           ; preds = %c.end
  br label %ifcont29

ifcont29:                                         ; preds = %else28, %then27
  store i32 2, i32* %k, align 4
  %115 = load i32, i32* %k, align 4
  store i32 %115, i32* %__do_loop_inc2, align 4
  %116 = load i32, i32* %__do_loop_inc2, align 4
  %117 = sub i32 1, %116
  store i32 %117, i32* %i, align 4
  br label %loop.head30

loop.head30:                                      ; preds = %goto_target, %ifcont29
  %118 = load i32, i32* %__do_loop_inc2, align 4
  %119 = icmp sgt i32 %118, 0
  %120 = load i32, i32* %i, align 4
  %121 = load i32, i32* %__do_loop_inc2, align 4
  %122 = add i32 %120, %121
  %123 = icmp sle i32 %122, 10
  %124 = icmp eq i1 %119, false
  %125 = select i1 %124, i1 %119, i1 %123
  %126 = load i32, i32* %__do_loop_inc2, align 4
  %127 = icmp sle i32 %126, 0
  %128 = load i32, i32* %i, align 4
  %129 = load i32, i32* %__do_loop_inc2, align 4
  %130 = add i32 %128, %129
  %131 = icmp sge i32 %130, 10
  %132 = icmp eq i1 %127, false
  %133 = select i1 %132, i1 %127, i1 %131
  %134 = icmp eq i1 %125, false
  %135 = select i1 %134, i1 %133, i1 %125
  br i1 %135, label %loop.body31, label %loop.end32

loop.body31:                                      ; preds = %loop.head30
  %136 = load i32, i32* %i, align 4
  %137 = load i32, i32* %__do_loop_inc2, align 4
  %138 = add i32 %136, %137
  store i32 %138, i32* %i, align 4
  br label %goto_target

goto_target:                                      ; preds = %loop.body31
  br label %loop.head30

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

return:                                           ; preds = %loop.end32
  br label %FINALIZE_SYMTABLE_doloop_04

FINALIZE_SYMTABLE_doloop_04:                      ; preds = %return
  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()