diff --git a/crates/compiler/test_mono/generated/call_function_in_empty_list.txt b/crates/compiler/test_mono/generated/call_function_in_empty_list.txt index ac96381481..81cc10159e 100644 --- a/crates/compiler/test_mono/generated/call_function_in_empty_list.txt +++ b/crates/compiler/test_mono/generated/call_function_in_empty_list.txt @@ -1,7 +1,7 @@ procedure List.5 (#Attr.2, #Attr.3): - let List.385 : List {} = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3; + let List.381 : List {} = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3; decref #Attr.2; - ret List.385; + ret List.381; procedure Test.2 (Test.3): let Test.7 : {} = Struct {}; diff --git a/crates/compiler/test_mono/generated/call_function_in_empty_list_unbound.txt b/crates/compiler/test_mono/generated/call_function_in_empty_list_unbound.txt index 8c4c9cb47d..5c345ed6cd 100644 --- a/crates/compiler/test_mono/generated/call_function_in_empty_list_unbound.txt +++ b/crates/compiler/test_mono/generated/call_function_in_empty_list_unbound.txt @@ -1,7 +1,7 @@ procedure List.5 (#Attr.2, #Attr.3): - let List.385 : List [] = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3; + let List.381 : List [] = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.2 #Attr.3; decref #Attr.2; - ret List.385; + ret List.381; procedure Test.2 (Test.3): let Test.7 : {} = Struct {}; diff --git a/crates/compiler/test_mono/generated/closure_in_list.txt b/crates/compiler/test_mono/generated/closure_in_list.txt index 26e9a06eae..edb31caf09 100644 --- a/crates/compiler/test_mono/generated/closure_in_list.txt +++ b/crates/compiler/test_mono/generated/closure_in_list.txt @@ -1,6 +1,6 @@ procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure Test.1 (Test.5): let Test.2 : I64 = 41i64; diff --git a/crates/compiler/test_mono/generated/dict.txt b/crates/compiler/test_mono/generated/dict.txt index 703c5f429d..1052346f47 100644 --- a/crates/compiler/test_mono/generated/dict.txt +++ b/crates/compiler/test_mono/generated/dict.txt @@ -1,14 +1,14 @@ procedure Dict.1 (): - let Dict.102 : List {[], []} = Array []; - ret Dict.102; + let Dict.100 : List {[], []} = Array []; + ret Dict.100; -procedure Dict.7 (Dict.96): - let Dict.101 : U64 = CallByName List.6 Dict.96; - ret Dict.101; +procedure Dict.7 (Dict.94): + let Dict.99 : U64 = CallByName List.6 Dict.94; + ret Dict.99; procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure Test.0 (): let Test.2 : List {[], []} = CallByName Dict.1; diff --git a/crates/compiler/test_mono/generated/empty_list_of_function_type.txt b/crates/compiler/test_mono/generated/empty_list_of_function_type.txt index 70263729b3..5886c61084 100644 --- a/crates/compiler/test_mono/generated/empty_list_of_function_type.txt +++ b/crates/compiler/test_mono/generated/empty_list_of_function_type.txt @@ -1,55 +1,59 @@ +procedure Bool.1 (): + let Bool.11 : Int1 = false; + ret Bool.11; + procedure List.2 (List.90, List.91): - let List.390 : U64 = CallByName List.6 List.90; - let List.387 : Int1 = CallByName Num.22 List.91 List.390; - if List.387 then - let List.389 : {} = CallByName List.66 List.90 List.91; - let List.388 : [C {}, C {}] = TagId(1) List.389; - ret List.388; + let List.387 : U64 = CallByName List.6 List.90; + let List.383 : Int1 = CallByName Num.22 List.91 List.387; + if List.383 then + let List.385 : {} = CallByName List.66 List.90 List.91; + let List.384 : [C {}, C {}] = TagId(1) List.385; + ret List.384; else - let List.386 : {} = Struct {}; - let List.385 : [C {}, C {}] = TagId(0) List.386; - ret List.385; + let List.382 : {} = Struct {}; + let List.381 : [C {}, C {}] = TagId(0) List.382; + ret List.381; procedure List.6 (#Attr.2): - let List.392 : U64 = lowlevel ListLen #Attr.2; - ret List.392; + let List.388 : U64 = lowlevel ListLen #Attr.2; + ret List.388; procedure List.66 (#Attr.2, #Attr.3): - let List.391 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.391; + let List.386 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.386; procedure Num.22 (#Attr.2, #Attr.3): let Num.257 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; ret Num.257; -procedure Test.2 (Test.6): - let Test.18 : Str = "bar"; - ret Test.18; +procedure Test.2 (Test.5): + let Test.17 : Str = "bar"; + ret Test.17; procedure Test.0 (): let Test.1 : List {} = Array []; - joinpoint Test.16 Test.3: - let Test.14 : U64 = 0i64; - let Test.7 : [C {}, C {}] = CallByName List.2 Test.3 Test.14; + joinpoint Test.15 Test.3: + let Test.13 : U64 = 0i64; + let Test.6 : [C {}, C {}] = CallByName List.2 Test.3 Test.13; dec Test.3; - let Test.11 : U8 = 1i64; - let Test.12 : U8 = GetTagId Test.7; - let Test.13 : Int1 = lowlevel Eq Test.11 Test.12; - if Test.13 then - let Test.5 : {} = UnionAtIndex (Id 1) (Index 0) Test.7; - let Test.9 : Str = "foo"; - let Test.8 : Str = CallByName Test.2 Test.9; - dec Test.9; - ret Test.8; + let Test.10 : U8 = 1i64; + let Test.11 : U8 = GetTagId Test.6; + let Test.12 : Int1 = lowlevel Eq Test.10 Test.11; + if Test.12 then + let Test.4 : {} = UnionAtIndex (Id 1) (Index 0) Test.6; + let Test.8 : Str = "foo"; + let Test.7 : Str = CallByName Test.2 Test.8; + dec Test.8; + ret Test.7; else - let Test.10 : Str = "bad!"; - ret Test.10; + let Test.9 : Str = "bad!"; + ret Test.9; in - let Test.19 : Int1 = false; - if Test.19 then - jump Test.16 Test.1; + let Test.18 : Int1 = CallByName Bool.1; + if Test.18 then + jump Test.15 Test.1; else dec Test.1; - let Test.17 : {} = Struct {}; - let Test.15 : List {} = Array [Test.17]; - jump Test.16 Test.15; + let Test.16 : {} = Struct {}; + let Test.14 : List {} = Array [Test.16]; + jump Test.15 Test.14; diff --git a/crates/compiler/test_mono/generated/encode.txt b/crates/compiler/test_mono/generated/encode.txt index 016be573d8..0d4eb1a362 100644 --- a/crates/compiler/test_mono/generated/encode.txt +++ b/crates/compiler/test_mono/generated/encode.txt @@ -1,16 +1,16 @@ procedure List.4 (List.101, List.102): - let List.388 : U64 = 1i64; - let List.386 : List U8 = CallByName List.70 List.101 List.388; - let List.385 : List U8 = CallByName List.71 List.386 List.102; - ret List.385; + let List.384 : U64 = 1i64; + let List.382 : List U8 = CallByName List.70 List.101 List.384; + let List.381 : List U8 = CallByName List.71 List.382 List.102; + ret List.381; procedure List.70 (#Attr.2, #Attr.3): - let List.389 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.389; + let List.385 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.385; procedure List.71 (#Attr.2, #Attr.3): - let List.387 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.387; + let List.383 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.383; procedure Test.23 (Test.24, Test.35, Test.22): let Test.37 : List U8 = CallByName List.4 Test.24 Test.22; diff --git a/crates/compiler/test_mono/generated/encode_derived_nested_record_string.txt b/crates/compiler/test_mono/generated/encode_derived_nested_record_string.txt index 2e9010b165..1ae82bd7c2 100644 --- a/crates/compiler/test_mono/generated/encode_derived_nested_record_string.txt +++ b/crates/compiler/test_mono/generated/encode_derived_nested_record_string.txt @@ -44,7 +44,7 @@ procedure Encode.23 (Encode.94, Encode.102, Encode.96): ret Encode.106; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.113 : List U8 = CallByName Json.103 Encode.94 Encode.96 Encode.102; + let Encode.113 : List U8 = CallByName Json.113 Encode.94 Encode.96 Encode.102; ret Encode.113; procedure Encode.23 (Encode.94, Encode.102, Encode.96): @@ -52,11 +52,11 @@ procedure Encode.23 (Encode.94, Encode.102, Encode.96): ret Encode.115; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.125 : List U8 = CallByName Json.103 Encode.94 Encode.96 Encode.102; + let Encode.125 : List U8 = CallByName Json.113 Encode.94 Encode.96 Encode.102; ret Encode.125; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.128 : List U8 = CallByName Json.87 Encode.94 Encode.96 Encode.102; + let Encode.128 : List U8 = CallByName Json.97 Encode.94 Encode.96 Encode.102; ret Encode.128; procedure Encode.25 (Encode.100, Encode.101): @@ -66,293 +66,293 @@ procedure Encode.25 (Encode.100, Encode.101): ret Encode.103; procedure Json.1 (): - let Json.318 : {} = Struct {}; - ret Json.318; + let Json.396 : {} = Struct {}; + ret Json.396; -procedure Json.103 (Json.104, Json.321, Json.102): - let Json.354 : I32 = 123i64; - let Json.353 : U8 = CallByName Num.123 Json.354; - let Json.106 : List U8 = CallByName List.4 Json.104 Json.353; - let Json.352 : U64 = CallByName List.6 Json.102; - let Json.329 : {List U8, U64} = Struct {Json.106, Json.352}; - let Json.330 : {} = Struct {}; - let Json.328 : {List U8, U64} = CallByName List.18 Json.102 Json.329 Json.330; - dec Json.102; - let Json.108 : List U8 = StructAtIndex 0 Json.328; - inc Json.108; - dec Json.328; - let Json.327 : I32 = 125i64; - let Json.326 : U8 = CallByName Num.123 Json.327; - let Json.325 : List U8 = CallByName List.4 Json.108 Json.326; - ret Json.325; +procedure Json.113 (Json.114, Json.399, Json.112): + let Json.432 : I32 = 123i64; + let Json.431 : U8 = CallByName Num.123 Json.432; + let Json.116 : List U8 = CallByName List.4 Json.114 Json.431; + let Json.430 : U64 = CallByName List.6 Json.112; + let Json.407 : {List U8, U64} = Struct {Json.116, Json.430}; + let Json.408 : {} = Struct {}; + let Json.406 : {List U8, U64} = CallByName List.18 Json.112 Json.407 Json.408; + dec Json.112; + let Json.118 : List U8 = StructAtIndex 0 Json.406; + inc Json.118; + dec Json.406; + let Json.405 : I32 = 125i64; + let Json.404 : U8 = CallByName Num.123 Json.405; + let Json.403 : List U8 = CallByName List.4 Json.118 Json.404; + ret Json.403; -procedure Json.103 (Json.104, Json.321, Json.102): - let Json.397 : I32 = 123i64; - let Json.396 : U8 = CallByName Num.123 Json.397; - let Json.106 : List U8 = CallByName List.4 Json.104 Json.396; - let Json.395 : U64 = CallByName List.6 Json.102; - let Json.372 : {List U8, U64} = Struct {Json.106, Json.395}; - let Json.373 : {} = Struct {}; - let Json.371 : {List U8, U64} = CallByName List.18 Json.102 Json.372 Json.373; - dec Json.102; - let Json.108 : List U8 = StructAtIndex 0 Json.371; - inc Json.108; - dec Json.371; - let Json.370 : I32 = 125i64; - let Json.369 : U8 = CallByName Num.123 Json.370; - let Json.368 : List U8 = CallByName List.4 Json.108 Json.369; - ret Json.368; +procedure Json.113 (Json.114, Json.399, Json.112): + let Json.472 : I32 = 123i64; + let Json.471 : U8 = CallByName Num.123 Json.472; + let Json.116 : List U8 = CallByName List.4 Json.114 Json.471; + let Json.470 : U64 = CallByName List.6 Json.112; + let Json.447 : {List U8, U64} = Struct {Json.116, Json.470}; + let Json.448 : {} = Struct {}; + let Json.446 : {List U8, U64} = CallByName List.18 Json.112 Json.447 Json.448; + dec Json.112; + let Json.118 : List U8 = StructAtIndex 0 Json.446; + inc Json.118; + dec Json.446; + let Json.445 : I32 = 125i64; + let Json.444 : U8 = CallByName Num.123 Json.445; + let Json.443 : List U8 = CallByName List.4 Json.118 Json.444; + ret Json.443; -procedure Json.105 (Json.323, Json.324): - let Json.111 : Str = StructAtIndex 0 Json.324; - inc Json.111; - let Json.112 : Str = StructAtIndex 1 Json.324; - inc Json.112; - dec Json.324; - let Json.109 : List U8 = StructAtIndex 0 Json.323; - inc Json.109; - let Json.110 : U64 = StructAtIndex 1 Json.323; - dec Json.323; - let Json.351 : I32 = 34i64; - let Json.350 : U8 = CallByName Num.123 Json.351; - let Json.348 : List U8 = CallByName List.4 Json.109 Json.350; - let Json.349 : List U8 = CallByName Str.12 Json.111; - let Json.345 : List U8 = CallByName List.8 Json.348 Json.349; - let Json.347 : I32 = 34i64; - let Json.346 : U8 = CallByName Num.123 Json.347; - let Json.342 : List U8 = CallByName List.4 Json.345 Json.346; - let Json.344 : I32 = 58i64; - let Json.343 : U8 = CallByName Num.123 Json.344; - let Json.340 : List U8 = CallByName List.4 Json.342 Json.343; - let Json.341 : {} = Struct {}; - let Json.113 : List U8 = CallByName Encode.23 Json.340 Json.112 Json.341; - joinpoint Json.335 Json.114: - let Json.333 : U64 = 1i64; - let Json.332 : U64 = CallByName Num.20 Json.110 Json.333; - let Json.331 : {List U8, U64} = Struct {Json.114, Json.332}; - ret Json.331; +procedure Json.115 (Json.401, Json.402): + let Json.121 : Str = StructAtIndex 0 Json.402; + inc Json.121; + let Json.122 : Str = StructAtIndex 1 Json.402; + inc Json.122; + dec Json.402; + let Json.119 : List U8 = StructAtIndex 0 Json.401; + inc Json.119; + let Json.120 : U64 = StructAtIndex 1 Json.401; + dec Json.401; + let Json.429 : I32 = 34i64; + let Json.428 : U8 = CallByName Num.123 Json.429; + let Json.426 : List U8 = CallByName List.4 Json.119 Json.428; + let Json.427 : List U8 = CallByName Str.12 Json.121; + let Json.423 : List U8 = CallByName List.8 Json.426 Json.427; + let Json.425 : I32 = 34i64; + let Json.424 : U8 = CallByName Num.123 Json.425; + let Json.420 : List U8 = CallByName List.4 Json.423 Json.424; + let Json.422 : I32 = 58i64; + let Json.421 : U8 = CallByName Num.123 Json.422; + let Json.418 : List U8 = CallByName List.4 Json.420 Json.421; + let Json.419 : {} = Struct {}; + let Json.123 : List U8 = CallByName Encode.23 Json.418 Json.122 Json.419; + joinpoint Json.413 Json.124: + let Json.411 : U64 = 1i64; + let Json.410 : U64 = CallByName Num.20 Json.120 Json.411; + let Json.409 : {List U8, U64} = Struct {Json.124, Json.410}; + ret Json.409; in - let Json.339 : U64 = 1i64; - let Json.336 : Int1 = CallByName Num.24 Json.110 Json.339; - if Json.336 then - let Json.338 : I32 = 44i64; - let Json.337 : U8 = CallByName Num.123 Json.338; - let Json.334 : List U8 = CallByName List.4 Json.113 Json.337; - jump Json.335 Json.334; + let Json.417 : U64 = 1i64; + let Json.414 : Int1 = CallByName Num.24 Json.120 Json.417; + if Json.414 then + let Json.416 : I32 = 44i64; + let Json.415 : U8 = CallByName Num.123 Json.416; + let Json.412 : List U8 = CallByName List.4 Json.123 Json.415; + jump Json.413 Json.412; else - jump Json.335 Json.113; + jump Json.413 Json.123; -procedure Json.105 (Json.323, Json.324): - let Json.111 : Str = StructAtIndex 0 Json.324; - inc Json.111; - let Json.112 : Str = StructAtIndex 1 Json.324; - inc Json.112; - dec Json.324; - let Json.109 : List U8 = StructAtIndex 0 Json.323; - inc Json.109; - let Json.110 : U64 = StructAtIndex 1 Json.323; - dec Json.323; - let Json.394 : I32 = 34i64; - let Json.393 : U8 = CallByName Num.123 Json.394; - let Json.391 : List U8 = CallByName List.4 Json.109 Json.393; - let Json.392 : List U8 = CallByName Str.12 Json.111; - let Json.388 : List U8 = CallByName List.8 Json.391 Json.392; - let Json.390 : I32 = 34i64; - let Json.389 : U8 = CallByName Num.123 Json.390; - let Json.385 : List U8 = CallByName List.4 Json.388 Json.389; - let Json.387 : I32 = 58i64; - let Json.386 : U8 = CallByName Num.123 Json.387; - let Json.383 : List U8 = CallByName List.4 Json.385 Json.386; - let Json.384 : {} = Struct {}; - let Json.113 : List U8 = CallByName Encode.23 Json.383 Json.112 Json.384; - joinpoint Json.378 Json.114: - let Json.376 : U64 = 1i64; - let Json.375 : U64 = CallByName Num.20 Json.110 Json.376; - let Json.374 : {List U8, U64} = Struct {Json.114, Json.375}; - ret Json.374; +procedure Json.115 (Json.401, Json.402): + let Json.121 : Str = StructAtIndex 0 Json.402; + inc Json.121; + let Json.122 : Str = StructAtIndex 1 Json.402; + inc Json.122; + dec Json.402; + let Json.119 : List U8 = StructAtIndex 0 Json.401; + inc Json.119; + let Json.120 : U64 = StructAtIndex 1 Json.401; + dec Json.401; + let Json.469 : I32 = 34i64; + let Json.468 : U8 = CallByName Num.123 Json.469; + let Json.466 : List U8 = CallByName List.4 Json.119 Json.468; + let Json.467 : List U8 = CallByName Str.12 Json.121; + let Json.463 : List U8 = CallByName List.8 Json.466 Json.467; + let Json.465 : I32 = 34i64; + let Json.464 : U8 = CallByName Num.123 Json.465; + let Json.460 : List U8 = CallByName List.4 Json.463 Json.464; + let Json.462 : I32 = 58i64; + let Json.461 : U8 = CallByName Num.123 Json.462; + let Json.458 : List U8 = CallByName List.4 Json.460 Json.461; + let Json.459 : {} = Struct {}; + let Json.123 : List U8 = CallByName Encode.23 Json.458 Json.122 Json.459; + joinpoint Json.453 Json.124: + let Json.451 : U64 = 1i64; + let Json.450 : U64 = CallByName Num.20 Json.120 Json.451; + let Json.449 : {List U8, U64} = Struct {Json.124, Json.450}; + ret Json.449; in - let Json.382 : U64 = 1i64; - let Json.379 : Int1 = CallByName Num.24 Json.110 Json.382; - if Json.379 then - let Json.381 : I32 = 44i64; - let Json.380 : U8 = CallByName Num.123 Json.381; - let Json.377 : List U8 = CallByName List.4 Json.113 Json.380; - jump Json.378 Json.377; + let Json.457 : U64 = 1i64; + let Json.454 : Int1 = CallByName Num.24 Json.120 Json.457; + if Json.454 then + let Json.456 : I32 = 44i64; + let Json.455 : U8 = CallByName Num.123 Json.456; + let Json.452 : List U8 = CallByName List.4 Json.123 Json.455; + jump Json.453 Json.452; else - jump Json.378 Json.113; + jump Json.453 Json.123; -procedure Json.18 (Json.86): - let Json.364 : Str = CallByName Encode.22 Json.86; - ret Json.364; +procedure Json.18 (Json.96): + let Json.473 : Str = CallByName Encode.22 Json.96; + ret Json.473; -procedure Json.20 (Json.102): - let Json.319 : List {Str, Str} = CallByName Encode.22 Json.102; - ret Json.319; +procedure Json.20 (Json.112): + let Json.397 : List {Str, Str} = CallByName Encode.22 Json.112; + ret Json.397; -procedure Json.20 (Json.102): - let Json.361 : List {Str, Str} = CallByName Encode.22 Json.102; - ret Json.361; +procedure Json.20 (Json.112): + let Json.439 : List {Str, Str} = CallByName Encode.22 Json.112; + ret Json.439; -procedure Json.87 (Json.88, Json.366, Json.86): - let Json.406 : I32 = 34i64; - let Json.405 : U8 = CallByName Num.123 Json.406; - let Json.403 : List U8 = CallByName List.4 Json.88 Json.405; - let Json.404 : List U8 = CallByName Str.12 Json.86; - let Json.400 : List U8 = CallByName List.8 Json.403 Json.404; - let Json.402 : I32 = 34i64; - let Json.401 : U8 = CallByName Num.123 Json.402; - let Json.399 : List U8 = CallByName List.4 Json.400 Json.401; - ret Json.399; +procedure Json.97 (Json.98, Json.475, Json.96): + let Json.484 : I32 = 34i64; + let Json.483 : U8 = CallByName Num.123 Json.484; + let Json.481 : List U8 = CallByName List.4 Json.98 Json.483; + let Json.482 : List U8 = CallByName Str.12 Json.96; + let Json.478 : List U8 = CallByName List.8 Json.481 Json.482; + let Json.480 : I32 = 34i64; + let Json.479 : U8 = CallByName Num.123 Json.480; + let Json.477 : List U8 = CallByName List.4 Json.478 Json.479; + ret Json.477; procedure List.133 (List.134, List.135, List.132): - let List.434 : {List U8, U64} = CallByName Json.105 List.134 List.135; - let List.433 : [C [], C {List U8, U64}] = TagId(1) List.434; - ret List.433; + let List.429 : {List U8, U64} = CallByName Json.115 List.134 List.135; + let List.428 : [C [], C {List U8, U64}] = TagId(1) List.429; + ret List.428; procedure List.133 (List.134, List.135, List.132): - let List.515 : {List U8, U64} = CallByName Json.105 List.134 List.135; - let List.514 : [C [], C {List U8, U64}] = TagId(1) List.515; - ret List.514; + let List.510 : {List U8, U64} = CallByName Json.115 List.134 List.135; + let List.509 : [C [], C {List U8, U64}] = TagId(1) List.510; + ret List.509; procedure List.18 (List.130, List.131, List.132): - let List.405 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; - let List.408 : U8 = 1i64; - let List.409 : U8 = GetTagId List.405; - let List.410 : Int1 = lowlevel Eq List.408 List.409; - if List.410 then - let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.405; + let List.403 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; + let List.407 : U8 = 1i64; + let List.408 : U8 = GetTagId List.403; + let List.409 : Int1 = lowlevel Eq List.407 List.408; + if List.409 then + let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.403; inc List.137; - dec List.405; + dec List.403; ret List.137; else - let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.405; - dec List.405; - let List.407 : {List U8, U64} = CallByName List.69 List.138; - ret List.407; + let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.403; + dec List.403; + let List.405 : {List U8, U64} = CallByName List.69 List.138; + ret List.405; procedure List.18 (List.130, List.131, List.132): - let List.485 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; + let List.484 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; let List.488 : U8 = 1i64; - let List.489 : U8 = GetTagId List.485; + let List.489 : U8 = GetTagId List.484; let List.490 : Int1 = lowlevel Eq List.488 List.489; if List.490 then - let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.485; + let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.484; inc List.137; - dec List.485; + dec List.484; ret List.137; else - let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.485; - dec List.485; - let List.487 : {List U8, U64} = CallByName List.69 List.138; - ret List.487; + let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.484; + dec List.484; + let List.486 : {List U8, U64} = CallByName List.69 List.138; + ret List.486; procedure List.4 (List.101, List.102): - let List.484 : U64 = 1i64; - let List.483 : List U8 = CallByName List.70 List.101 List.484; - let List.482 : List U8 = CallByName List.71 List.483 List.102; - ret List.482; + let List.483 : U64 = 1i64; + let List.482 : List U8 = CallByName List.70 List.101 List.483; + let List.481 : List U8 = CallByName List.71 List.482 List.102; + ret List.481; procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure List.6 (#Attr.2): - let List.413 : U64 = lowlevel ListLen #Attr.2; - ret List.413; + let List.431 : U64 = lowlevel ListLen #Attr.2; + ret List.431; procedure List.6 (#Attr.2): - let List.494 : U64 = lowlevel ListLen #Attr.2; - ret List.494; - -procedure List.66 (#Attr.2, #Attr.3): - let List.432 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.432; - -procedure List.66 (#Attr.2, #Attr.3): - let List.513 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + let List.513 : U64 = lowlevel ListLen #Attr.2; ret List.513; +procedure List.66 (#Attr.2, #Attr.3): + let List.426 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.426; + +procedure List.66 (#Attr.2, #Attr.3): + let List.507 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.507; + procedure List.69 (#Attr.2): - let List.497 : {List U8, U64} = lowlevel Unreachable #Attr.2; - ret List.497; + let List.487 : {List U8, U64} = lowlevel Unreachable #Attr.2; + ret List.487; procedure List.70 (#Attr.2, #Attr.3): - let List.496 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.496; + let List.462 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.462; procedure List.71 (#Attr.2, #Attr.3): - let List.495 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.495; + let List.460 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.460; -procedure List.75 (List.361, List.362, List.363): - let List.418 : U64 = 0i64; - let List.419 : U64 = CallByName List.6 List.361; - let List.417 : [C [], C {List U8, U64}] = CallByName List.86 List.361 List.362 List.363 List.418 List.419; - ret List.417; +procedure List.75 (List.357, List.358, List.359): + let List.412 : U64 = 0i64; + let List.413 : U64 = CallByName List.6 List.357; + let List.411 : [C [], C {List U8, U64}] = CallByName List.86 List.357 List.358 List.359 List.412 List.413; + ret List.411; -procedure List.75 (List.361, List.362, List.363): - let List.499 : U64 = 0i64; - let List.500 : U64 = CallByName List.6 List.361; - let List.498 : [C [], C {List U8, U64}] = CallByName List.86 List.361 List.362 List.363 List.499 List.500; - ret List.498; +procedure List.75 (List.357, List.358, List.359): + let List.493 : U64 = 0i64; + let List.494 : U64 = CallByName List.6 List.357; + let List.492 : [C [], C {List U8, U64}] = CallByName List.86 List.357 List.358 List.359 List.493 List.494; + ret List.492; procedure List.8 (#Attr.2, #Attr.3): - let List.493 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; - ret List.493; + let List.512 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; + ret List.512; -procedure List.86 (List.448, List.449, List.450, List.451, List.452): - joinpoint List.420 List.364 List.365 List.366 List.367 List.368: - let List.422 : Int1 = CallByName Num.22 List.367 List.368; - if List.422 then - let List.431 : {Str, Str} = CallByName List.66 List.364 List.367; - let List.423 : [C [], C {List U8, U64}] = CallByName List.133 List.365 List.431 List.366; - let List.428 : U8 = 1i64; - let List.429 : U8 = GetTagId List.423; - let List.430 : Int1 = lowlevel Eq List.428 List.429; - if List.430 then - let List.369 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.423; - inc List.369; - dec List.423; - let List.426 : U64 = 1i64; - let List.425 : U64 = CallByName Num.19 List.367 List.426; - jump List.420 List.364 List.369 List.366 List.425 List.368; +procedure List.86 (List.442, List.443, List.444, List.445, List.446): + joinpoint List.414 List.360 List.361 List.362 List.363 List.364: + let List.416 : Int1 = CallByName Num.22 List.363 List.364; + if List.416 then + let List.425 : {Str, Str} = CallByName List.66 List.360 List.363; + let List.417 : [C [], C {List U8, U64}] = CallByName List.133 List.361 List.425 List.362; + let List.422 : U8 = 1i64; + let List.423 : U8 = GetTagId List.417; + let List.424 : Int1 = lowlevel Eq List.422 List.423; + if List.424 then + let List.365 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.417; + inc List.365; + dec List.417; + let List.420 : U64 = 1i64; + let List.419 : U64 = CallByName Num.19 List.363 List.420; + jump List.414 List.360 List.365 List.362 List.419 List.364; else - let List.370 : [] = UnionAtIndex (Id 0) (Index 0) List.423; - dec List.423; - let List.427 : [C [], C {List U8, U64}] = TagId(0) List.370; - ret List.427; + let List.366 : [] = UnionAtIndex (Id 0) (Index 0) List.417; + dec List.417; + let List.421 : [C [], C {List U8, U64}] = TagId(0) List.366; + ret List.421; else - let List.421 : [C [], C {List U8, U64}] = TagId(1) List.365; - ret List.421; + let List.415 : [C [], C {List U8, U64}] = TagId(1) List.361; + ret List.415; in - jump List.420 List.448 List.449 List.450 List.451 List.452; + jump List.414 List.442 List.443 List.444 List.445 List.446; -procedure List.86 (List.529, List.530, List.531, List.532, List.533): - joinpoint List.501 List.364 List.365 List.366 List.367 List.368: - let List.503 : Int1 = CallByName Num.22 List.367 List.368; - if List.503 then - let List.512 : {Str, Str} = CallByName List.66 List.364 List.367; - let List.504 : [C [], C {List U8, U64}] = CallByName List.133 List.365 List.512 List.366; - let List.509 : U8 = 1i64; - let List.510 : U8 = GetTagId List.504; - let List.511 : Int1 = lowlevel Eq List.509 List.510; - if List.511 then - let List.369 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.504; - inc List.369; - dec List.504; - let List.507 : U64 = 1i64; - let List.506 : U64 = CallByName Num.19 List.367 List.507; - jump List.501 List.364 List.369 List.366 List.506 List.368; +procedure List.86 (List.524, List.525, List.526, List.527, List.528): + joinpoint List.495 List.360 List.361 List.362 List.363 List.364: + let List.497 : Int1 = CallByName Num.22 List.363 List.364; + if List.497 then + let List.506 : {Str, Str} = CallByName List.66 List.360 List.363; + let List.498 : [C [], C {List U8, U64}] = CallByName List.133 List.361 List.506 List.362; + let List.503 : U8 = 1i64; + let List.504 : U8 = GetTagId List.498; + let List.505 : Int1 = lowlevel Eq List.503 List.504; + if List.505 then + let List.365 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.498; + inc List.365; + dec List.498; + let List.501 : U64 = 1i64; + let List.500 : U64 = CallByName Num.19 List.363 List.501; + jump List.495 List.360 List.365 List.362 List.500 List.364; else - let List.370 : [] = UnionAtIndex (Id 0) (Index 0) List.504; - dec List.504; - let List.508 : [C [], C {List U8, U64}] = TagId(0) List.370; - ret List.508; + let List.366 : [] = UnionAtIndex (Id 0) (Index 0) List.498; + dec List.498; + let List.502 : [C [], C {List U8, U64}] = TagId(0) List.366; + ret List.502; else - let List.502 : [C [], C {List U8, U64}] = TagId(1) List.365; - ret List.502; + let List.496 : [C [], C {List U8, U64}] = TagId(1) List.361; + ret List.496; in - jump List.501 List.529 List.530 List.531 List.532 List.533; + jump List.495 List.524 List.525 List.526 List.527 List.528; procedure Num.123 (#Attr.2): let Num.283 : U8 = lowlevel NumIntCast #Attr.2; @@ -375,31 +375,31 @@ procedure Num.24 (#Attr.2, #Attr.3): ret Num.285; procedure Str.12 (#Attr.2): - let Str.219 : List U8 = lowlevel StrToUtf8 #Attr.2; - ret Str.219; + let Str.268 : List U8 = lowlevel StrToUtf8 #Attr.2; + ret Str.268; procedure Str.48 (#Attr.2, #Attr.3, #Attr.4): - let Str.211 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; - ret Str.211; + let Str.260 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; + ret Str.260; -procedure Str.9 (Str.69): - let Str.209 : U64 = 0i64; - let Str.210 : U64 = CallByName List.6 Str.69; - let Str.70 : {U64, Str, Int1, U8} = CallByName Str.48 Str.69 Str.209 Str.210; - let Str.206 : Int1 = StructAtIndex 2 Str.70; - if Str.206 then - let Str.208 : Str = StructAtIndex 1 Str.70; - inc Str.208; - dec Str.70; - let Str.207 : [C {U64, U8}, C Str] = TagId(1) Str.208; - ret Str.207; +procedure Str.9 (Str.73): + let Str.258 : U64 = 0i64; + let Str.259 : U64 = CallByName List.6 Str.73; + let Str.74 : {U64, Str, Int1, U8} = CallByName Str.48 Str.73 Str.258 Str.259; + let Str.255 : Int1 = StructAtIndex 2 Str.74; + if Str.255 then + let Str.257 : Str = StructAtIndex 1 Str.74; + inc Str.257; + dec Str.74; + let Str.256 : [C {U64, U8}, C Str] = TagId(1) Str.257; + ret Str.256; else - let Str.204 : U8 = StructAtIndex 3 Str.70; - let Str.205 : U64 = StructAtIndex 0 Str.70; - dec Str.70; - let Str.203 : {U64, U8} = Struct {Str.205, Str.204}; - let Str.202 : [C {U64, U8}, C Str] = TagId(0) Str.203; - ret Str.202; + let Str.253 : U8 = StructAtIndex 3 Str.74; + let Str.254 : U64 = StructAtIndex 0 Str.74; + dec Str.74; + let Str.252 : {U64, U8} = Struct {Str.254, Str.253}; + let Str.251 : [C {U64, U8}, C Str] = TagId(0) Str.252; + ret Str.251; procedure Test.0 (): let Test.12 : Str = "bar"; diff --git a/crates/compiler/test_mono/generated/encode_derived_record_one_field_string.txt b/crates/compiler/test_mono/generated/encode_derived_record_one_field_string.txt index 3398a4c5e9..48849a17f2 100644 --- a/crates/compiler/test_mono/generated/encode_derived_record_one_field_string.txt +++ b/crates/compiler/test_mono/generated/encode_derived_record_one_field_string.txt @@ -25,11 +25,11 @@ procedure Encode.23 (Encode.94, Encode.102, Encode.96): ret Encode.106; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.113 : List U8 = CallByName Json.103 Encode.94 Encode.96 Encode.102; + let Encode.113 : List U8 = CallByName Json.113 Encode.94 Encode.96 Encode.102; ret Encode.113; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.116 : List U8 = CallByName Json.87 Encode.94 Encode.96 Encode.102; + let Encode.116 : List U8 = CallByName Json.97 Encode.94 Encode.96 Encode.102; ret Encode.116; procedure Encode.25 (Encode.100, Encode.101): @@ -39,171 +39,171 @@ procedure Encode.25 (Encode.100, Encode.101): ret Encode.103; procedure Json.1 (): - let Json.318 : {} = Struct {}; - ret Json.318; + let Json.396 : {} = Struct {}; + ret Json.396; -procedure Json.103 (Json.104, Json.321, Json.102): - let Json.357 : I32 = 123i64; - let Json.356 : U8 = CallByName Num.123 Json.357; - let Json.106 : List U8 = CallByName List.4 Json.104 Json.356; - let Json.355 : U64 = CallByName List.6 Json.102; - let Json.332 : {List U8, U64} = Struct {Json.106, Json.355}; - let Json.333 : {} = Struct {}; - let Json.331 : {List U8, U64} = CallByName List.18 Json.102 Json.332 Json.333; - dec Json.102; - let Json.108 : List U8 = StructAtIndex 0 Json.331; - inc Json.108; - dec Json.331; - let Json.330 : I32 = 125i64; - let Json.329 : U8 = CallByName Num.123 Json.330; - let Json.328 : List U8 = CallByName List.4 Json.108 Json.329; - ret Json.328; +procedure Json.113 (Json.114, Json.399, Json.112): + let Json.432 : I32 = 123i64; + let Json.431 : U8 = CallByName Num.123 Json.432; + let Json.116 : List U8 = CallByName List.4 Json.114 Json.431; + let Json.430 : U64 = CallByName List.6 Json.112; + let Json.407 : {List U8, U64} = Struct {Json.116, Json.430}; + let Json.408 : {} = Struct {}; + let Json.406 : {List U8, U64} = CallByName List.18 Json.112 Json.407 Json.408; + dec Json.112; + let Json.118 : List U8 = StructAtIndex 0 Json.406; + inc Json.118; + dec Json.406; + let Json.405 : I32 = 125i64; + let Json.404 : U8 = CallByName Num.123 Json.405; + let Json.403 : List U8 = CallByName List.4 Json.118 Json.404; + ret Json.403; -procedure Json.105 (Json.326, Json.327): - let Json.111 : Str = StructAtIndex 0 Json.327; - inc Json.111; - let Json.112 : Str = StructAtIndex 1 Json.327; - inc Json.112; - dec Json.327; - let Json.109 : List U8 = StructAtIndex 0 Json.326; - inc Json.109; - let Json.110 : U64 = StructAtIndex 1 Json.326; - dec Json.326; - let Json.354 : I32 = 34i64; - let Json.353 : U8 = CallByName Num.123 Json.354; - let Json.351 : List U8 = CallByName List.4 Json.109 Json.353; - let Json.352 : List U8 = CallByName Str.12 Json.111; - let Json.348 : List U8 = CallByName List.8 Json.351 Json.352; - let Json.350 : I32 = 34i64; - let Json.349 : U8 = CallByName Num.123 Json.350; - let Json.345 : List U8 = CallByName List.4 Json.348 Json.349; - let Json.347 : I32 = 58i64; - let Json.346 : U8 = CallByName Num.123 Json.347; - let Json.343 : List U8 = CallByName List.4 Json.345 Json.346; - let Json.344 : {} = Struct {}; - let Json.113 : List U8 = CallByName Encode.23 Json.343 Json.112 Json.344; - joinpoint Json.338 Json.114: - let Json.336 : U64 = 1i64; - let Json.335 : U64 = CallByName Num.20 Json.110 Json.336; - let Json.334 : {List U8, U64} = Struct {Json.114, Json.335}; - ret Json.334; +procedure Json.115 (Json.401, Json.402): + let Json.121 : Str = StructAtIndex 0 Json.402; + inc Json.121; + let Json.122 : Str = StructAtIndex 1 Json.402; + inc Json.122; + dec Json.402; + let Json.119 : List U8 = StructAtIndex 0 Json.401; + inc Json.119; + let Json.120 : U64 = StructAtIndex 1 Json.401; + dec Json.401; + let Json.429 : I32 = 34i64; + let Json.428 : U8 = CallByName Num.123 Json.429; + let Json.426 : List U8 = CallByName List.4 Json.119 Json.428; + let Json.427 : List U8 = CallByName Str.12 Json.121; + let Json.423 : List U8 = CallByName List.8 Json.426 Json.427; + let Json.425 : I32 = 34i64; + let Json.424 : U8 = CallByName Num.123 Json.425; + let Json.420 : List U8 = CallByName List.4 Json.423 Json.424; + let Json.422 : I32 = 58i64; + let Json.421 : U8 = CallByName Num.123 Json.422; + let Json.418 : List U8 = CallByName List.4 Json.420 Json.421; + let Json.419 : {} = Struct {}; + let Json.123 : List U8 = CallByName Encode.23 Json.418 Json.122 Json.419; + joinpoint Json.413 Json.124: + let Json.411 : U64 = 1i64; + let Json.410 : U64 = CallByName Num.20 Json.120 Json.411; + let Json.409 : {List U8, U64} = Struct {Json.124, Json.410}; + ret Json.409; in - let Json.342 : U64 = 1i64; - let Json.339 : Int1 = CallByName Num.24 Json.110 Json.342; - if Json.339 then - let Json.341 : I32 = 44i64; - let Json.340 : U8 = CallByName Num.123 Json.341; - let Json.337 : List U8 = CallByName List.4 Json.113 Json.340; - jump Json.338 Json.337; + let Json.417 : U64 = 1i64; + let Json.414 : Int1 = CallByName Num.24 Json.120 Json.417; + if Json.414 then + let Json.416 : I32 = 44i64; + let Json.415 : U8 = CallByName Num.123 Json.416; + let Json.412 : List U8 = CallByName List.4 Json.123 Json.415; + jump Json.413 Json.412; else - jump Json.338 Json.113; + jump Json.413 Json.123; -procedure Json.18 (Json.86): - let Json.322 : Str = CallByName Encode.22 Json.86; - ret Json.322; +procedure Json.18 (Json.96): + let Json.433 : Str = CallByName Encode.22 Json.96; + ret Json.433; -procedure Json.20 (Json.102): - let Json.319 : List {Str, Str} = CallByName Encode.22 Json.102; - ret Json.319; +procedure Json.20 (Json.112): + let Json.397 : List {Str, Str} = CallByName Encode.22 Json.112; + ret Json.397; -procedure Json.87 (Json.88, Json.324, Json.86): - let Json.366 : I32 = 34i64; - let Json.365 : U8 = CallByName Num.123 Json.366; - let Json.363 : List U8 = CallByName List.4 Json.88 Json.365; - let Json.364 : List U8 = CallByName Str.12 Json.86; - let Json.360 : List U8 = CallByName List.8 Json.363 Json.364; - let Json.362 : I32 = 34i64; - let Json.361 : U8 = CallByName Num.123 Json.362; - let Json.359 : List U8 = CallByName List.4 Json.360 Json.361; - ret Json.359; +procedure Json.97 (Json.98, Json.435, Json.96): + let Json.444 : I32 = 34i64; + let Json.443 : U8 = CallByName Num.123 Json.444; + let Json.441 : List U8 = CallByName List.4 Json.98 Json.443; + let Json.442 : List U8 = CallByName Str.12 Json.96; + let Json.438 : List U8 = CallByName List.8 Json.441 Json.442; + let Json.440 : I32 = 34i64; + let Json.439 : U8 = CallByName Num.123 Json.440; + let Json.437 : List U8 = CallByName List.4 Json.438 Json.439; + ret Json.437; procedure List.133 (List.134, List.135, List.132): - let List.441 : {List U8, U64} = CallByName Json.105 List.134 List.135; - let List.440 : [C [], C {List U8, U64}] = TagId(1) List.441; - ret List.440; + let List.435 : {List U8, U64} = CallByName Json.115 List.134 List.135; + let List.434 : [C [], C {List U8, U64}] = TagId(1) List.435; + ret List.434; procedure List.18 (List.130, List.131, List.132): - let List.411 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; - let List.414 : U8 = 1i64; - let List.415 : U8 = GetTagId List.411; - let List.416 : Int1 = lowlevel Eq List.414 List.415; - if List.416 then - let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.411; + let List.409 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; + let List.413 : U8 = 1i64; + let List.414 : U8 = GetTagId List.409; + let List.415 : Int1 = lowlevel Eq List.413 List.414; + if List.415 then + let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.409; inc List.137; - dec List.411; + dec List.409; ret List.137; else - let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.411; - dec List.411; - let List.413 : {List U8, U64} = CallByName List.69 List.138; - ret List.413; + let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.409; + dec List.409; + let List.411 : {List U8, U64} = CallByName List.69 List.138; + ret List.411; procedure List.4 (List.101, List.102): - let List.410 : U64 = 1i64; - let List.409 : List U8 = CallByName List.70 List.101 List.410; - let List.408 : List U8 = CallByName List.71 List.409 List.102; - ret List.408; + let List.408 : U64 = 1i64; + let List.407 : List U8 = CallByName List.70 List.101 List.408; + let List.406 : List U8 = CallByName List.71 List.407 List.102; + ret List.406; procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure List.6 (#Attr.2): - let List.420 : U64 = lowlevel ListLen #Attr.2; - ret List.420; + let List.438 : U64 = lowlevel ListLen #Attr.2; + ret List.438; procedure List.66 (#Attr.2, #Attr.3): - let List.439 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.439; + let List.432 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.432; procedure List.69 (#Attr.2): - let List.423 : {List U8, U64} = lowlevel Unreachable #Attr.2; - ret List.423; + let List.412 : {List U8, U64} = lowlevel Unreachable #Attr.2; + ret List.412; procedure List.70 (#Attr.2, #Attr.3): - let List.422 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.422; + let List.387 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.387; procedure List.71 (#Attr.2, #Attr.3): - let List.421 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.421; + let List.385 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.385; -procedure List.75 (List.361, List.362, List.363): - let List.425 : U64 = 0i64; - let List.426 : U64 = CallByName List.6 List.361; - let List.424 : [C [], C {List U8, U64}] = CallByName List.86 List.361 List.362 List.363 List.425 List.426; - ret List.424; +procedure List.75 (List.357, List.358, List.359): + let List.418 : U64 = 0i64; + let List.419 : U64 = CallByName List.6 List.357; + let List.417 : [C [], C {List U8, U64}] = CallByName List.86 List.357 List.358 List.359 List.418 List.419; + ret List.417; procedure List.8 (#Attr.2, #Attr.3): - let List.419 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; - ret List.419; + let List.437 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; + ret List.437; -procedure List.86 (List.455, List.456, List.457, List.458, List.459): - joinpoint List.427 List.364 List.365 List.366 List.367 List.368: - let List.429 : Int1 = CallByName Num.22 List.367 List.368; - if List.429 then - let List.438 : {Str, Str} = CallByName List.66 List.364 List.367; - let List.430 : [C [], C {List U8, U64}] = CallByName List.133 List.365 List.438 List.366; - let List.435 : U8 = 1i64; - let List.436 : U8 = GetTagId List.430; - let List.437 : Int1 = lowlevel Eq List.435 List.436; - if List.437 then - let List.369 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.430; - inc List.369; - dec List.430; - let List.433 : U64 = 1i64; - let List.432 : U64 = CallByName Num.19 List.367 List.433; - jump List.427 List.364 List.369 List.366 List.432 List.368; +procedure List.86 (List.449, List.450, List.451, List.452, List.453): + joinpoint List.420 List.360 List.361 List.362 List.363 List.364: + let List.422 : Int1 = CallByName Num.22 List.363 List.364; + if List.422 then + let List.431 : {Str, Str} = CallByName List.66 List.360 List.363; + let List.423 : [C [], C {List U8, U64}] = CallByName List.133 List.361 List.431 List.362; + let List.428 : U8 = 1i64; + let List.429 : U8 = GetTagId List.423; + let List.430 : Int1 = lowlevel Eq List.428 List.429; + if List.430 then + let List.365 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.423; + inc List.365; + dec List.423; + let List.426 : U64 = 1i64; + let List.425 : U64 = CallByName Num.19 List.363 List.426; + jump List.420 List.360 List.365 List.362 List.425 List.364; else - let List.370 : [] = UnionAtIndex (Id 0) (Index 0) List.430; - dec List.430; - let List.434 : [C [], C {List U8, U64}] = TagId(0) List.370; - ret List.434; + let List.366 : [] = UnionAtIndex (Id 0) (Index 0) List.423; + dec List.423; + let List.427 : [C [], C {List U8, U64}] = TagId(0) List.366; + ret List.427; else - let List.428 : [C [], C {List U8, U64}] = TagId(1) List.365; - ret List.428; + let List.421 : [C [], C {List U8, U64}] = TagId(1) List.361; + ret List.421; in - jump List.427 List.455 List.456 List.457 List.458 List.459; + jump List.420 List.449 List.450 List.451 List.452 List.453; procedure Num.123 (#Attr.2): let Num.264 : U8 = lowlevel NumIntCast #Attr.2; @@ -226,31 +226,31 @@ procedure Num.24 (#Attr.2, #Attr.3): ret Num.266; procedure Str.12 (#Attr.2): - let Str.217 : List U8 = lowlevel StrToUtf8 #Attr.2; - ret Str.217; + let Str.266 : List U8 = lowlevel StrToUtf8 #Attr.2; + ret Str.266; procedure Str.48 (#Attr.2, #Attr.3, #Attr.4): - let Str.211 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; - ret Str.211; + let Str.260 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; + ret Str.260; -procedure Str.9 (Str.69): - let Str.209 : U64 = 0i64; - let Str.210 : U64 = CallByName List.6 Str.69; - let Str.70 : {U64, Str, Int1, U8} = CallByName Str.48 Str.69 Str.209 Str.210; - let Str.206 : Int1 = StructAtIndex 2 Str.70; - if Str.206 then - let Str.208 : Str = StructAtIndex 1 Str.70; - inc Str.208; - dec Str.70; - let Str.207 : [C {U64, U8}, C Str] = TagId(1) Str.208; - ret Str.207; +procedure Str.9 (Str.73): + let Str.258 : U64 = 0i64; + let Str.259 : U64 = CallByName List.6 Str.73; + let Str.74 : {U64, Str, Int1, U8} = CallByName Str.48 Str.73 Str.258 Str.259; + let Str.255 : Int1 = StructAtIndex 2 Str.74; + if Str.255 then + let Str.257 : Str = StructAtIndex 1 Str.74; + inc Str.257; + dec Str.74; + let Str.256 : [C {U64, U8}, C Str] = TagId(1) Str.257; + ret Str.256; else - let Str.204 : U8 = StructAtIndex 3 Str.70; - let Str.205 : U64 = StructAtIndex 0 Str.70; - dec Str.70; - let Str.203 : {U64, U8} = Struct {Str.205, Str.204}; - let Str.202 : [C {U64, U8}, C Str] = TagId(0) Str.203; - ret Str.202; + let Str.253 : U8 = StructAtIndex 3 Str.74; + let Str.254 : U64 = StructAtIndex 0 Str.74; + dec Str.74; + let Str.252 : {U64, U8} = Struct {Str.254, Str.253}; + let Str.251 : [C {U64, U8}, C Str] = TagId(0) Str.252; + ret Str.251; procedure Test.0 (): let Test.11 : Str = "foo"; diff --git a/crates/compiler/test_mono/generated/encode_derived_record_two_field_strings.txt b/crates/compiler/test_mono/generated/encode_derived_record_two_field_strings.txt index 0aff7f2c04..a4715fb73c 100644 --- a/crates/compiler/test_mono/generated/encode_derived_record_two_field_strings.txt +++ b/crates/compiler/test_mono/generated/encode_derived_record_two_field_strings.txt @@ -33,11 +33,11 @@ procedure Encode.23 (Encode.94, Encode.102, Encode.96): ret Encode.106; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.113 : List U8 = CallByName Json.103 Encode.94 Encode.96 Encode.102; + let Encode.113 : List U8 = CallByName Json.113 Encode.94 Encode.96 Encode.102; ret Encode.113; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.117 : List U8 = CallByName Json.87 Encode.94 Encode.96 Encode.102; + let Encode.117 : List U8 = CallByName Json.97 Encode.94 Encode.96 Encode.102; ret Encode.117; procedure Encode.25 (Encode.100, Encode.101): @@ -47,171 +47,171 @@ procedure Encode.25 (Encode.100, Encode.101): ret Encode.103; procedure Json.1 (): - let Json.318 : {} = Struct {}; - ret Json.318; + let Json.396 : {} = Struct {}; + ret Json.396; -procedure Json.103 (Json.104, Json.321, Json.102): - let Json.360 : I32 = 123i64; - let Json.359 : U8 = CallByName Num.123 Json.360; - let Json.106 : List U8 = CallByName List.4 Json.104 Json.359; - let Json.358 : U64 = CallByName List.6 Json.102; - let Json.335 : {List U8, U64} = Struct {Json.106, Json.358}; - let Json.336 : {} = Struct {}; - let Json.334 : {List U8, U64} = CallByName List.18 Json.102 Json.335 Json.336; - dec Json.102; - let Json.108 : List U8 = StructAtIndex 0 Json.334; - inc Json.108; - dec Json.334; - let Json.333 : I32 = 125i64; - let Json.332 : U8 = CallByName Num.123 Json.333; - let Json.331 : List U8 = CallByName List.4 Json.108 Json.332; - ret Json.331; +procedure Json.113 (Json.114, Json.399, Json.112): + let Json.432 : I32 = 123i64; + let Json.431 : U8 = CallByName Num.123 Json.432; + let Json.116 : List U8 = CallByName List.4 Json.114 Json.431; + let Json.430 : U64 = CallByName List.6 Json.112; + let Json.407 : {List U8, U64} = Struct {Json.116, Json.430}; + let Json.408 : {} = Struct {}; + let Json.406 : {List U8, U64} = CallByName List.18 Json.112 Json.407 Json.408; + dec Json.112; + let Json.118 : List U8 = StructAtIndex 0 Json.406; + inc Json.118; + dec Json.406; + let Json.405 : I32 = 125i64; + let Json.404 : U8 = CallByName Num.123 Json.405; + let Json.403 : List U8 = CallByName List.4 Json.118 Json.404; + ret Json.403; -procedure Json.105 (Json.329, Json.330): - let Json.111 : Str = StructAtIndex 0 Json.330; - inc Json.111; - let Json.112 : Str = StructAtIndex 1 Json.330; - inc Json.112; - dec Json.330; - let Json.109 : List U8 = StructAtIndex 0 Json.329; - inc Json.109; - let Json.110 : U64 = StructAtIndex 1 Json.329; - dec Json.329; - let Json.357 : I32 = 34i64; - let Json.356 : U8 = CallByName Num.123 Json.357; - let Json.354 : List U8 = CallByName List.4 Json.109 Json.356; - let Json.355 : List U8 = CallByName Str.12 Json.111; - let Json.351 : List U8 = CallByName List.8 Json.354 Json.355; - let Json.353 : I32 = 34i64; - let Json.352 : U8 = CallByName Num.123 Json.353; - let Json.348 : List U8 = CallByName List.4 Json.351 Json.352; - let Json.350 : I32 = 58i64; - let Json.349 : U8 = CallByName Num.123 Json.350; - let Json.346 : List U8 = CallByName List.4 Json.348 Json.349; - let Json.347 : {} = Struct {}; - let Json.113 : List U8 = CallByName Encode.23 Json.346 Json.112 Json.347; - joinpoint Json.341 Json.114: - let Json.339 : U64 = 1i64; - let Json.338 : U64 = CallByName Num.20 Json.110 Json.339; - let Json.337 : {List U8, U64} = Struct {Json.114, Json.338}; - ret Json.337; +procedure Json.115 (Json.401, Json.402): + let Json.121 : Str = StructAtIndex 0 Json.402; + inc Json.121; + let Json.122 : Str = StructAtIndex 1 Json.402; + inc Json.122; + dec Json.402; + let Json.119 : List U8 = StructAtIndex 0 Json.401; + inc Json.119; + let Json.120 : U64 = StructAtIndex 1 Json.401; + dec Json.401; + let Json.429 : I32 = 34i64; + let Json.428 : U8 = CallByName Num.123 Json.429; + let Json.426 : List U8 = CallByName List.4 Json.119 Json.428; + let Json.427 : List U8 = CallByName Str.12 Json.121; + let Json.423 : List U8 = CallByName List.8 Json.426 Json.427; + let Json.425 : I32 = 34i64; + let Json.424 : U8 = CallByName Num.123 Json.425; + let Json.420 : List U8 = CallByName List.4 Json.423 Json.424; + let Json.422 : I32 = 58i64; + let Json.421 : U8 = CallByName Num.123 Json.422; + let Json.418 : List U8 = CallByName List.4 Json.420 Json.421; + let Json.419 : {} = Struct {}; + let Json.123 : List U8 = CallByName Encode.23 Json.418 Json.122 Json.419; + joinpoint Json.413 Json.124: + let Json.411 : U64 = 1i64; + let Json.410 : U64 = CallByName Num.20 Json.120 Json.411; + let Json.409 : {List U8, U64} = Struct {Json.124, Json.410}; + ret Json.409; in - let Json.345 : U64 = 1i64; - let Json.342 : Int1 = CallByName Num.24 Json.110 Json.345; - if Json.342 then - let Json.344 : I32 = 44i64; - let Json.343 : U8 = CallByName Num.123 Json.344; - let Json.340 : List U8 = CallByName List.4 Json.113 Json.343; - jump Json.341 Json.340; + let Json.417 : U64 = 1i64; + let Json.414 : Int1 = CallByName Num.24 Json.120 Json.417; + if Json.414 then + let Json.416 : I32 = 44i64; + let Json.415 : U8 = CallByName Num.123 Json.416; + let Json.412 : List U8 = CallByName List.4 Json.123 Json.415; + jump Json.413 Json.412; else - jump Json.341 Json.113; + jump Json.413 Json.123; -procedure Json.18 (Json.86): - let Json.325 : Str = CallByName Encode.22 Json.86; - ret Json.325; +procedure Json.18 (Json.96): + let Json.445 : Str = CallByName Encode.22 Json.96; + ret Json.445; -procedure Json.20 (Json.102): - let Json.319 : List {Str, Str} = CallByName Encode.22 Json.102; - ret Json.319; +procedure Json.20 (Json.112): + let Json.397 : List {Str, Str} = CallByName Encode.22 Json.112; + ret Json.397; -procedure Json.87 (Json.88, Json.324, Json.86): - let Json.369 : I32 = 34i64; - let Json.368 : U8 = CallByName Num.123 Json.369; - let Json.366 : List U8 = CallByName List.4 Json.88 Json.368; - let Json.367 : List U8 = CallByName Str.12 Json.86; - let Json.363 : List U8 = CallByName List.8 Json.366 Json.367; - let Json.365 : I32 = 34i64; - let Json.364 : U8 = CallByName Num.123 Json.365; - let Json.362 : List U8 = CallByName List.4 Json.363 Json.364; - ret Json.362; +procedure Json.97 (Json.98, Json.435, Json.96): + let Json.444 : I32 = 34i64; + let Json.443 : U8 = CallByName Num.123 Json.444; + let Json.441 : List U8 = CallByName List.4 Json.98 Json.443; + let Json.442 : List U8 = CallByName Str.12 Json.96; + let Json.438 : List U8 = CallByName List.8 Json.441 Json.442; + let Json.440 : I32 = 34i64; + let Json.439 : U8 = CallByName Num.123 Json.440; + let Json.437 : List U8 = CallByName List.4 Json.438 Json.439; + ret Json.437; procedure List.133 (List.134, List.135, List.132): - let List.441 : {List U8, U64} = CallByName Json.105 List.134 List.135; - let List.440 : [C [], C {List U8, U64}] = TagId(1) List.441; - ret List.440; + let List.435 : {List U8, U64} = CallByName Json.115 List.134 List.135; + let List.434 : [C [], C {List U8, U64}] = TagId(1) List.435; + ret List.434; procedure List.18 (List.130, List.131, List.132): - let List.411 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; - let List.414 : U8 = 1i64; - let List.415 : U8 = GetTagId List.411; - let List.416 : Int1 = lowlevel Eq List.414 List.415; - if List.416 then - let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.411; + let List.409 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; + let List.413 : U8 = 1i64; + let List.414 : U8 = GetTagId List.409; + let List.415 : Int1 = lowlevel Eq List.413 List.414; + if List.415 then + let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.409; inc List.137; - dec List.411; + dec List.409; ret List.137; else - let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.411; - dec List.411; - let List.413 : {List U8, U64} = CallByName List.69 List.138; - ret List.413; + let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.409; + dec List.409; + let List.411 : {List U8, U64} = CallByName List.69 List.138; + ret List.411; procedure List.4 (List.101, List.102): - let List.410 : U64 = 1i64; - let List.409 : List U8 = CallByName List.70 List.101 List.410; - let List.408 : List U8 = CallByName List.71 List.409 List.102; - ret List.408; + let List.408 : U64 = 1i64; + let List.407 : List U8 = CallByName List.70 List.101 List.408; + let List.406 : List U8 = CallByName List.71 List.407 List.102; + ret List.406; procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure List.6 (#Attr.2): - let List.420 : U64 = lowlevel ListLen #Attr.2; - ret List.420; + let List.438 : U64 = lowlevel ListLen #Attr.2; + ret List.438; procedure List.66 (#Attr.2, #Attr.3): - let List.439 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.439; + let List.432 : {Str, Str} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.432; procedure List.69 (#Attr.2): - let List.423 : {List U8, U64} = lowlevel Unreachable #Attr.2; - ret List.423; + let List.412 : {List U8, U64} = lowlevel Unreachable #Attr.2; + ret List.412; procedure List.70 (#Attr.2, #Attr.3): - let List.422 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.422; + let List.387 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.387; procedure List.71 (#Attr.2, #Attr.3): - let List.421 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.421; + let List.385 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.385; -procedure List.75 (List.361, List.362, List.363): - let List.425 : U64 = 0i64; - let List.426 : U64 = CallByName List.6 List.361; - let List.424 : [C [], C {List U8, U64}] = CallByName List.86 List.361 List.362 List.363 List.425 List.426; - ret List.424; +procedure List.75 (List.357, List.358, List.359): + let List.418 : U64 = 0i64; + let List.419 : U64 = CallByName List.6 List.357; + let List.417 : [C [], C {List U8, U64}] = CallByName List.86 List.357 List.358 List.359 List.418 List.419; + ret List.417; procedure List.8 (#Attr.2, #Attr.3): - let List.419 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; - ret List.419; + let List.437 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; + ret List.437; -procedure List.86 (List.455, List.456, List.457, List.458, List.459): - joinpoint List.427 List.364 List.365 List.366 List.367 List.368: - let List.429 : Int1 = CallByName Num.22 List.367 List.368; - if List.429 then - let List.438 : {Str, Str} = CallByName List.66 List.364 List.367; - let List.430 : [C [], C {List U8, U64}] = CallByName List.133 List.365 List.438 List.366; - let List.435 : U8 = 1i64; - let List.436 : U8 = GetTagId List.430; - let List.437 : Int1 = lowlevel Eq List.435 List.436; - if List.437 then - let List.369 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.430; - inc List.369; - dec List.430; - let List.433 : U64 = 1i64; - let List.432 : U64 = CallByName Num.19 List.367 List.433; - jump List.427 List.364 List.369 List.366 List.432 List.368; +procedure List.86 (List.449, List.450, List.451, List.452, List.453): + joinpoint List.420 List.360 List.361 List.362 List.363 List.364: + let List.422 : Int1 = CallByName Num.22 List.363 List.364; + if List.422 then + let List.431 : {Str, Str} = CallByName List.66 List.360 List.363; + let List.423 : [C [], C {List U8, U64}] = CallByName List.133 List.361 List.431 List.362; + let List.428 : U8 = 1i64; + let List.429 : U8 = GetTagId List.423; + let List.430 : Int1 = lowlevel Eq List.428 List.429; + if List.430 then + let List.365 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.423; + inc List.365; + dec List.423; + let List.426 : U64 = 1i64; + let List.425 : U64 = CallByName Num.19 List.363 List.426; + jump List.420 List.360 List.365 List.362 List.425 List.364; else - let List.370 : [] = UnionAtIndex (Id 0) (Index 0) List.430; - dec List.430; - let List.434 : [C [], C {List U8, U64}] = TagId(0) List.370; - ret List.434; + let List.366 : [] = UnionAtIndex (Id 0) (Index 0) List.423; + dec List.423; + let List.427 : [C [], C {List U8, U64}] = TagId(0) List.366; + ret List.427; else - let List.428 : [C [], C {List U8, U64}] = TagId(1) List.365; - ret List.428; + let List.421 : [C [], C {List U8, U64}] = TagId(1) List.361; + ret List.421; in - jump List.427 List.455 List.456 List.457 List.458 List.459; + jump List.420 List.449 List.450 List.451 List.452 List.453; procedure Num.123 (#Attr.2): let Num.264 : U8 = lowlevel NumIntCast #Attr.2; @@ -234,31 +234,31 @@ procedure Num.24 (#Attr.2, #Attr.3): ret Num.266; procedure Str.12 (#Attr.2): - let Str.217 : List U8 = lowlevel StrToUtf8 #Attr.2; - ret Str.217; + let Str.266 : List U8 = lowlevel StrToUtf8 #Attr.2; + ret Str.266; procedure Str.48 (#Attr.2, #Attr.3, #Attr.4): - let Str.211 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; - ret Str.211; + let Str.260 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; + ret Str.260; -procedure Str.9 (Str.69): - let Str.209 : U64 = 0i64; - let Str.210 : U64 = CallByName List.6 Str.69; - let Str.70 : {U64, Str, Int1, U8} = CallByName Str.48 Str.69 Str.209 Str.210; - let Str.206 : Int1 = StructAtIndex 2 Str.70; - if Str.206 then - let Str.208 : Str = StructAtIndex 1 Str.70; - inc Str.208; - dec Str.70; - let Str.207 : [C {U64, U8}, C Str] = TagId(1) Str.208; - ret Str.207; +procedure Str.9 (Str.73): + let Str.258 : U64 = 0i64; + let Str.259 : U64 = CallByName List.6 Str.73; + let Str.74 : {U64, Str, Int1, U8} = CallByName Str.48 Str.73 Str.258 Str.259; + let Str.255 : Int1 = StructAtIndex 2 Str.74; + if Str.255 then + let Str.257 : Str = StructAtIndex 1 Str.74; + inc Str.257; + dec Str.74; + let Str.256 : [C {U64, U8}, C Str] = TagId(1) Str.257; + ret Str.256; else - let Str.204 : U8 = StructAtIndex 3 Str.70; - let Str.205 : U64 = StructAtIndex 0 Str.70; - dec Str.70; - let Str.203 : {U64, U8} = Struct {Str.205, Str.204}; - let Str.202 : [C {U64, U8}, C Str] = TagId(0) Str.203; - ret Str.202; + let Str.253 : U8 = StructAtIndex 3 Str.74; + let Str.254 : U64 = StructAtIndex 0 Str.74; + dec Str.74; + let Str.252 : {U64, U8} = Struct {Str.254, Str.253}; + let Str.251 : [C {U64, U8}, C Str] = TagId(0) Str.252; + ret Str.251; procedure Test.0 (): let Test.11 : Str = "foo"; diff --git a/crates/compiler/test_mono/generated/encode_derived_string.txt b/crates/compiler/test_mono/generated/encode_derived_string.txt index 5fd131fd3f..8be74f6f88 100644 --- a/crates/compiler/test_mono/generated/encode_derived_string.txt +++ b/crates/compiler/test_mono/generated/encode_derived_string.txt @@ -2,7 +2,7 @@ procedure Encode.22 (Encode.93): ret Encode.93; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.106 : List U8 = CallByName Json.87 Encode.94 Encode.96 Encode.102; + let Encode.106 : List U8 = CallByName Json.97 Encode.94 Encode.96 Encode.102; ret Encode.106; procedure Encode.25 (Encode.100, Encode.101): @@ -12,76 +12,76 @@ procedure Encode.25 (Encode.100, Encode.101): ret Encode.103; procedure Json.1 (): - let Json.318 : {} = Struct {}; - ret Json.318; + let Json.396 : {} = Struct {}; + ret Json.396; -procedure Json.18 (Json.86): - let Json.319 : Str = CallByName Encode.22 Json.86; - ret Json.319; +procedure Json.18 (Json.96): + let Json.397 : Str = CallByName Encode.22 Json.96; + ret Json.397; -procedure Json.87 (Json.88, Json.321, Json.86): - let Json.330 : I32 = 34i64; - let Json.329 : U8 = CallByName Num.123 Json.330; - let Json.327 : List U8 = CallByName List.4 Json.88 Json.329; - let Json.328 : List U8 = CallByName Str.12 Json.86; - let Json.324 : List U8 = CallByName List.8 Json.327 Json.328; - let Json.326 : I32 = 34i64; - let Json.325 : U8 = CallByName Num.123 Json.326; - let Json.323 : List U8 = CallByName List.4 Json.324 Json.325; - ret Json.323; +procedure Json.97 (Json.98, Json.399, Json.96): + let Json.408 : I32 = 34i64; + let Json.407 : U8 = CallByName Num.123 Json.408; + let Json.405 : List U8 = CallByName List.4 Json.98 Json.407; + let Json.406 : List U8 = CallByName Str.12 Json.96; + let Json.402 : List U8 = CallByName List.8 Json.405 Json.406; + let Json.404 : I32 = 34i64; + let Json.403 : U8 = CallByName Num.123 Json.404; + let Json.401 : List U8 = CallByName List.4 Json.402 Json.403; + ret Json.401; procedure List.4 (List.101, List.102): - let List.392 : U64 = 1i64; - let List.391 : List U8 = CallByName List.70 List.101 List.392; - let List.390 : List U8 = CallByName List.71 List.391 List.102; - ret List.390; + let List.390 : U64 = 1i64; + let List.389 : List U8 = CallByName List.70 List.101 List.390; + let List.388 : List U8 = CallByName List.71 List.389 List.102; + ret List.388; procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure List.70 (#Attr.2, #Attr.3): - let List.395 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.395; + let List.387 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.387; procedure List.71 (#Attr.2, #Attr.3): - let List.394 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.394; + let List.385 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.385; procedure List.8 (#Attr.2, #Attr.3): - let List.393 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; - ret List.393; + let List.391 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; + ret List.391; procedure Num.123 (#Attr.2): let Num.258 : U8 = lowlevel NumIntCast #Attr.2; ret Num.258; procedure Str.12 (#Attr.2): - let Str.216 : List U8 = lowlevel StrToUtf8 #Attr.2; - ret Str.216; + let Str.265 : List U8 = lowlevel StrToUtf8 #Attr.2; + ret Str.265; procedure Str.48 (#Attr.2, #Attr.3, #Attr.4): - let Str.211 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; - ret Str.211; + let Str.260 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; + ret Str.260; -procedure Str.9 (Str.69): - let Str.209 : U64 = 0i64; - let Str.210 : U64 = CallByName List.6 Str.69; - let Str.70 : {U64, Str, Int1, U8} = CallByName Str.48 Str.69 Str.209 Str.210; - let Str.206 : Int1 = StructAtIndex 2 Str.70; - if Str.206 then - let Str.208 : Str = StructAtIndex 1 Str.70; - inc Str.208; - dec Str.70; - let Str.207 : [C {U64, U8}, C Str] = TagId(1) Str.208; - ret Str.207; +procedure Str.9 (Str.73): + let Str.258 : U64 = 0i64; + let Str.259 : U64 = CallByName List.6 Str.73; + let Str.74 : {U64, Str, Int1, U8} = CallByName Str.48 Str.73 Str.258 Str.259; + let Str.255 : Int1 = StructAtIndex 2 Str.74; + if Str.255 then + let Str.257 : Str = StructAtIndex 1 Str.74; + inc Str.257; + dec Str.74; + let Str.256 : [C {U64, U8}, C Str] = TagId(1) Str.257; + ret Str.256; else - let Str.204 : U8 = StructAtIndex 3 Str.70; - let Str.205 : U64 = StructAtIndex 0 Str.70; - dec Str.70; - let Str.203 : {U64, U8} = Struct {Str.205, Str.204}; - let Str.202 : [C {U64, U8}, C Str] = TagId(0) Str.203; - ret Str.202; + let Str.253 : U8 = StructAtIndex 3 Str.74; + let Str.254 : U64 = StructAtIndex 0 Str.74; + dec Str.74; + let Str.252 : {U64, U8} = Struct {Str.254, Str.253}; + let Str.251 : [C {U64, U8}, C Str] = TagId(0) Str.252; + ret Str.251; procedure Test.0 (): let Test.9 : Str = "abc"; diff --git a/crates/compiler/test_mono/generated/encode_derived_tag_one_field_string.txt b/crates/compiler/test_mono/generated/encode_derived_tag_one_field_string.txt index 1dab5efd61..fd02b620e6 100644 --- a/crates/compiler/test_mono/generated/encode_derived_tag_one_field_string.txt +++ b/crates/compiler/test_mono/generated/encode_derived_tag_one_field_string.txt @@ -27,11 +27,11 @@ procedure Encode.23 (Encode.94, Encode.102, Encode.96): ret Encode.106; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.113 : List U8 = CallByName Json.117 Encode.94 Encode.96 Encode.102; + let Encode.113 : List U8 = CallByName Json.127 Encode.94 Encode.96 Encode.102; ret Encode.113; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.116 : List U8 = CallByName Json.87 Encode.94 Encode.96 Encode.102; + let Encode.116 : List U8 = CallByName Json.97 Encode.94 Encode.96 Encode.102; ret Encode.116; procedure Encode.25 (Encode.100, Encode.101): @@ -41,178 +41,178 @@ procedure Encode.25 (Encode.100, Encode.101): ret Encode.103; procedure Json.1 (): - let Json.318 : {} = Struct {}; - ret Json.318; + let Json.396 : {} = Struct {}; + ret Json.396; -procedure Json.117 (Json.118, Json.321, #Attr.12): - let Json.116 : List Str = StructAtIndex 1 #Attr.12; - inc Json.116; - let Json.115 : Str = StructAtIndex 0 #Attr.12; - inc Json.115; +procedure Json.127 (Json.128, Json.399, #Attr.12): + let Json.126 : List Str = StructAtIndex 1 #Attr.12; + inc Json.126; + let Json.125 : Str = StructAtIndex 0 #Attr.12; + inc Json.125; dec #Attr.12; - let Json.362 : I32 = 123i64; - let Json.361 : U8 = CallByName Num.123 Json.362; - let Json.358 : List U8 = CallByName List.4 Json.118 Json.361; - let Json.360 : I32 = 34i64; - let Json.359 : U8 = CallByName Num.123 Json.360; - let Json.356 : List U8 = CallByName List.4 Json.358 Json.359; - let Json.357 : List U8 = CallByName Str.12 Json.115; - let Json.353 : List U8 = CallByName List.8 Json.356 Json.357; - let Json.355 : I32 = 34i64; - let Json.354 : U8 = CallByName Num.123 Json.355; - let Json.350 : List U8 = CallByName List.4 Json.353 Json.354; - let Json.352 : I32 = 58i64; - let Json.351 : U8 = CallByName Num.123 Json.352; - let Json.347 : List U8 = CallByName List.4 Json.350 Json.351; - let Json.349 : I32 = 91i64; - let Json.348 : U8 = CallByName Num.123 Json.349; - let Json.120 : List U8 = CallByName List.4 Json.347 Json.348; - let Json.346 : U64 = CallByName List.6 Json.116; - let Json.334 : {List U8, U64} = Struct {Json.120, Json.346}; - let Json.335 : {} = Struct {}; - let Json.333 : {List U8, U64} = CallByName List.18 Json.116 Json.334 Json.335; - dec Json.116; - let Json.122 : List U8 = StructAtIndex 0 Json.333; - inc Json.122; - dec Json.333; - let Json.332 : I32 = 93i64; - let Json.331 : U8 = CallByName Num.123 Json.332; - let Json.328 : List U8 = CallByName List.4 Json.122 Json.331; - let Json.330 : I32 = 125i64; - let Json.329 : U8 = CallByName Num.123 Json.330; - let Json.327 : List U8 = CallByName List.4 Json.328 Json.329; - ret Json.327; + let Json.437 : I32 = 123i64; + let Json.436 : U8 = CallByName Num.123 Json.437; + let Json.433 : List U8 = CallByName List.4 Json.128 Json.436; + let Json.435 : I32 = 34i64; + let Json.434 : U8 = CallByName Num.123 Json.435; + let Json.431 : List U8 = CallByName List.4 Json.433 Json.434; + let Json.432 : List U8 = CallByName Str.12 Json.125; + let Json.428 : List U8 = CallByName List.8 Json.431 Json.432; + let Json.430 : I32 = 34i64; + let Json.429 : U8 = CallByName Num.123 Json.430; + let Json.425 : List U8 = CallByName List.4 Json.428 Json.429; + let Json.427 : I32 = 58i64; + let Json.426 : U8 = CallByName Num.123 Json.427; + let Json.422 : List U8 = CallByName List.4 Json.425 Json.426; + let Json.424 : I32 = 91i64; + let Json.423 : U8 = CallByName Num.123 Json.424; + let Json.130 : List U8 = CallByName List.4 Json.422 Json.423; + let Json.421 : U64 = CallByName List.6 Json.126; + let Json.409 : {List U8, U64} = Struct {Json.130, Json.421}; + let Json.410 : {} = Struct {}; + let Json.408 : {List U8, U64} = CallByName List.18 Json.126 Json.409 Json.410; + dec Json.126; + let Json.132 : List U8 = StructAtIndex 0 Json.408; + inc Json.132; + dec Json.408; + let Json.407 : I32 = 93i64; + let Json.406 : U8 = CallByName Num.123 Json.407; + let Json.403 : List U8 = CallByName List.4 Json.132 Json.406; + let Json.405 : I32 = 125i64; + let Json.404 : U8 = CallByName Num.123 Json.405; + let Json.402 : List U8 = CallByName List.4 Json.403 Json.404; + ret Json.402; -procedure Json.119 (Json.326, Json.125): - let Json.123 : List U8 = StructAtIndex 0 Json.326; - inc Json.123; - let Json.124 : U64 = StructAtIndex 1 Json.326; - dec Json.326; - let Json.345 : {} = Struct {}; - let Json.126 : List U8 = CallByName Encode.23 Json.123 Json.125 Json.345; - joinpoint Json.340 Json.127: - let Json.338 : U64 = 1i64; - let Json.337 : U64 = CallByName Num.20 Json.124 Json.338; - let Json.336 : {List U8, U64} = Struct {Json.127, Json.337}; - ret Json.336; +procedure Json.129 (Json.401, Json.135): + let Json.133 : List U8 = StructAtIndex 0 Json.401; + inc Json.133; + let Json.134 : U64 = StructAtIndex 1 Json.401; + dec Json.401; + let Json.420 : {} = Struct {}; + let Json.136 : List U8 = CallByName Encode.23 Json.133 Json.135 Json.420; + joinpoint Json.415 Json.137: + let Json.413 : U64 = 1i64; + let Json.412 : U64 = CallByName Num.20 Json.134 Json.413; + let Json.411 : {List U8, U64} = Struct {Json.137, Json.412}; + ret Json.411; in - let Json.344 : U64 = 1i64; - let Json.341 : Int1 = CallByName Num.24 Json.124 Json.344; - if Json.341 then - let Json.343 : I32 = 44i64; - let Json.342 : U8 = CallByName Num.123 Json.343; - let Json.339 : List U8 = CallByName List.4 Json.126 Json.342; - jump Json.340 Json.339; + let Json.419 : U64 = 1i64; + let Json.416 : Int1 = CallByName Num.24 Json.134 Json.419; + if Json.416 then + let Json.418 : I32 = 44i64; + let Json.417 : U8 = CallByName Num.123 Json.418; + let Json.414 : List U8 = CallByName List.4 Json.136 Json.417; + jump Json.415 Json.414; else - jump Json.340 Json.126; + jump Json.415 Json.136; -procedure Json.18 (Json.86): - let Json.322 : Str = CallByName Encode.22 Json.86; - ret Json.322; +procedure Json.18 (Json.96): + let Json.438 : Str = CallByName Encode.22 Json.96; + ret Json.438; -procedure Json.21 (Json.115, Json.116): - let Json.320 : {Str, List Str} = Struct {Json.115, Json.116}; - let Json.319 : {Str, List Str} = CallByName Encode.22 Json.320; - ret Json.319; +procedure Json.21 (Json.125, Json.126): + let Json.398 : {Str, List Str} = Struct {Json.125, Json.126}; + let Json.397 : {Str, List Str} = CallByName Encode.22 Json.398; + ret Json.397; -procedure Json.87 (Json.88, Json.324, Json.86): - let Json.371 : I32 = 34i64; - let Json.370 : U8 = CallByName Num.123 Json.371; - let Json.368 : List U8 = CallByName List.4 Json.88 Json.370; - let Json.369 : List U8 = CallByName Str.12 Json.86; - let Json.365 : List U8 = CallByName List.8 Json.368 Json.369; - let Json.367 : I32 = 34i64; - let Json.366 : U8 = CallByName Num.123 Json.367; - let Json.364 : List U8 = CallByName List.4 Json.365 Json.366; - ret Json.364; +procedure Json.97 (Json.98, Json.440, Json.96): + let Json.449 : I32 = 34i64; + let Json.448 : U8 = CallByName Num.123 Json.449; + let Json.446 : List U8 = CallByName List.4 Json.98 Json.448; + let Json.447 : List U8 = CallByName Str.12 Json.96; + let Json.443 : List U8 = CallByName List.8 Json.446 Json.447; + let Json.445 : I32 = 34i64; + let Json.444 : U8 = CallByName Num.123 Json.445; + let Json.442 : List U8 = CallByName List.4 Json.443 Json.444; + ret Json.442; procedure List.133 (List.134, List.135, List.132): - let List.447 : {List U8, U64} = CallByName Json.119 List.134 List.135; - let List.446 : [C [], C {List U8, U64}] = TagId(1) List.447; - ret List.446; + let List.441 : {List U8, U64} = CallByName Json.129 List.134 List.135; + let List.440 : [C [], C {List U8, U64}] = TagId(1) List.441; + ret List.440; procedure List.18 (List.130, List.131, List.132): - let List.417 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; - let List.420 : U8 = 1i64; - let List.421 : U8 = GetTagId List.417; - let List.422 : Int1 = lowlevel Eq List.420 List.421; - if List.422 then - let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.417; + let List.415 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; + let List.419 : U8 = 1i64; + let List.420 : U8 = GetTagId List.415; + let List.421 : Int1 = lowlevel Eq List.419 List.420; + if List.421 then + let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.415; inc List.137; - dec List.417; + dec List.415; ret List.137; else - let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.417; - dec List.417; - let List.419 : {List U8, U64} = CallByName List.69 List.138; - ret List.419; + let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.415; + dec List.415; + let List.417 : {List U8, U64} = CallByName List.69 List.138; + ret List.417; procedure List.4 (List.101, List.102): - let List.416 : U64 = 1i64; - let List.415 : List U8 = CallByName List.70 List.101 List.416; - let List.414 : List U8 = CallByName List.71 List.415 List.102; - ret List.414; + let List.414 : U64 = 1i64; + let List.413 : List U8 = CallByName List.70 List.101 List.414; + let List.412 : List U8 = CallByName List.71 List.413 List.102; + ret List.412; procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure List.6 (#Attr.2): - let List.424 : U64 = lowlevel ListLen #Attr.2; - ret List.424; + let List.442 : U64 = lowlevel ListLen #Attr.2; + ret List.442; procedure List.66 (#Attr.2, #Attr.3): - let List.445 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.445; + let List.438 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.438; procedure List.69 (#Attr.2): - let List.429 : {List U8, U64} = lowlevel Unreachable #Attr.2; - ret List.429; + let List.418 : {List U8, U64} = lowlevel Unreachable #Attr.2; + ret List.418; procedure List.70 (#Attr.2, #Attr.3): - let List.428 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.428; + let List.387 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.387; procedure List.71 (#Attr.2, #Attr.3): - let List.427 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.427; + let List.385 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.385; -procedure List.75 (List.361, List.362, List.363): - let List.431 : U64 = 0i64; - let List.432 : U64 = CallByName List.6 List.361; - let List.430 : [C [], C {List U8, U64}] = CallByName List.86 List.361 List.362 List.363 List.431 List.432; - ret List.430; +procedure List.75 (List.357, List.358, List.359): + let List.424 : U64 = 0i64; + let List.425 : U64 = CallByName List.6 List.357; + let List.423 : [C [], C {List U8, U64}] = CallByName List.86 List.357 List.358 List.359 List.424 List.425; + ret List.423; procedure List.8 (#Attr.2, #Attr.3): - let List.426 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; - ret List.426; + let List.444 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; + ret List.444; -procedure List.86 (List.461, List.462, List.463, List.464, List.465): - joinpoint List.433 List.364 List.365 List.366 List.367 List.368: - let List.435 : Int1 = CallByName Num.22 List.367 List.368; - if List.435 then - let List.444 : Str = CallByName List.66 List.364 List.367; - let List.436 : [C [], C {List U8, U64}] = CallByName List.133 List.365 List.444 List.366; - let List.441 : U8 = 1i64; - let List.442 : U8 = GetTagId List.436; - let List.443 : Int1 = lowlevel Eq List.441 List.442; - if List.443 then - let List.369 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.436; - inc List.369; - dec List.436; - let List.439 : U64 = 1i64; - let List.438 : U64 = CallByName Num.19 List.367 List.439; - jump List.433 List.364 List.369 List.366 List.438 List.368; +procedure List.86 (List.455, List.456, List.457, List.458, List.459): + joinpoint List.426 List.360 List.361 List.362 List.363 List.364: + let List.428 : Int1 = CallByName Num.22 List.363 List.364; + if List.428 then + let List.437 : Str = CallByName List.66 List.360 List.363; + let List.429 : [C [], C {List U8, U64}] = CallByName List.133 List.361 List.437 List.362; + let List.434 : U8 = 1i64; + let List.435 : U8 = GetTagId List.429; + let List.436 : Int1 = lowlevel Eq List.434 List.435; + if List.436 then + let List.365 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.429; + inc List.365; + dec List.429; + let List.432 : U64 = 1i64; + let List.431 : U64 = CallByName Num.19 List.363 List.432; + jump List.426 List.360 List.365 List.362 List.431 List.364; else - let List.370 : [] = UnionAtIndex (Id 0) (Index 0) List.436; - dec List.436; - let List.440 : [C [], C {List U8, U64}] = TagId(0) List.370; - ret List.440; + let List.366 : [] = UnionAtIndex (Id 0) (Index 0) List.429; + dec List.429; + let List.433 : [C [], C {List U8, U64}] = TagId(0) List.366; + ret List.433; else - let List.434 : [C [], C {List U8, U64}] = TagId(1) List.365; - ret List.434; + let List.427 : [C [], C {List U8, U64}] = TagId(1) List.361; + ret List.427; in - jump List.433 List.461 List.462 List.463 List.464 List.465; + jump List.426 List.455 List.456 List.457 List.458 List.459; procedure Num.123 (#Attr.2): let Num.266 : U8 = lowlevel NumIntCast #Attr.2; @@ -235,31 +235,31 @@ procedure Num.24 (#Attr.2, #Attr.3): ret Num.268; procedure Str.12 (#Attr.2): - let Str.217 : List U8 = lowlevel StrToUtf8 #Attr.2; - ret Str.217; + let Str.266 : List U8 = lowlevel StrToUtf8 #Attr.2; + ret Str.266; procedure Str.48 (#Attr.2, #Attr.3, #Attr.4): - let Str.211 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; - ret Str.211; + let Str.260 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; + ret Str.260; -procedure Str.9 (Str.69): - let Str.209 : U64 = 0i64; - let Str.210 : U64 = CallByName List.6 Str.69; - let Str.70 : {U64, Str, Int1, U8} = CallByName Str.48 Str.69 Str.209 Str.210; - let Str.206 : Int1 = StructAtIndex 2 Str.70; - if Str.206 then - let Str.208 : Str = StructAtIndex 1 Str.70; - inc Str.208; - dec Str.70; - let Str.207 : [C {U64, U8}, C Str] = TagId(1) Str.208; - ret Str.207; +procedure Str.9 (Str.73): + let Str.258 : U64 = 0i64; + let Str.259 : U64 = CallByName List.6 Str.73; + let Str.74 : {U64, Str, Int1, U8} = CallByName Str.48 Str.73 Str.258 Str.259; + let Str.255 : Int1 = StructAtIndex 2 Str.74; + if Str.255 then + let Str.257 : Str = StructAtIndex 1 Str.74; + inc Str.257; + dec Str.74; + let Str.256 : [C {U64, U8}, C Str] = TagId(1) Str.257; + ret Str.256; else - let Str.204 : U8 = StructAtIndex 3 Str.70; - let Str.205 : U64 = StructAtIndex 0 Str.70; - dec Str.70; - let Str.203 : {U64, U8} = Struct {Str.205, Str.204}; - let Str.202 : [C {U64, U8}, C Str] = TagId(0) Str.203; - ret Str.202; + let Str.253 : U8 = StructAtIndex 3 Str.74; + let Str.254 : U64 = StructAtIndex 0 Str.74; + dec Str.74; + let Str.252 : {U64, U8} = Struct {Str.254, Str.253}; + let Str.251 : [C {U64, U8}, C Str] = TagId(0) Str.252; + ret Str.251; procedure Test.0 (): let Test.12 : Str = "foo"; diff --git a/crates/compiler/test_mono/generated/encode_derived_tag_two_payloads_string.txt b/crates/compiler/test_mono/generated/encode_derived_tag_two_payloads_string.txt index 81035c77b5..0d7ed85b9b 100644 --- a/crates/compiler/test_mono/generated/encode_derived_tag_two_payloads_string.txt +++ b/crates/compiler/test_mono/generated/encode_derived_tag_two_payloads_string.txt @@ -33,11 +33,11 @@ procedure Encode.23 (Encode.94, Encode.102, Encode.96): ret Encode.106; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.113 : List U8 = CallByName Json.117 Encode.94 Encode.96 Encode.102; + let Encode.113 : List U8 = CallByName Json.127 Encode.94 Encode.96 Encode.102; ret Encode.113; procedure Encode.23 (Encode.94, Encode.102, Encode.96): - let Encode.117 : List U8 = CallByName Json.87 Encode.94 Encode.96 Encode.102; + let Encode.117 : List U8 = CallByName Json.97 Encode.94 Encode.96 Encode.102; ret Encode.117; procedure Encode.25 (Encode.100, Encode.101): @@ -47,178 +47,178 @@ procedure Encode.25 (Encode.100, Encode.101): ret Encode.103; procedure Json.1 (): - let Json.318 : {} = Struct {}; - ret Json.318; + let Json.396 : {} = Struct {}; + ret Json.396; -procedure Json.117 (Json.118, Json.321, #Attr.12): - let Json.116 : List Str = StructAtIndex 1 #Attr.12; - inc Json.116; - let Json.115 : Str = StructAtIndex 0 #Attr.12; - inc Json.115; +procedure Json.127 (Json.128, Json.399, #Attr.12): + let Json.126 : List Str = StructAtIndex 1 #Attr.12; + inc Json.126; + let Json.125 : Str = StructAtIndex 0 #Attr.12; + inc Json.125; dec #Attr.12; - let Json.365 : I32 = 123i64; - let Json.364 : U8 = CallByName Num.123 Json.365; - let Json.361 : List U8 = CallByName List.4 Json.118 Json.364; - let Json.363 : I32 = 34i64; - let Json.362 : U8 = CallByName Num.123 Json.363; - let Json.359 : List U8 = CallByName List.4 Json.361 Json.362; - let Json.360 : List U8 = CallByName Str.12 Json.115; - let Json.356 : List U8 = CallByName List.8 Json.359 Json.360; - let Json.358 : I32 = 34i64; - let Json.357 : U8 = CallByName Num.123 Json.358; - let Json.353 : List U8 = CallByName List.4 Json.356 Json.357; - let Json.355 : I32 = 58i64; - let Json.354 : U8 = CallByName Num.123 Json.355; - let Json.350 : List U8 = CallByName List.4 Json.353 Json.354; - let Json.352 : I32 = 91i64; - let Json.351 : U8 = CallByName Num.123 Json.352; - let Json.120 : List U8 = CallByName List.4 Json.350 Json.351; - let Json.349 : U64 = CallByName List.6 Json.116; - let Json.337 : {List U8, U64} = Struct {Json.120, Json.349}; - let Json.338 : {} = Struct {}; - let Json.336 : {List U8, U64} = CallByName List.18 Json.116 Json.337 Json.338; - dec Json.116; - let Json.122 : List U8 = StructAtIndex 0 Json.336; - inc Json.122; - dec Json.336; - let Json.335 : I32 = 93i64; - let Json.334 : U8 = CallByName Num.123 Json.335; - let Json.331 : List U8 = CallByName List.4 Json.122 Json.334; - let Json.333 : I32 = 125i64; - let Json.332 : U8 = CallByName Num.123 Json.333; - let Json.330 : List U8 = CallByName List.4 Json.331 Json.332; - ret Json.330; + let Json.437 : I32 = 123i64; + let Json.436 : U8 = CallByName Num.123 Json.437; + let Json.433 : List U8 = CallByName List.4 Json.128 Json.436; + let Json.435 : I32 = 34i64; + let Json.434 : U8 = CallByName Num.123 Json.435; + let Json.431 : List U8 = CallByName List.4 Json.433 Json.434; + let Json.432 : List U8 = CallByName Str.12 Json.125; + let Json.428 : List U8 = CallByName List.8 Json.431 Json.432; + let Json.430 : I32 = 34i64; + let Json.429 : U8 = CallByName Num.123 Json.430; + let Json.425 : List U8 = CallByName List.4 Json.428 Json.429; + let Json.427 : I32 = 58i64; + let Json.426 : U8 = CallByName Num.123 Json.427; + let Json.422 : List U8 = CallByName List.4 Json.425 Json.426; + let Json.424 : I32 = 91i64; + let Json.423 : U8 = CallByName Num.123 Json.424; + let Json.130 : List U8 = CallByName List.4 Json.422 Json.423; + let Json.421 : U64 = CallByName List.6 Json.126; + let Json.409 : {List U8, U64} = Struct {Json.130, Json.421}; + let Json.410 : {} = Struct {}; + let Json.408 : {List U8, U64} = CallByName List.18 Json.126 Json.409 Json.410; + dec Json.126; + let Json.132 : List U8 = StructAtIndex 0 Json.408; + inc Json.132; + dec Json.408; + let Json.407 : I32 = 93i64; + let Json.406 : U8 = CallByName Num.123 Json.407; + let Json.403 : List U8 = CallByName List.4 Json.132 Json.406; + let Json.405 : I32 = 125i64; + let Json.404 : U8 = CallByName Num.123 Json.405; + let Json.402 : List U8 = CallByName List.4 Json.403 Json.404; + ret Json.402; -procedure Json.119 (Json.329, Json.125): - let Json.123 : List U8 = StructAtIndex 0 Json.329; - inc Json.123; - let Json.124 : U64 = StructAtIndex 1 Json.329; - dec Json.329; - let Json.348 : {} = Struct {}; - let Json.126 : List U8 = CallByName Encode.23 Json.123 Json.125 Json.348; - joinpoint Json.343 Json.127: - let Json.341 : U64 = 1i64; - let Json.340 : U64 = CallByName Num.20 Json.124 Json.341; - let Json.339 : {List U8, U64} = Struct {Json.127, Json.340}; - ret Json.339; +procedure Json.129 (Json.401, Json.135): + let Json.133 : List U8 = StructAtIndex 0 Json.401; + inc Json.133; + let Json.134 : U64 = StructAtIndex 1 Json.401; + dec Json.401; + let Json.420 : {} = Struct {}; + let Json.136 : List U8 = CallByName Encode.23 Json.133 Json.135 Json.420; + joinpoint Json.415 Json.137: + let Json.413 : U64 = 1i64; + let Json.412 : U64 = CallByName Num.20 Json.134 Json.413; + let Json.411 : {List U8, U64} = Struct {Json.137, Json.412}; + ret Json.411; in - let Json.347 : U64 = 1i64; - let Json.344 : Int1 = CallByName Num.24 Json.124 Json.347; - if Json.344 then - let Json.346 : I32 = 44i64; - let Json.345 : U8 = CallByName Num.123 Json.346; - let Json.342 : List U8 = CallByName List.4 Json.126 Json.345; - jump Json.343 Json.342; + let Json.419 : U64 = 1i64; + let Json.416 : Int1 = CallByName Num.24 Json.134 Json.419; + if Json.416 then + let Json.418 : I32 = 44i64; + let Json.417 : U8 = CallByName Num.123 Json.418; + let Json.414 : List U8 = CallByName List.4 Json.136 Json.417; + jump Json.415 Json.414; else - jump Json.343 Json.126; + jump Json.415 Json.136; -procedure Json.18 (Json.86): - let Json.325 : Str = CallByName Encode.22 Json.86; - ret Json.325; +procedure Json.18 (Json.96): + let Json.450 : Str = CallByName Encode.22 Json.96; + ret Json.450; -procedure Json.21 (Json.115, Json.116): - let Json.320 : {Str, List Str} = Struct {Json.115, Json.116}; - let Json.319 : {Str, List Str} = CallByName Encode.22 Json.320; - ret Json.319; +procedure Json.21 (Json.125, Json.126): + let Json.398 : {Str, List Str} = Struct {Json.125, Json.126}; + let Json.397 : {Str, List Str} = CallByName Encode.22 Json.398; + ret Json.397; -procedure Json.87 (Json.88, Json.324, Json.86): - let Json.374 : I32 = 34i64; - let Json.373 : U8 = CallByName Num.123 Json.374; - let Json.371 : List U8 = CallByName List.4 Json.88 Json.373; - let Json.372 : List U8 = CallByName Str.12 Json.86; - let Json.368 : List U8 = CallByName List.8 Json.371 Json.372; - let Json.370 : I32 = 34i64; - let Json.369 : U8 = CallByName Num.123 Json.370; - let Json.367 : List U8 = CallByName List.4 Json.368 Json.369; - ret Json.367; +procedure Json.97 (Json.98, Json.440, Json.96): + let Json.449 : I32 = 34i64; + let Json.448 : U8 = CallByName Num.123 Json.449; + let Json.446 : List U8 = CallByName List.4 Json.98 Json.448; + let Json.447 : List U8 = CallByName Str.12 Json.96; + let Json.443 : List U8 = CallByName List.8 Json.446 Json.447; + let Json.445 : I32 = 34i64; + let Json.444 : U8 = CallByName Num.123 Json.445; + let Json.442 : List U8 = CallByName List.4 Json.443 Json.444; + ret Json.442; procedure List.133 (List.134, List.135, List.132): - let List.447 : {List U8, U64} = CallByName Json.119 List.134 List.135; - let List.446 : [C [], C {List U8, U64}] = TagId(1) List.447; - ret List.446; + let List.441 : {List U8, U64} = CallByName Json.129 List.134 List.135; + let List.440 : [C [], C {List U8, U64}] = TagId(1) List.441; + ret List.440; procedure List.18 (List.130, List.131, List.132): - let List.417 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; - let List.420 : U8 = 1i64; - let List.421 : U8 = GetTagId List.417; - let List.422 : Int1 = lowlevel Eq List.420 List.421; - if List.422 then - let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.417; + let List.415 : [C [], C {List U8, U64}] = CallByName List.75 List.130 List.131 List.132; + let List.419 : U8 = 1i64; + let List.420 : U8 = GetTagId List.415; + let List.421 : Int1 = lowlevel Eq List.419 List.420; + if List.421 then + let List.137 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.415; inc List.137; - dec List.417; + dec List.415; ret List.137; else - let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.417; - dec List.417; - let List.419 : {List U8, U64} = CallByName List.69 List.138; - ret List.419; + let List.138 : [] = UnionAtIndex (Id 0) (Index 0) List.415; + dec List.415; + let List.417 : {List U8, U64} = CallByName List.69 List.138; + ret List.417; procedure List.4 (List.101, List.102): - let List.416 : U64 = 1i64; - let List.415 : List U8 = CallByName List.70 List.101 List.416; - let List.414 : List U8 = CallByName List.71 List.415 List.102; - ret List.414; + let List.414 : U64 = 1i64; + let List.413 : List U8 = CallByName List.70 List.101 List.414; + let List.412 : List U8 = CallByName List.71 List.413 List.102; + ret List.412; procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure List.6 (#Attr.2): - let List.424 : U64 = lowlevel ListLen #Attr.2; - ret List.424; + let List.442 : U64 = lowlevel ListLen #Attr.2; + ret List.442; procedure List.66 (#Attr.2, #Attr.3): - let List.445 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.445; + let List.438 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.438; procedure List.69 (#Attr.2): - let List.429 : {List U8, U64} = lowlevel Unreachable #Attr.2; - ret List.429; + let List.418 : {List U8, U64} = lowlevel Unreachable #Attr.2; + ret List.418; procedure List.70 (#Attr.2, #Attr.3): - let List.428 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.428; + let List.387 : List U8 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.387; procedure List.71 (#Attr.2, #Attr.3): - let List.427 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.427; + let List.385 : List U8 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.385; -procedure List.75 (List.361, List.362, List.363): - let List.431 : U64 = 0i64; - let List.432 : U64 = CallByName List.6 List.361; - let List.430 : [C [], C {List U8, U64}] = CallByName List.86 List.361 List.362 List.363 List.431 List.432; - ret List.430; +procedure List.75 (List.357, List.358, List.359): + let List.424 : U64 = 0i64; + let List.425 : U64 = CallByName List.6 List.357; + let List.423 : [C [], C {List U8, U64}] = CallByName List.86 List.357 List.358 List.359 List.424 List.425; + ret List.423; procedure List.8 (#Attr.2, #Attr.3): - let List.426 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; - ret List.426; + let List.444 : List U8 = lowlevel ListConcat #Attr.2 #Attr.3; + ret List.444; -procedure List.86 (List.461, List.462, List.463, List.464, List.465): - joinpoint List.433 List.364 List.365 List.366 List.367 List.368: - let List.435 : Int1 = CallByName Num.22 List.367 List.368; - if List.435 then - let List.444 : Str = CallByName List.66 List.364 List.367; - let List.436 : [C [], C {List U8, U64}] = CallByName List.133 List.365 List.444 List.366; - let List.441 : U8 = 1i64; - let List.442 : U8 = GetTagId List.436; - let List.443 : Int1 = lowlevel Eq List.441 List.442; - if List.443 then - let List.369 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.436; - inc List.369; - dec List.436; - let List.439 : U64 = 1i64; - let List.438 : U64 = CallByName Num.19 List.367 List.439; - jump List.433 List.364 List.369 List.366 List.438 List.368; +procedure List.86 (List.455, List.456, List.457, List.458, List.459): + joinpoint List.426 List.360 List.361 List.362 List.363 List.364: + let List.428 : Int1 = CallByName Num.22 List.363 List.364; + if List.428 then + let List.437 : Str = CallByName List.66 List.360 List.363; + let List.429 : [C [], C {List U8, U64}] = CallByName List.133 List.361 List.437 List.362; + let List.434 : U8 = 1i64; + let List.435 : U8 = GetTagId List.429; + let List.436 : Int1 = lowlevel Eq List.434 List.435; + if List.436 then + let List.365 : {List U8, U64} = UnionAtIndex (Id 1) (Index 0) List.429; + inc List.365; + dec List.429; + let List.432 : U64 = 1i64; + let List.431 : U64 = CallByName Num.19 List.363 List.432; + jump List.426 List.360 List.365 List.362 List.431 List.364; else - let List.370 : [] = UnionAtIndex (Id 0) (Index 0) List.436; - dec List.436; - let List.440 : [C [], C {List U8, U64}] = TagId(0) List.370; - ret List.440; + let List.366 : [] = UnionAtIndex (Id 0) (Index 0) List.429; + dec List.429; + let List.433 : [C [], C {List U8, U64}] = TagId(0) List.366; + ret List.433; else - let List.434 : [C [], C {List U8, U64}] = TagId(1) List.365; - ret List.434; + let List.427 : [C [], C {List U8, U64}] = TagId(1) List.361; + ret List.427; in - jump List.433 List.461 List.462 List.463 List.464 List.465; + jump List.426 List.455 List.456 List.457 List.458 List.459; procedure Num.123 (#Attr.2): let Num.266 : U8 = lowlevel NumIntCast #Attr.2; @@ -241,31 +241,31 @@ procedure Num.24 (#Attr.2, #Attr.3): ret Num.268; procedure Str.12 (#Attr.2): - let Str.217 : List U8 = lowlevel StrToUtf8 #Attr.2; - ret Str.217; + let Str.266 : List U8 = lowlevel StrToUtf8 #Attr.2; + ret Str.266; procedure Str.48 (#Attr.2, #Attr.3, #Attr.4): - let Str.211 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; - ret Str.211; + let Str.260 : {U64, Str, Int1, U8} = lowlevel StrFromUtf8Range #Attr.2 #Attr.3 #Attr.4; + ret Str.260; -procedure Str.9 (Str.69): - let Str.209 : U64 = 0i64; - let Str.210 : U64 = CallByName List.6 Str.69; - let Str.70 : {U64, Str, Int1, U8} = CallByName Str.48 Str.69 Str.209 Str.210; - let Str.206 : Int1 = StructAtIndex 2 Str.70; - if Str.206 then - let Str.208 : Str = StructAtIndex 1 Str.70; - inc Str.208; - dec Str.70; - let Str.207 : [C {U64, U8}, C Str] = TagId(1) Str.208; - ret Str.207; +procedure Str.9 (Str.73): + let Str.258 : U64 = 0i64; + let Str.259 : U64 = CallByName List.6 Str.73; + let Str.74 : {U64, Str, Int1, U8} = CallByName Str.48 Str.73 Str.258 Str.259; + let Str.255 : Int1 = StructAtIndex 2 Str.74; + if Str.255 then + let Str.257 : Str = StructAtIndex 1 Str.74; + inc Str.257; + dec Str.74; + let Str.256 : [C {U64, U8}, C Str] = TagId(1) Str.257; + ret Str.256; else - let Str.204 : U8 = StructAtIndex 3 Str.70; - let Str.205 : U64 = StructAtIndex 0 Str.70; - dec Str.70; - let Str.203 : {U64, U8} = Struct {Str.205, Str.204}; - let Str.202 : [C {U64, U8}, C Str] = TagId(0) Str.203; - ret Str.202; + let Str.253 : U8 = StructAtIndex 3 Str.74; + let Str.254 : U64 = StructAtIndex 0 Str.74; + dec Str.74; + let Str.252 : {U64, U8} = Struct {Str.254, Str.253}; + let Str.251 : [C {U64, U8}, C Str] = TagId(0) Str.252; + ret Str.251; procedure Test.0 (): let Test.13 : Str = "foo"; diff --git a/crates/compiler/test_mono/generated/ir_int_add.txt b/crates/compiler/test_mono/generated/ir_int_add.txt index 6b56056268..0a3a468536 100644 --- a/crates/compiler/test_mono/generated/ir_int_add.txt +++ b/crates/compiler/test_mono/generated/ir_int_add.txt @@ -1,6 +1,6 @@ procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure Num.19 (#Attr.2, #Attr.3): let Num.259 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/issue_2583_specialize_errors_behind_unified_branches.txt b/crates/compiler/test_mono/generated/issue_2583_specialize_errors_behind_unified_branches.txt index ccbd053d38..7630ad155e 100644 --- a/crates/compiler/test_mono/generated/issue_2583_specialize_errors_behind_unified_branches.txt +++ b/crates/compiler/test_mono/generated/issue_2583_specialize_errors_behind_unified_branches.txt @@ -1,77 +1,81 @@ +procedure Bool.2 (): + let Bool.11 : Int1 = true; + ret Bool.11; + procedure Bool.7 (#Attr.2, #Attr.3): - let Bool.9 : Int1 = lowlevel Eq #Attr.2 #Attr.3; - ret Bool.9; + let Bool.12 : Int1 = lowlevel Eq #Attr.2 #Attr.3; + ret Bool.12; procedure List.2 (List.90, List.91): - let List.399 : U64 = CallByName List.6 List.90; - let List.395 : Int1 = CallByName Num.22 List.91 List.399; - if List.395 then - let List.397 : I64 = CallByName List.66 List.90 List.91; - let List.396 : [C {}, C I64] = TagId(1) List.397; - ret List.396; + let List.395 : U64 = CallByName List.6 List.90; + let List.391 : Int1 = CallByName Num.22 List.91 List.395; + if List.391 then + let List.393 : I64 = CallByName List.66 List.90 List.91; + let List.392 : [C {}, C I64] = TagId(1) List.393; + ret List.392; else - let List.394 : {} = Struct {}; - let List.393 : [C {}, C I64] = TagId(0) List.394; - ret List.393; + let List.390 : {} = Struct {}; + let List.389 : [C {}, C I64] = TagId(0) List.390; + ret List.389; procedure List.6 (#Attr.2): - let List.400 : U64 = lowlevel ListLen #Attr.2; - ret List.400; + let List.396 : U64 = lowlevel ListLen #Attr.2; + ret List.396; procedure List.66 (#Attr.2, #Attr.3): - let List.398 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.398; + let List.394 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.394; -procedure List.9 (List.218): - let List.392 : U64 = 0i64; - let List.385 : [C {}, C I64] = CallByName List.2 List.218 List.392; - let List.389 : U8 = 1i64; - let List.390 : U8 = GetTagId List.385; - let List.391 : Int1 = lowlevel Eq List.389 List.390; - if List.391 then - let List.219 : I64 = UnionAtIndex (Id 1) (Index 0) List.385; - let List.386 : [C Int1, C I64] = TagId(1) List.219; - ret List.386; +procedure List.9 (List.214): + let List.388 : U64 = 0i64; + let List.381 : [C {}, C I64] = CallByName List.2 List.214 List.388; + let List.385 : U8 = 1i64; + let List.386 : U8 = GetTagId List.381; + let List.387 : Int1 = lowlevel Eq List.385 List.386; + if List.387 then + let List.215 : I64 = UnionAtIndex (Id 1) (Index 0) List.381; + let List.382 : [C Int1, C I64] = TagId(1) List.215; + ret List.382; else - let List.388 : Int1 = true; - let List.387 : [C Int1, C I64] = TagId(0) List.388; - ret List.387; + let List.384 : Int1 = true; + let List.383 : [C Int1, C I64] = TagId(0) List.384; + ret List.383; procedure Num.22 (#Attr.2, #Attr.3): let Num.257 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; ret Num.257; -procedure Str.27 (Str.89): - let Str.202 : [C Int1, C I64] = CallByName Str.62 Str.89; - ret Str.202; +procedure Str.27 (Str.93): + let Str.251 : [C Int1, C I64] = CallByName Str.66 Str.93; + ret Str.251; procedure Str.47 (#Attr.2): - let Str.210 : {I64, U8} = lowlevel StrToNum #Attr.2; - ret Str.210; + let Str.259 : {I64, U8} = lowlevel StrToNum #Attr.2; + ret Str.259; -procedure Str.62 (Str.190): - let Str.191 : {I64, U8} = CallByName Str.47 Str.190; - let Str.208 : U8 = StructAtIndex 1 Str.191; - let Str.209 : U8 = 0i64; - let Str.205 : Int1 = CallByName Bool.7 Str.208 Str.209; - if Str.205 then - let Str.207 : I64 = StructAtIndex 0 Str.191; - let Str.206 : [C Int1, C I64] = TagId(1) Str.207; - ret Str.206; +procedure Str.66 (Str.222): + let Str.223 : {I64, U8} = CallByName Str.47 Str.222; + let Str.257 : U8 = StructAtIndex 1 Str.223; + let Str.258 : U8 = 0i64; + let Str.254 : Int1 = CallByName Bool.7 Str.257 Str.258; + if Str.254 then + let Str.256 : I64 = StructAtIndex 0 Str.223; + let Str.255 : [C Int1, C I64] = TagId(1) Str.256; + ret Str.255; else - let Str.204 : Int1 = false; - let Str.203 : [C Int1, C I64] = TagId(0) Str.204; - ret Str.203; + let Str.253 : Int1 = false; + let Str.252 : [C Int1, C I64] = TagId(0) Str.253; + ret Str.252; procedure Test.0 (): - let Test.4 : Int1 = true; - if Test.4 then - let Test.6 : List I64 = Array []; - let Test.5 : [C Int1, C I64] = CallByName List.9 Test.6; - dec Test.6; - ret Test.5; + let Test.3 : Int1 = CallByName Bool.2; + if Test.3 then + let Test.5 : List I64 = Array []; + let Test.4 : [C Int1, C I64] = CallByName List.9 Test.5; + dec Test.5; + ret Test.4; else - let Test.3 : Str = ""; - let Test.2 : [C Int1, C I64] = CallByName Str.27 Test.3; - dec Test.3; - ret Test.2; + let Test.2 : Str = ""; + let Test.1 : [C Int1, C I64] = CallByName Str.27 Test.2; + dec Test.2; + ret Test.1; diff --git a/crates/compiler/test_mono/generated/list_append.txt b/crates/compiler/test_mono/generated/list_append.txt index e350fd6aea..7b6b3d8f20 100644 --- a/crates/compiler/test_mono/generated/list_append.txt +++ b/crates/compiler/test_mono/generated/list_append.txt @@ -1,16 +1,16 @@ procedure List.4 (List.101, List.102): - let List.388 : U64 = 1i64; - let List.386 : List I64 = CallByName List.70 List.101 List.388; - let List.385 : List I64 = CallByName List.71 List.386 List.102; - ret List.385; + let List.384 : U64 = 1i64; + let List.382 : List I64 = CallByName List.70 List.101 List.384; + let List.381 : List I64 = CallByName List.71 List.382 List.102; + ret List.381; procedure List.70 (#Attr.2, #Attr.3): - let List.389 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.389; + let List.385 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.385; procedure List.71 (#Attr.2, #Attr.3): - let List.387 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.387; + let List.383 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.383; procedure Test.0 (): let Test.2 : List I64 = Array [1i64]; diff --git a/crates/compiler/test_mono/generated/list_append_closure.txt b/crates/compiler/test_mono/generated/list_append_closure.txt index 39ccb72c57..5042b9fd63 100644 --- a/crates/compiler/test_mono/generated/list_append_closure.txt +++ b/crates/compiler/test_mono/generated/list_append_closure.txt @@ -1,16 +1,16 @@ procedure List.4 (List.101, List.102): - let List.388 : U64 = 1i64; - let List.386 : List I64 = CallByName List.70 List.101 List.388; - let List.385 : List I64 = CallByName List.71 List.386 List.102; - ret List.385; + let List.384 : U64 = 1i64; + let List.382 : List I64 = CallByName List.70 List.101 List.384; + let List.381 : List I64 = CallByName List.71 List.382 List.102; + ret List.381; procedure List.70 (#Attr.2, #Attr.3): - let List.389 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3; - ret List.389; + let List.385 : List I64 = lowlevel ListReserve #Attr.2 #Attr.3; + ret List.385; procedure List.71 (#Attr.2, #Attr.3): - let List.387 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; - ret List.387; + let List.383 : List I64 = lowlevel ListAppendUnsafe #Attr.2 #Attr.3; + ret List.383; procedure Test.1 (Test.2): let Test.6 : I64 = 42i64; diff --git a/crates/compiler/test_mono/generated/list_cannot_update_inplace.txt b/crates/compiler/test_mono/generated/list_cannot_update_inplace.txt index fb0edd59df..2d43d4aab6 100644 --- a/crates/compiler/test_mono/generated/list_cannot_update_inplace.txt +++ b/crates/compiler/test_mono/generated/list_cannot_update_inplace.txt @@ -1,27 +1,27 @@ procedure List.3 (List.98, List.99, List.100): - let List.388 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100; - let List.387 : List I64 = StructAtIndex 0 List.388; - inc List.387; - dec List.388; - ret List.387; + let List.384 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100; + let List.383 : List I64 = StructAtIndex 0 List.384; + inc List.383; + dec List.384; + ret List.383; procedure List.6 (#Attr.2): - let List.386 : U64 = lowlevel ListLen #Attr.2; - ret List.386; + let List.382 : U64 = lowlevel ListLen #Attr.2; + ret List.382; procedure List.64 (List.95, List.96, List.97): - let List.393 : U64 = CallByName List.6 List.95; - let List.390 : Int1 = CallByName Num.22 List.96 List.393; - if List.390 then - let List.391 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97; - ret List.391; + let List.389 : U64 = CallByName List.6 List.95; + let List.386 : Int1 = CallByName Num.22 List.96 List.389; + if List.386 then + let List.387 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97; + ret List.387; else - let List.389 : {List I64, I64} = Struct {List.95, List.97}; - ret List.389; + let List.385 : {List I64, I64} = Struct {List.95, List.97}; + ret List.385; procedure List.67 (#Attr.2, #Attr.3, #Attr.4): - let List.392 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; - ret List.392; + let List.388 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; + ret List.388; procedure Num.19 (#Attr.2, #Attr.3): let Num.257 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/list_get.txt b/crates/compiler/test_mono/generated/list_get.txt index a6d352d43e..272cbd8cd4 100644 --- a/crates/compiler/test_mono/generated/list_get.txt +++ b/crates/compiler/test_mono/generated/list_get.txt @@ -1,22 +1,22 @@ procedure List.2 (List.90, List.91): - let List.390 : U64 = CallByName List.6 List.90; - let List.387 : Int1 = CallByName Num.22 List.91 List.390; - if List.387 then - let List.389 : I64 = CallByName List.66 List.90 List.91; - let List.388 : [C {}, C I64] = TagId(1) List.389; - ret List.388; + let List.387 : U64 = CallByName List.6 List.90; + let List.383 : Int1 = CallByName Num.22 List.91 List.387; + if List.383 then + let List.385 : I64 = CallByName List.66 List.90 List.91; + let List.384 : [C {}, C I64] = TagId(1) List.385; + ret List.384; else - let List.386 : {} = Struct {}; - let List.385 : [C {}, C I64] = TagId(0) List.386; - ret List.385; + let List.382 : {} = Struct {}; + let List.381 : [C {}, C I64] = TagId(0) List.382; + ret List.381; procedure List.6 (#Attr.2): - let List.392 : U64 = lowlevel ListLen #Attr.2; - ret List.392; + let List.388 : U64 = lowlevel ListLen #Attr.2; + ret List.388; procedure List.66 (#Attr.2, #Attr.3): - let List.391 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.391; + let List.386 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.386; procedure Num.22 (#Attr.2, #Attr.3): let Num.257 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/list_len.txt b/crates/compiler/test_mono/generated/list_len.txt index 6401dd667d..771d479227 100644 --- a/crates/compiler/test_mono/generated/list_len.txt +++ b/crates/compiler/test_mono/generated/list_len.txt @@ -1,10 +1,10 @@ procedure List.6 (#Attr.2): - let List.385 : U64 = lowlevel ListLen #Attr.2; - ret List.385; + let List.381 : U64 = lowlevel ListLen #Attr.2; + ret List.381; procedure List.6 (#Attr.2): - let List.386 : U64 = lowlevel ListLen #Attr.2; - ret List.386; + let List.382 : U64 = lowlevel ListLen #Attr.2; + ret List.382; procedure Num.19 (#Attr.2, #Attr.3): let Num.257 : U64 = lowlevel NumAdd #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/list_map_closure_borrows.txt b/crates/compiler/test_mono/generated/list_map_closure_borrows.txt index ec453f3360..ff24fdf4c8 100644 --- a/crates/compiler/test_mono/generated/list_map_closure_borrows.txt +++ b/crates/compiler/test_mono/generated/list_map_closure_borrows.txt @@ -1,38 +1,38 @@ procedure List.2 (List.90, List.91): - let List.390 : U64 = CallByName List.6 List.90; - let List.387 : Int1 = CallByName Num.22 List.91 List.390; - if List.387 then - let List.389 : Str = CallByName List.66 List.90 List.91; - let List.388 : [C {}, C Str] = TagId(1) List.389; - ret List.388; + let List.387 : U64 = CallByName List.6 List.90; + let List.383 : Int1 = CallByName Num.22 List.91 List.387; + if List.383 then + let List.385 : Str = CallByName List.66 List.90 List.91; + let List.384 : [C {}, C Str] = TagId(1) List.385; + ret List.384; else - let List.386 : {} = Struct {}; - let List.385 : [C {}, C Str] = TagId(0) List.386; - ret List.385; + let List.382 : {} = Struct {}; + let List.381 : [C {}, C Str] = TagId(0) List.382; + ret List.381; procedure List.5 (#Attr.2, #Attr.3): - let List.391 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3; - ret List.391; + let List.389 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3; + ret List.389; procedure List.6 (#Attr.2): - let List.393 : U64 = lowlevel ListLen #Attr.2; - ret List.393; + let List.388 : U64 = lowlevel ListLen #Attr.2; + ret List.388; procedure List.66 (#Attr.2, #Attr.3): - let List.392 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.392; + let List.386 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.386; procedure Num.22 (#Attr.2, #Attr.3): let Num.257 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; ret Num.257; procedure Str.16 (#Attr.2, #Attr.3): - let Str.202 : Str = lowlevel StrRepeat #Attr.2 #Attr.3; - ret Str.202; + let Str.251 : Str = lowlevel StrRepeat #Attr.2 #Attr.3; + ret Str.251; procedure Str.3 (#Attr.2, #Attr.3): - let Str.203 : Str = lowlevel StrConcat #Attr.2 #Attr.3; - ret Str.203; + let Str.252 : Str = lowlevel StrConcat #Attr.2 #Attr.3; + ret Str.252; procedure Test.1 (): let Test.21 : Str = "lllllllllllllllllllllooooooooooong"; diff --git a/crates/compiler/test_mono/generated/list_map_closure_owns.txt b/crates/compiler/test_mono/generated/list_map_closure_owns.txt index 2cd40864a0..7767b1594c 100644 --- a/crates/compiler/test_mono/generated/list_map_closure_owns.txt +++ b/crates/compiler/test_mono/generated/list_map_closure_owns.txt @@ -1,36 +1,36 @@ procedure List.2 (List.90, List.91): - let List.390 : U64 = CallByName List.6 List.90; - let List.387 : Int1 = CallByName Num.22 List.91 List.390; - if List.387 then - let List.389 : Str = CallByName List.66 List.90 List.91; - let List.388 : [C {}, C Str] = TagId(1) List.389; - ret List.388; + let List.387 : U64 = CallByName List.6 List.90; + let List.383 : Int1 = CallByName Num.22 List.91 List.387; + if List.383 then + let List.385 : Str = CallByName List.66 List.90 List.91; + let List.384 : [C {}, C Str] = TagId(1) List.385; + ret List.384; else - let List.386 : {} = Struct {}; - let List.385 : [C {}, C Str] = TagId(0) List.386; - ret List.385; + let List.382 : {} = Struct {}; + let List.381 : [C {}, C Str] = TagId(0) List.382; + ret List.381; procedure List.5 (#Attr.2, #Attr.3): inc #Attr.2; - let List.391 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3; + let List.389 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3; decref #Attr.2; - ret List.391; + ret List.389; procedure List.6 (#Attr.2): - let List.393 : U64 = lowlevel ListLen #Attr.2; - ret List.393; + let List.388 : U64 = lowlevel ListLen #Attr.2; + ret List.388; procedure List.66 (#Attr.2, #Attr.3): - let List.392 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.392; + let List.386 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.386; procedure Num.22 (#Attr.2, #Attr.3): let Num.257 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; ret Num.257; procedure Str.3 (#Attr.2, #Attr.3): - let Str.203 : Str = lowlevel StrConcat #Attr.2 #Attr.3; - ret Str.203; + let Str.252 : Str = lowlevel StrConcat #Attr.2 #Attr.3; + ret Str.252; procedure Test.1 (): let Test.21 : Str = "lllllllllllllllllllllooooooooooong"; diff --git a/crates/compiler/test_mono/generated/list_pass_to_function.txt b/crates/compiler/test_mono/generated/list_pass_to_function.txt index b49095993b..5d4c1098f3 100644 --- a/crates/compiler/test_mono/generated/list_pass_to_function.txt +++ b/crates/compiler/test_mono/generated/list_pass_to_function.txt @@ -1,27 +1,27 @@ procedure List.3 (List.98, List.99, List.100): - let List.386 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100; - let List.385 : List I64 = StructAtIndex 0 List.386; - inc List.385; - dec List.386; - ret List.385; + let List.382 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100; + let List.381 : List I64 = StructAtIndex 0 List.382; + inc List.381; + dec List.382; + ret List.381; procedure List.6 (#Attr.2): - let List.392 : U64 = lowlevel ListLen #Attr.2; - ret List.392; + let List.388 : U64 = lowlevel ListLen #Attr.2; + ret List.388; procedure List.64 (List.95, List.96, List.97): - let List.391 : U64 = CallByName List.6 List.95; - let List.388 : Int1 = CallByName Num.22 List.96 List.391; - if List.388 then - let List.389 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97; - ret List.389; + let List.387 : U64 = CallByName List.6 List.95; + let List.384 : Int1 = CallByName Num.22 List.96 List.387; + if List.384 then + let List.385 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97; + ret List.385; else - let List.387 : {List I64, I64} = Struct {List.95, List.97}; - ret List.387; + let List.383 : {List I64, I64} = Struct {List.95, List.97}; + ret List.383; procedure List.67 (#Attr.2, #Attr.3, #Attr.4): - let List.390 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; - ret List.390; + let List.386 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; + ret List.386; procedure Num.22 (#Attr.2, #Attr.3): let Num.257 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/list_sort_asc.txt b/crates/compiler/test_mono/generated/list_sort_asc.txt index a824deb62c..4fe3b9e089 100644 --- a/crates/compiler/test_mono/generated/list_sort_asc.txt +++ b/crates/compiler/test_mono/generated/list_sort_asc.txt @@ -1,16 +1,16 @@ procedure List.28 (#Attr.2, #Attr.3): - let List.387 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3; + let List.383 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3; let #Derived_gen.0 : Int1 = lowlevel ListIsUnique #Attr.2; if #Derived_gen.0 then - ret List.387; + ret List.383; else decref #Attr.2; - ret List.387; + ret List.383; -procedure List.59 (List.213): - let List.386 : {} = Struct {}; - let List.385 : List I64 = CallByName List.28 List.213 List.386; - ret List.385; +procedure List.59 (List.209): + let List.382 : {} = Struct {}; + let List.381 : List I64 = CallByName List.28 List.209 List.382; + ret List.381; procedure Num.46 (#Attr.2, #Attr.3): let Num.257 : U8 = lowlevel NumCompare #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/quicksort_swap.txt b/crates/compiler/test_mono/generated/quicksort_swap.txt index 475a7f21d4..71f841bdb4 100644 --- a/crates/compiler/test_mono/generated/quicksort_swap.txt +++ b/crates/compiler/test_mono/generated/quicksort_swap.txt @@ -1,43 +1,43 @@ procedure List.2 (List.90, List.91): - let List.400 : U64 = CallByName List.6 List.90; - let List.397 : Int1 = CallByName Num.22 List.91 List.400; - if List.397 then - let List.399 : I64 = CallByName List.66 List.90 List.91; - let List.398 : [C {}, C I64] = TagId(1) List.399; - ret List.398; + let List.403 : U64 = CallByName List.6 List.90; + let List.400 : Int1 = CallByName Num.22 List.91 List.403; + if List.400 then + let List.402 : I64 = CallByName List.66 List.90 List.91; + let List.401 : [C {}, C I64] = TagId(1) List.402; + ret List.401; else - let List.396 : {} = Struct {}; - let List.395 : [C {}, C I64] = TagId(0) List.396; - ret List.395; + let List.399 : {} = Struct {}; + let List.398 : [C {}, C I64] = TagId(0) List.399; + ret List.398; procedure List.3 (List.98, List.99, List.100): - let List.388 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100; - let List.387 : List I64 = StructAtIndex 0 List.388; - inc List.387; - dec List.388; - ret List.387; + let List.390 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100; + let List.389 : List I64 = StructAtIndex 0 List.390; + inc List.389; + dec List.390; + ret List.389; procedure List.6 (#Attr.2): - let List.406 : U64 = lowlevel ListLen #Attr.2; - ret List.406; + let List.388 : U64 = lowlevel ListLen #Attr.2; + ret List.388; procedure List.64 (List.95, List.96, List.97): - let List.405 : U64 = CallByName List.6 List.95; - let List.402 : Int1 = CallByName Num.22 List.96 List.405; - if List.402 then - let List.403 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97; - ret List.403; + let List.387 : U64 = CallByName List.6 List.95; + let List.384 : Int1 = CallByName Num.22 List.96 List.387; + if List.384 then + let List.385 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97; + ret List.385; else - let List.401 : {List I64, I64} = Struct {List.95, List.97}; - ret List.401; + let List.383 : {List I64, I64} = Struct {List.95, List.97}; + ret List.383; procedure List.66 (#Attr.2, #Attr.3): - let List.407 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.407; + let List.396 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.396; procedure List.67 (#Attr.2, #Attr.3, #Attr.4): - let List.404 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; - ret List.404; + let List.386 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; + ret List.386; procedure Num.22 (#Attr.2, #Attr.3): let Num.259 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/rigids.txt b/crates/compiler/test_mono/generated/rigids.txt index 95cb00abaa..14fc57e1ba 100644 --- a/crates/compiler/test_mono/generated/rigids.txt +++ b/crates/compiler/test_mono/generated/rigids.txt @@ -1,43 +1,43 @@ procedure List.2 (List.90, List.91): - let List.400 : U64 = CallByName List.6 List.90; - let List.397 : Int1 = CallByName Num.22 List.91 List.400; - if List.397 then - let List.399 : I64 = CallByName List.66 List.90 List.91; - let List.398 : [C {}, C I64] = TagId(1) List.399; - ret List.398; + let List.403 : U64 = CallByName List.6 List.90; + let List.400 : Int1 = CallByName Num.22 List.91 List.403; + if List.400 then + let List.402 : I64 = CallByName List.66 List.90 List.91; + let List.401 : [C {}, C I64] = TagId(1) List.402; + ret List.401; else - let List.396 : {} = Struct {}; - let List.395 : [C {}, C I64] = TagId(0) List.396; - ret List.395; + let List.399 : {} = Struct {}; + let List.398 : [C {}, C I64] = TagId(0) List.399; + ret List.398; procedure List.3 (List.98, List.99, List.100): - let List.388 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100; - let List.387 : List I64 = StructAtIndex 0 List.388; - inc List.387; - dec List.388; - ret List.387; + let List.390 : {List I64, I64} = CallByName List.64 List.98 List.99 List.100; + let List.389 : List I64 = StructAtIndex 0 List.390; + inc List.389; + dec List.390; + ret List.389; procedure List.6 (#Attr.2): - let List.406 : U64 = lowlevel ListLen #Attr.2; - ret List.406; + let List.388 : U64 = lowlevel ListLen #Attr.2; + ret List.388; procedure List.64 (List.95, List.96, List.97): - let List.405 : U64 = CallByName List.6 List.95; - let List.402 : Int1 = CallByName Num.22 List.96 List.405; - if List.402 then - let List.403 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97; - ret List.403; + let List.387 : U64 = CallByName List.6 List.95; + let List.384 : Int1 = CallByName Num.22 List.96 List.387; + if List.384 then + let List.385 : {List I64, I64} = CallByName List.67 List.95 List.96 List.97; + ret List.385; else - let List.401 : {List I64, I64} = Struct {List.95, List.97}; - ret List.401; + let List.383 : {List I64, I64} = Struct {List.95, List.97}; + ret List.383; procedure List.66 (#Attr.2, #Attr.3): - let List.407 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.407; + let List.396 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.396; procedure List.67 (#Attr.2, #Attr.3, #Attr.4): - let List.404 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; - ret List.404; + let List.386 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; + ret List.386; procedure Num.22 (#Attr.2, #Attr.3): let Num.259 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;