Files
llgo/compiler/cl/_testrt/freevars/out.ll

91 lines
4.6 KiB
LLVM
Raw Normal View History

; ModuleID = 'github.com/goplus/llgo/compiler/cl/_testrt/freevars'
source_filename = "github.com/goplus/llgo/compiler/cl/_testrt/freevars"
2024-09-06 15:45:49 +08:00
%"github.com/goplus/llgo/runtime/internal/runtime.iface" = type { ptr, ptr }
%"github.com/goplus/llgo/runtime/internal/runtime.eface" = type { ptr, ptr }
2024-09-06 15:45:49 +08:00
@"github.com/goplus/llgo/compiler/cl/_testrt/freevars.init$guard" = global i1 false, align 1
2024-09-06 15:45:49 +08:00
define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.init"() {
2024-09-06 15:45:49 +08:00
_llgo_0:
%0 = load i1, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.init$guard", align 1
2024-09-06 15:45:49 +08:00
br i1 %0, label %_llgo_2, label %_llgo_1
_llgo_1: ; preds = %_llgo_0
store i1 true, ptr @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.init$guard", align 1
2024-09-06 15:45:49 +08:00
br label %_llgo_2
_llgo_2: ; preds = %_llgo_1, %_llgo_0
ret void
}
define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main"() {
2024-09-06 15:45:49 +08:00
_llgo_0:
call void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$1"({ ptr, ptr } { ptr @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$2", ptr null })
ret void
2024-09-06 15:45:49 +08:00
}
define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$1"({ ptr, ptr } %0) {
2024-09-06 15:45:49 +08:00
_llgo_0:
%1 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64 16)
2024-09-06 15:45:49 +08:00
store { ptr, ptr } %0, ptr %1, align 8
%2 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64 8)
2024-09-06 15:45:49 +08:00
%3 = getelementptr inbounds { ptr }, ptr %2, i32 0, i32 0
store ptr %1, ptr %3, align 8
%4 = insertvalue { ptr, ptr } { ptr @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$1$1", ptr undef }, ptr %2, 1
%5 = extractvalue { ptr, ptr } %4, 1
%6 = extractvalue { ptr, ptr } %4, 0
call void %6(ptr %5, %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer)
2024-09-06 15:45:49 +08:00
ret void
}
define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$1$1"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) {
2024-09-06 15:45:49 +08:00
_llgo_0:
%2 = load { ptr }, ptr %0, align 8
%3 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %1)
%4 = extractvalue %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1, 1
%5 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %3, 0
%6 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %5, ptr %4, 1
%7 = call ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer)
%8 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" undef, ptr %7, 0
%9 = insertvalue %"github.com/goplus/llgo/runtime/internal/runtime.eface" %8, ptr null, 1
%10 = call i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface" %6, %"github.com/goplus/llgo/runtime/internal/runtime.eface" %9)
%11 = xor i1 %10, true
br i1 %11, label %_llgo_1, label %_llgo_2
2024-09-06 15:45:49 +08:00
_llgo_1: ; preds = %_llgo_0
%12 = extractvalue { ptr } %2, 0
%13 = load { ptr, ptr }, ptr %12, align 8
%14 = extractvalue { ptr, ptr } %13, 1
%15 = extractvalue { ptr, ptr } %13, 0
call void %15(ptr %14, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1)
ret void
_llgo_2: ; preds = %_llgo_0
2024-09-06 15:45:49 +08:00
%16 = extractvalue { ptr } %2, 0
%17 = load { ptr, ptr }, ptr %16, align 8
%18 = extractvalue { ptr, ptr } %17, 1
%19 = extractvalue { ptr, ptr } %17, 0
call void %19(ptr %18, %"github.com/goplus/llgo/runtime/internal/runtime.iface" zeroinitializer)
2024-09-06 15:45:49 +08:00
ret void
}
define void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$2"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %0) {
2024-09-06 15:45:49 +08:00
_llgo_0:
ret void
}
define linkonce void @"__llgo_stub.github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$2"(ptr %0, %"github.com/goplus/llgo/runtime/internal/runtime.iface" %1) {
2024-09-06 15:45:49 +08:00
_llgo_0:
tail call void @"github.com/goplus/llgo/compiler/cl/_testrt/freevars.main$2"(%"github.com/goplus/llgo/runtime/internal/runtime.iface" %1)
2024-09-06 15:45:49 +08:00
ret void
}
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocZ"(i64)
2024-09-06 15:45:49 +08:00
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.AllocU"(i64)
2024-09-06 15:45:49 +08:00
declare i1 @"github.com/goplus/llgo/runtime/internal/runtime.EfaceEqual"(%"github.com/goplus/llgo/runtime/internal/runtime.eface", %"github.com/goplus/llgo/runtime/internal/runtime.eface")
2024-09-06 15:45:49 +08:00
declare ptr @"github.com/goplus/llgo/runtime/internal/runtime.IfaceType"(%"github.com/goplus/llgo/runtime/internal/runtime.iface")