github.com/goplus/llgo@v0.8.3/cl/_testpy/matrix/out.ll (about) 1 ; ModuleID = 'main' 2 source_filename = "main" 3 4 @"main.init$guard" = global ptr null 5 @__llgo_argc = global ptr null 6 @__llgo_argv = global ptr null 7 @__llgo_py.numpy.add = linkonce global ptr null 8 @0 = private unnamed_addr constant [8 x i8] c"a = %s\0A\00", align 1 9 @1 = private unnamed_addr constant [8 x i8] c"a = %s\0A\00", align 1 10 @2 = private unnamed_addr constant [10 x i8] c"a+b = %s\0A\00", align 1 11 @__llgo_py.numpy = external global ptr 12 @3 = private unnamed_addr constant [4 x i8] c"add\00", align 1 13 14 define void @main.init() { 15 _llgo_0: 16 %0 = load i1, ptr @"main.init$guard", align 1 17 br i1 %0, label %_llgo_2, label %_llgo_1 18 19 _llgo_1: ; preds = %_llgo_0 20 store i1 true, ptr @"main.init$guard", align 1 21 call void @"github.com/goplus/llgo/py/numpy.init"() 22 %1 = load ptr, ptr @__llgo_py.numpy, align 8 23 call void (ptr, ...) @llgoLoadPyModSyms(ptr %1, ptr @3, ptr @__llgo_py.numpy.add, ptr null) 24 br label %_llgo_2 25 26 _llgo_2: ; preds = %_llgo_1, %_llgo_0 27 ret void 28 } 29 30 define i32 @main(i32 %0, ptr %1) { 31 _llgo_0: 32 call void @Py_Initialize() 33 store i32 %0, ptr @__llgo_argc, align 4 34 store ptr %1, ptr @__llgo_argv, align 8 35 call void @"github.com/goplus/llgo/internal/runtime.init"() 36 call void @main.init() 37 %2 = call ptr @PyList_New(i64 3) 38 %3 = call ptr @PyFloat_FromDouble(double 1.000000e+00) 39 %4 = call i32 @PyList_SetItem(ptr %2, i64 0, ptr %3) 40 %5 = call ptr @PyFloat_FromDouble(double 2.000000e+00) 41 %6 = call i32 @PyList_SetItem(ptr %2, i64 1, ptr %5) 42 %7 = call ptr @PyFloat_FromDouble(double 3.000000e+00) 43 %8 = call i32 @PyList_SetItem(ptr %2, i64 2, ptr %7) 44 %9 = call ptr @PyList_New(i64 3) 45 %10 = call ptr @PyFloat_FromDouble(double 4.000000e+00) 46 %11 = call i32 @PyList_SetItem(ptr %9, i64 0, ptr %10) 47 %12 = call ptr @PyFloat_FromDouble(double 5.000000e+00) 48 %13 = call i32 @PyList_SetItem(ptr %9, i64 1, ptr %12) 49 %14 = call ptr @PyFloat_FromDouble(double 6.000000e+00) 50 %15 = call i32 @PyList_SetItem(ptr %9, i64 2, ptr %14) 51 %16 = call ptr @PyList_New(i64 3) 52 %17 = call ptr @PyFloat_FromDouble(double 7.000000e+00) 53 %18 = call i32 @PyList_SetItem(ptr %16, i64 0, ptr %17) 54 %19 = call ptr @PyFloat_FromDouble(double 8.000000e+00) 55 %20 = call i32 @PyList_SetItem(ptr %16, i64 1, ptr %19) 56 %21 = call ptr @PyFloat_FromDouble(double 9.000000e+00) 57 %22 = call i32 @PyList_SetItem(ptr %16, i64 2, ptr %21) 58 %23 = call ptr @PyList_New(i64 3) 59 %24 = call i32 @PyList_SetItem(ptr %23, i64 0, ptr %2) 60 %25 = call i32 @PyList_SetItem(ptr %23, i64 1, ptr %9) 61 %26 = call i32 @PyList_SetItem(ptr %23, i64 2, ptr %16) 62 %27 = call ptr @PyList_New(i64 3) 63 %28 = call ptr @PyFloat_FromDouble(double 9.000000e+00) 64 %29 = call i32 @PyList_SetItem(ptr %27, i64 0, ptr %28) 65 %30 = call ptr @PyFloat_FromDouble(double 8.000000e+00) 66 %31 = call i32 @PyList_SetItem(ptr %27, i64 1, ptr %30) 67 %32 = call ptr @PyFloat_FromDouble(double 7.000000e+00) 68 %33 = call i32 @PyList_SetItem(ptr %27, i64 2, ptr %32) 69 %34 = call ptr @PyList_New(i64 3) 70 %35 = call ptr @PyFloat_FromDouble(double 6.000000e+00) 71 %36 = call i32 @PyList_SetItem(ptr %34, i64 0, ptr %35) 72 %37 = call ptr @PyFloat_FromDouble(double 5.000000e+00) 73 %38 = call i32 @PyList_SetItem(ptr %34, i64 1, ptr %37) 74 %39 = call ptr @PyFloat_FromDouble(double 4.000000e+00) 75 %40 = call i32 @PyList_SetItem(ptr %34, i64 2, ptr %39) 76 %41 = call ptr @PyList_New(i64 3) 77 %42 = call ptr @PyFloat_FromDouble(double 3.000000e+00) 78 %43 = call i32 @PyList_SetItem(ptr %41, i64 0, ptr %42) 79 %44 = call ptr @PyFloat_FromDouble(double 2.000000e+00) 80 %45 = call i32 @PyList_SetItem(ptr %41, i64 1, ptr %44) 81 %46 = call ptr @PyFloat_FromDouble(double 1.000000e+00) 82 %47 = call i32 @PyList_SetItem(ptr %41, i64 2, ptr %46) 83 %48 = call ptr @PyList_New(i64 3) 84 %49 = call i32 @PyList_SetItem(ptr %48, i64 0, ptr %27) 85 %50 = call i32 @PyList_SetItem(ptr %48, i64 1, ptr %34) 86 %51 = call i32 @PyList_SetItem(ptr %48, i64 2, ptr %41) 87 %52 = load ptr, ptr @__llgo_py.numpy.add, align 8 88 %53 = call ptr (ptr, ...) @PyObject_CallFunctionObjArgs(ptr %52, ptr %23, ptr %48, ptr null) 89 %54 = call ptr @PyObject_Str(ptr %23) 90 %55 = call ptr @PyUnicode_AsUTF8(ptr %54) 91 %56 = call i32 (ptr, ...) @printf(ptr @0, ptr %55) 92 %57 = call ptr @PyObject_Str(ptr %48) 93 %58 = call ptr @PyUnicode_AsUTF8(ptr %57) 94 %59 = call i32 (ptr, ...) @printf(ptr @1, ptr %58) 95 %60 = call ptr @PyObject_Str(ptr %53) 96 %61 = call ptr @PyUnicode_AsUTF8(ptr %60) 97 %62 = call i32 (ptr, ...) @printf(ptr @2, ptr %61) 98 ret i32 0 99 } 100 101 declare void @"github.com/goplus/llgo/py/numpy.init"() 102 103 declare void @"github.com/goplus/llgo/internal/runtime.init"() 104 105 declare ptr @PyList_New(i64) 106 107 declare ptr @PyFloat_FromDouble(double) 108 109 declare i32 @PyList_SetItem(ptr, i64, ptr) 110 111 declare ptr @PyObject_CallFunctionObjArgs(ptr, ...) 112 113 declare ptr @PyObject_Str(ptr) 114 115 declare ptr @PyUnicode_AsUTF8(ptr) 116 117 declare i32 @printf(ptr, ...) 118 119 declare void @llgoLoadPyModSyms(ptr, ...) 120 121 declare void @Py_Initialize()