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
|
; ModuleID = 'LFortran'
source_filename = "LFortran"
%string_descriptor = type <{ i8*, i64 }>
@0 = private unnamed_addr constant [2 x i8] c"\0A\00", align 1
@serialization_info = private unnamed_addr constant [3 x i8] c"R4\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.1 = private unnamed_addr constant [3 x i8] c"R4\00", align 1
@3 = private unnamed_addr constant [5 x i8] c"%s%s\00", align 1
define float @__module_callback_03_cb(float (float*)* %f, float* %a, float* %b) {
.entry:
%cb = alloca float, align 4
%0 = load float, float* %b, align 4
%1 = load float, float* %a, align 4
%2 = fsub float %0, %1
%3 = call float %f(float* %a)
%4 = fadd float %2, %3
%5 = call float %f(float* %b)
%6 = fadd float %4, %5
store float %6, float* %cb, align 4
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE_cb
FINALIZE_SYMTABLE_cb: ; preds = %return
%7 = load float, float* %cb, align 4
ret float %7
}
declare float @f(float*)
define void @__module_callback_03_foo1(float* %c, float* %d) {
.entry:
%0 = alloca i64, align 8
%1 = call float @__module_callback_03_cb(float (float*)* @foo1.__module_callback_03_f, float* %c, float* %d)
%2 = alloca float, align 4
store float %1, float* %2, align 4
%3 = 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* %0, i32 0, i32 0, float* %2)
%4 = load i64, i64* %0, align 4
%stringFormat_desc = alloca %string_descriptor, align 8
%5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
store i8* %3, i8** %5, align 8
%6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
store i64 %4, i64* %6, align 4
%7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
%8 = load i8*, i8** %7, align 8
%9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
%10 = load i64, i64* %9, align 4
%11 = trunc i64 %10 to i32
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @1, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @0, i32 0, i32 0), i32 1)
call void @_lfortran_free(i8* %3)
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE_foo1
FINALIZE_SYMTABLE_foo1: ; preds = %return
ret void
}
define float @foo1.__module_callback_03_f(float* %x) {
.entry:
%f = alloca float, align 4
%0 = load float, float* %x, align 4
%1 = fmul float 2.000000e+00, %0
store float %1, float* %f, align 4
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE_f
FINALIZE_SYMTABLE_f: ; preds = %return
%2 = load float, float* %f, align 4
ret float %2
}
define void @__module_callback_03_foo2(float* %c, float* %d) {
.entry:
%0 = alloca i64, align 8
%1 = call float @__module_callback_03_cb(float (float*)* @foo2.__module_callback_03_f, float* %c, float* %d)
%2 = alloca float, align 4
store float %1, float* %2, align 4
%3 = 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* %0, i32 0, i32 0, float* %2)
%4 = load i64, i64* %0, align 4
%stringFormat_desc = alloca %string_descriptor, align 8
%5 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
store i8* %3, i8** %5, align 8
%6 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
store i64 %4, i64* %6, align 4
%7 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 0
%8 = load i8*, i8** %7, align 8
%9 = getelementptr %string_descriptor, %string_descriptor* %stringFormat_desc, i32 0, i32 1
%10 = load i64, i64* %9, align 4
%11 = trunc i64 %10 to i32
call void @_lfortran_printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @3, i32 0, i32 0), i8* %8, i32 %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @2, i32 0, i32 0), i32 1)
call void @_lfortran_free(i8* %3)
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE_foo2
FINALIZE_SYMTABLE_foo2: ; preds = %return
ret void
}
define float @foo2.__module_callback_03_f(float* %x) {
.entry:
%f = alloca float, align 4
%0 = load float, float* %x, align 4
%1 = fmul float -2.000000e+00, %0
store float %1, float* %f, align 4
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE_f
FINALIZE_SYMTABLE_f: ; preds = %return
%2 = load float, float* %f, align 4
ret float %2
}
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*)
define i32 @main(i32 %0, i8** %1) {
.entry:
%call_arg_value3 = alloca float, align 4
%call_arg_value2 = alloca float, align 4
%call_arg_value1 = alloca float, align 4
%call_arg_value = alloca float, align 4
call void @_lpython_call_initial_functions(i32 %0, i8** %1)
store float 1.500000e+00, float* %call_arg_value, align 4
store float 2.000000e+00, float* %call_arg_value1, align 4
call void @__module_callback_03_foo1(float* %call_arg_value, float* %call_arg_value1)
store float 1.500000e+00, float* %call_arg_value2, align 4
store float 2.000000e+00, float* %call_arg_value3, align 4
call void @__module_callback_03_foo2(float* %call_arg_value2, float* %call_arg_value3)
call void @_lpython_free_argv()
br label %return
return: ; preds = %.entry
br label %FINALIZE_SYMTABLE_main
FINALIZE_SYMTABLE_main: ; preds = %return
ret i32 0
}
declare void @_lpython_call_initial_functions(i32, i8**)
declare void @_lpython_free_argv()
|