ssa: fix abiType & abiNamedOf

This commit is contained in:
visualfc
2024-06-25 12:11:51 +08:00
parent f41511047e
commit ef3619350d
10 changed files with 7115 additions and 885 deletions

View File

@@ -6,6 +6,7 @@ source_filename = "main"
%"github.com/goplus/llgo/internal/abi.Type" = type { i64, i64, i32, i8, i8, i8, i8, { ptr, ptr }, ptr, %"github.com/goplus/llgo/internal/runtime.String", ptr }
@"main.init$guard" = global i1 false, align 1
@_llgo_int8 = linkonce global ptr null, align 8
@"*_llgo_int8" = linkonce global ptr null, align 8
@0 = private unnamed_addr constant [21 x i8] c"type assertion failed", align 1
@_llgo_string = linkonce global ptr null, align 8
@@ -121,48 +122,62 @@ _llgo_0:
define void @"main.init$after"() {
_llgo_0:
%0 = load ptr, ptr @"*_llgo_int8", align 8
%0 = load ptr, ptr @_llgo_int8, align 8
%1 = icmp eq ptr %0, null
br i1 %1, label %_llgo_1, label %_llgo_2
_llgo_1: ; preds = %_llgo_0
%2 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 3)
%3 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %2)
store ptr %3, ptr @"*_llgo_int8", align 8
%3 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Type", ptr %2, i32 0, i32 6
%4 = load i8, ptr %3, align 1
%5 = or i8 %4, 32
store i8 %5, ptr %3, align 1
store ptr %2, ptr @_llgo_int8, align 8
br label %_llgo_2
_llgo_2: ; preds = %_llgo_1, %_llgo_0
%4 = load ptr, ptr @_llgo_string, align 8
%5 = icmp eq ptr %4, null
br i1 %5, label %_llgo_3, label %_llgo_4
%6 = load ptr, ptr @"*_llgo_int8", align 8
%7 = icmp eq ptr %6, null
br i1 %7, label %_llgo_3, label %_llgo_4
_llgo_3: ; preds = %_llgo_2
%6 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
store ptr %6, ptr @_llgo_string, align 8
%8 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 3)
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr %8)
store ptr %9, ptr @"*_llgo_int8", align 8
br label %_llgo_4
_llgo_4: ; preds = %_llgo_3, %_llgo_2
%7 = load ptr, ptr @_llgo_int, align 8
%8 = icmp eq ptr %7, null
br i1 %8, label %_llgo_5, label %_llgo_6
%10 = load ptr, ptr @_llgo_string, align 8
%11 = icmp eq ptr %10, null
br i1 %11, label %_llgo_5, label %_llgo_6
_llgo_5: ; preds = %_llgo_4
%9 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%10 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Type", ptr %9, i32 0, i32 6
%11 = load i8, ptr %10, align 1
%12 = or i8 %11, 32
store i8 %12, ptr %10, align 1
store ptr %9, ptr @_llgo_int, align 8
%12 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 24)
store ptr %12, ptr @_llgo_string, align 8
br label %_llgo_6
_llgo_6: ; preds = %_llgo_5, %_llgo_4
%13 = load ptr, ptr @_llgo_int, align 8
%14 = icmp eq ptr %13, null
br i1 %14, label %_llgo_7, label %_llgo_8
_llgo_7: ; preds = %_llgo_6
%15 = call ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64 2)
%16 = getelementptr inbounds %"github.com/goplus/llgo/internal/abi.Type", ptr %15, i32 0, i32 6
%17 = load i8, ptr %16, align 1
%18 = or i8 %17, 32
store i8 %18, ptr %16, align 1
store ptr %15, ptr @_llgo_int, align 8
br label %_llgo_8
_llgo_8: ; preds = %_llgo_7, %_llgo_6
ret void
}
declare ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr)
declare ptr @"github.com/goplus/llgo/internal/runtime.Basic"(i64)
declare ptr @"github.com/goplus/llgo/internal/runtime.PointerTo"(ptr)
declare ptr @"github.com/goplus/llgo/internal/runtime.AllocU"(i64)
declare void @"github.com/goplus/llgo/internal/runtime.Panic"(%"github.com/goplus/llgo/internal/runtime.eface")