File: llvm-program_03-374e848.stdout

package info (click to toggle)
lfortran 0.60.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 58,412 kB
  • sloc: cpp: 173,406; f90: 80,491; python: 17,586; ansic: 9,610; yacc: 2,356; sh: 1,401; fortran: 895; makefile: 37; javascript: 15
file content (114 lines) | stat: -rw-r--r-- 4,302 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
; ModuleID = 'LFortran'
source_filename = "LFortran"

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

@__module___lcompilers_created__nested_context__closuretest__z = global i32 0
@0 = 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
@1 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1

define i32 @main(i32 %0, i8** %1) {
.entry:
  %call_arg_value = alloca i32, align 4
  call void @_lpython_call_initial_functions(i32 %0, i8** %1)
  %z = alloca i32, align 4
  store i32 0, i32* %z, align 4
  br label %loop.head

loop.head:                                        ; preds = %free_done, %.entry
  %2 = load i32, i32* %z, align 4
  %3 = add i32 %2, 1
  %4 = icmp sle i32 %3, 10
  br i1 %4, label %loop.body, label %loop.end

loop.body:                                        ; preds = %loop.head
  %5 = load i32, i32* %z, align 4
  %6 = add i32 %5, 1
  store i32 %6, i32* %z, align 4
  %7 = load i32, i32* %z, align 4
  store i32 %7, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4
  %8 = alloca i64, align 8
  store i32 1, i32* %call_arg_value, align 4
  %9 = call i32 @apply(i32 (i32*)* @add_z, i32* %call_arg_value)
  %10 = alloca i32, align 4
  store i32 %9, i32* %10, align 4
  %11 = 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* %8, i32 0, i32 0, i32* %10)
  %12 = load i64, i64* %8, align 4
  %stringFormat_desc = alloca %string_descriptor, align 8
  %13 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  store i8* %11, i8** %13, align 8
  %14 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  store i64 %12, i64* %14, align 4
  %15 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
  %16 = load i8*, i8** %15, align 8
  %17 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
  %18 = load i64, i64* %17, align 4
  %19 = trunc i64 %18 to i32
  call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %16, i32 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
  %20 = icmp eq i8* %11, null
  br i1 %20, label %free_done, label %free_nonnull

free_nonnull:                                     ; preds = %loop.body
  call void @_lfortran_free(i8* %11)
  br label %free_done

free_done:                                        ; preds = %free_nonnull, %loop.body
  %21 = load i32, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4
  store i32 %21, i32* %z, align 4
  br label %loop.head

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

return:                                           ; preds = %loop.end
  br label %FINALIZE_SYMTABLE_closuretest

FINALIZE_SYMTABLE_closuretest:                    ; preds = %return
  ret i32 0
}

define i32 @add_z(i32* %x) {
.entry:
  %y = alloca i32, align 4
  %0 = load i32, i32* %x, align 4
  %1 = load i32, i32* @__module___lcompilers_created__nested_context__closuretest__z, align 4
  %2 = add i32 %0, %1
  store i32 %2, i32* %y, align 4
  br label %return

return:                                           ; preds = %.entry
  br label %FINALIZE_SYMTABLE_add_z

FINALIZE_SYMTABLE_add_z:                          ; preds = %return
  %3 = load i32, i32* %y, align 4
  ret i32 %3
}

define i32 @apply(i32 (i32*)* %fun, i32* %x) {
.entry:
  %y = alloca i32, align 4
  %0 = call i32 %fun(i32* %x)
  store i32 %0, i32* %y, align 4
  br label %return

return:                                           ; preds = %.entry
  br label %FINALIZE_SYMTABLE_apply

FINALIZE_SYMTABLE_apply:                          ; preds = %return
  %1 = load i32, i32* %y, align 4
  ret i32 %1
}

declare i32 @fun(i32*)

declare void @_lpython_call_initial_functions(i32, i8**)

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