From 557ae4dd9cefcbc95220494b22d138269d484e93 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Mon, 4 Jul 2022 14:57:18 +0100 Subject: [PATCH 1/8] builtins: Implement List.mapWithIndex in pure Roc --- crates/compiler/builtins/roc/List.roc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/crates/compiler/builtins/roc/List.roc b/crates/compiler/builtins/roc/List.roc index 0732b392f9..1e07bb4094 100644 --- a/crates/compiler/builtins/roc/List.roc +++ b/crates/compiler/builtins/roc/List.roc @@ -570,6 +570,23 @@ map4 : List a, List b, List c, List d, (a, b, c, d -> e) -> List e ## This works like [List.map], except it also passes the index ## of the element to the conversion function. mapWithIndex : List a, (a, Nat -> b) -> List b +mapWithIndex = \src, func -> + length = len src + dest = withCapacity length + + mapWithIndexHelp src dest func 0 length + +# Internal helper +mapWithIndexHelp : List a, List b, (a, Nat -> b), Nat, Nat -> List b +mapWithIndexHelp = \src, dest, func, index, length -> + if index < length then + elem = getUnsafe src index + mappedElem = func elem index + newDest = append dest mappedElem + + mapWithIndexHelp src newDest func (index + 1) length + else + dest ## Returns a list of all the integers between one and another, ## including both of the given numbers. From a129e0458c7d20ce1931353d1ccea599fd92345e Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Mon, 4 Jul 2022 15:06:45 +0100 Subject: [PATCH 2/8] can: delete AST implementation of List.mapWithIndex --- crates/compiler/can/src/builtins.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/crates/compiler/can/src/builtins.rs b/crates/compiler/can/src/builtins.rs index b86eec10c2..e1b0ec47bd 100644 --- a/crates/compiler/can/src/builtins.rs +++ b/crates/compiler/can/src/builtins.rs @@ -118,7 +118,6 @@ pub fn builtin_defs_map(symbol: Symbol, var_store: &mut VarStore) -> Option LIST_DROP => list_drop, LIST_DROP_AT => list_drop_at, LIST_SWAP => list_swap, - LIST_MAP_WITH_INDEX => list_map_with_index, LIST_SORT_WITH => list_sort_with, LIST_IS_UNIQUE => list_is_unique, DICT_LEN => dict_len, @@ -2392,11 +2391,6 @@ fn list_map(symbol: Symbol, var_store: &mut VarStore) -> Def { lowlevel_2(symbol, LowLevel::ListMap, var_store) } -/// List.mapWithIndex : List before, (before, Nat -> after) -> List after -fn list_map_with_index(symbol: Symbol, var_store: &mut VarStore) -> Def { - lowlevel_2(symbol, LowLevel::ListMapWithIndex, var_store) -} - /// List.map2 : List a, List b, (a, b -> c) -> List c fn list_map2(symbol: Symbol, var_store: &mut VarStore) -> Def { lowlevel_3(symbol, LowLevel::ListMap2, var_store) From eb2ac4c82b97ea35b9bb1e67f81f9f9073bd8a93 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Mon, 4 Jul 2022 15:07:12 +0100 Subject: [PATCH 3/8] module: delete LowLevel enum variant ListMapWithIndex --- crates/compiler/gen_llvm/src/llvm/build.rs | 2 +- crates/compiler/gen_wasm/src/low_level.rs | 2 +- crates/compiler/module/src/low_level.rs | 5 +---- crates/compiler/mono/src/borrow.rs | 2 +- crates/compiler/mono/src/ir.rs | 6 ------ 5 files changed, 4 insertions(+), 13 deletions(-) diff --git a/crates/compiler/gen_llvm/src/llvm/build.rs b/crates/compiler/gen_llvm/src/llvm/build.rs index 06b6c1ee05..0f9f042490 100644 --- a/crates/compiler/gen_llvm/src/llvm/build.rs +++ b/crates/compiler/gen_llvm/src/llvm/build.rs @@ -5976,7 +5976,7 @@ fn run_low_level<'a, 'ctx, 'env>( set } - ListMap | ListMap2 | ListMap3 | ListMap4 | ListMapWithIndex | ListSortWith | DictWalk => { + ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith | DictWalk => { unreachable!("these are higher order, and are handled elsewhere") } diff --git a/crates/compiler/gen_wasm/src/low_level.rs b/crates/compiler/gen_wasm/src/low_level.rs index f5a81afe5e..032765e1d9 100644 --- a/crates/compiler/gen_wasm/src/low_level.rs +++ b/crates/compiler/gen_wasm/src/low_level.rs @@ -301,7 +301,7 @@ impl<'a> LowLevelCall<'a> { ListIsUnique => self.load_args_and_call_zig(backend, bitcode::LIST_IS_UNIQUE), - ListMap | ListMap2 | ListMap3 | ListMap4 | ListMapWithIndex | ListSortWith + ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith | DictWalk => { internal_error!("HigherOrder lowlevels should not be handled here") } diff --git a/crates/compiler/module/src/low_level.rs b/crates/compiler/module/src/low_level.rs index d008fcf4b7..18d379b9d5 100644 --- a/crates/compiler/module/src/low_level.rs +++ b/crates/compiler/module/src/low_level.rs @@ -35,7 +35,6 @@ pub enum LowLevel { ListMap2, ListMap3, ListMap4, - ListMapWithIndex, ListSortWith, ListSublist, ListDropAt, @@ -120,7 +119,7 @@ pub enum LowLevel { macro_rules! higher_order { () => { - ListMap | ListMap2 | ListMap3 | ListMap4 | ListMapWithIndex | ListSortWith | DictWalk + ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith | DictWalk }; } @@ -141,7 +140,6 @@ impl LowLevel { ListMap2 => 2, ListMap3 => 3, ListMap4 => 4, - ListMapWithIndex => 1, ListSortWith => 1, DictWalk => 2, _ => unreachable!(), @@ -206,7 +204,6 @@ impl LowLevelWrapperType { Symbol::LIST_MAP2 => WrapperIsRequired, Symbol::LIST_MAP3 => WrapperIsRequired, Symbol::LIST_MAP4 => WrapperIsRequired, - Symbol::LIST_MAP_WITH_INDEX => WrapperIsRequired, Symbol::LIST_SORT_WITH => WrapperIsRequired, Symbol::LIST_SUBLIST => WrapperIsRequired, Symbol::LIST_DROP_AT => CanBeReplacedBy(ListDropAt), diff --git a/crates/compiler/mono/src/borrow.rs b/crates/compiler/mono/src/borrow.rs index 3ec6f0f689..46aa193573 100644 --- a/crates/compiler/mono/src/borrow.rs +++ b/crates/compiler/mono/src/borrow.rs @@ -906,7 +906,7 @@ pub fn lowlevel_borrow_signature(arena: &Bump, op: LowLevel) -> &[bool] { StrToNum => arena.alloc_slice_copy(&[borrowed]), ListPrepend => arena.alloc_slice_copy(&[owned, owned]), StrJoinWith => arena.alloc_slice_copy(&[borrowed, borrowed]), - ListMap | ListMapWithIndex => arena.alloc_slice_copy(&[owned, function, closure_data]), + ListMap => arena.alloc_slice_copy(&[owned, function, closure_data]), ListMap2 => arena.alloc_slice_copy(&[owned, owned, function, closure_data]), ListMap3 => arena.alloc_slice_copy(&[owned, owned, owned, function, closure_data]), ListMap4 => arena.alloc_slice_copy(&[owned, owned, owned, owned, function, closure_data]), diff --git a/crates/compiler/mono/src/ir.rs b/crates/compiler/mono/src/ir.rs index f38e2c3082..526890cde3 100644 --- a/crates/compiler/mono/src/ir.rs +++ b/crates/compiler/mono/src/ir.rs @@ -5108,12 +5108,6 @@ pub fn with_hole<'a>( let xs = arg_symbols[0]; match_on_closure_argument!(ListMap, [xs]) } - - ListMapWithIndex => { - debug_assert_eq!(arg_symbols.len(), 2); - let xs = arg_symbols[0]; - match_on_closure_argument!(ListMapWithIndex, [xs]) - } ListSortWith => { debug_assert_eq!(arg_symbols.len(), 2); let xs = arg_symbols[0]; From a5a85d7d7365203d5168716c9625808a5c9b7822 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Mon, 4 Jul 2022 15:10:31 +0100 Subject: [PATCH 4/8] mono: delete HigherOrder variant ListMapWithIndex --- crates/compiler/alias_analysis/src/lib.rs | 28 ----------------- crates/compiler/gen_llvm/src/llvm/build.rs | 35 ++-------------------- crates/compiler/gen_wasm/src/low_level.rs | 2 +- crates/compiler/mono/src/borrow.rs | 7 ----- crates/compiler/mono/src/inc_dec.rs | 11 ------- crates/compiler/mono/src/low_level.rs | 6 +--- 6 files changed, 5 insertions(+), 84 deletions(-) diff --git a/crates/compiler/alias_analysis/src/lib.rs b/crates/compiler/alias_analysis/src/lib.rs index b1157d8059..b00c712ad2 100644 --- a/crates/compiler/alias_analysis/src/lib.rs +++ b/crates/compiler/alias_analysis/src/lib.rs @@ -758,34 +758,6 @@ fn call_spec( add_loop(builder, block, state_type, init_state, loop_body) } - // List.mapWithIndex : List before, (before, Nat -> after) -> List after - ListMapWithIndex { xs } => { - let list = env.symbols[xs]; - - let loop_body = |builder: &mut FuncDefBuilder, block, state| { - let input_bag = builder.add_get_tuple_field(block, list, LIST_BAG_INDEX)?; - - let element = builder.add_bag_get(block, input_bag)?; - let index = builder.add_make_tuple(block, &[])?; - - // before, Nat -> after - let new_element = call_function!(builder, block, [element, index]); - - list_append(builder, block, update_mode_var, state, new_element) - }; - - let output_element_type = - layout_spec(builder, return_layout, &WhenRecursive::Unreachable)?; - - let state_layout = Layout::Builtin(Builtin::List(return_layout)); - let state_type = - layout_spec(builder, &state_layout, &WhenRecursive::Unreachable)?; - - let init_state = new_list(builder, block, output_element_type)?; - - add_loop(builder, block, state_type, init_state, loop_body) - } - ListMap { xs } => { let list = env.symbols[xs]; diff --git a/crates/compiler/gen_llvm/src/llvm/build.rs b/crates/compiler/gen_llvm/src/llvm/build.rs index 0f9f042490..38704ea2ca 100644 --- a/crates/compiler/gen_llvm/src/llvm/build.rs +++ b/crates/compiler/gen_llvm/src/llvm/build.rs @@ -9,9 +9,9 @@ use crate::llvm::build_dict::{ use crate::llvm::build_hash::generic_hash; use crate::llvm::build_list::{ self, allocate_list, empty_polymorphic_list, list_append, list_concat, list_drop_at, - list_get_unsafe, list_len, list_map, list_map2, list_map3, list_map4, list_map_with_index, - list_prepend, list_replace_unsafe, list_sort_with, list_sublist, list_swap, - list_symbol_to_c_abi, list_to_c_abi, list_with_capacity, + list_get_unsafe, list_len, list_map, list_map2, list_map3, list_map4, list_prepend, + list_replace_unsafe, list_sort_with, list_sublist, list_swap, list_symbol_to_c_abi, + list_to_c_abi, list_with_capacity, }; use crate::llvm::build_str::{ str_from_float, str_from_int, str_from_utf8, str_from_utf8_range, str_split, @@ -5083,35 +5083,6 @@ fn run_higher_order_low_level<'a, 'ctx, 'env>( _ => unreachable!("invalid list layout"), } } - ListMapWithIndex { xs } => { - // List.mapWithIndex : List before, (before, Nat -> after) -> List after - let (list, list_layout) = load_symbol_and_layout(scope, xs); - - let (function, closure, closure_layout) = function_details!(); - - match (list_layout, return_layout) { - ( - Layout::Builtin(Builtin::List(element_layout)), - Layout::Builtin(Builtin::List(result_layout)), - ) => { - let argument_layouts = &[**element_layout, Layout::usize(env.target_info)]; - - let roc_function_call = roc_function_call( - env, - layout_ids, - function, - closure, - closure_layout, - function_owns_closure_data, - argument_layouts, - **result_layout, - ); - - list_map_with_index(env, roc_function_call, list, element_layout, result_layout) - } - _ => unreachable!("invalid list layout"), - } - } ListSortWith { xs } => { // List.sortWith : List a, (a, a -> Ordering) -> List a let (list, list_layout) = load_symbol_and_layout(scope, xs); diff --git a/crates/compiler/gen_wasm/src/low_level.rs b/crates/compiler/gen_wasm/src/low_level.rs index 032765e1d9..13912250d3 100644 --- a/crates/compiler/gen_wasm/src/low_level.rs +++ b/crates/compiler/gen_wasm/src/low_level.rs @@ -2072,7 +2072,7 @@ pub fn call_higher_order_lowlevel<'a>( *owns_captured_environment, ), - ListMapWithIndex { .. } | ListSortWith { .. } | DictWalk { .. } => todo!("{:?}", op), + ListSortWith { .. } | DictWalk { .. } => todo!("{:?}", op), } } diff --git a/crates/compiler/mono/src/borrow.rs b/crates/compiler/mono/src/borrow.rs index 46aa193573..3fd0eff518 100644 --- a/crates/compiler/mono/src/borrow.rs +++ b/crates/compiler/mono/src/borrow.rs @@ -561,13 +561,6 @@ impl<'a> BorrowInfState<'a> { self.own_var(*xs); } } - ListMapWithIndex { xs } => { - // List.mapWithIndex : List before, (before, Nat -> after) -> List after - // own the list if the function wants to own the element (before, index 0) - if !function_ps[0].borrow { - self.own_var(*xs); - } - } ListMap2 { xs, ys } => { // own the lists if the function wants to own the element if !function_ps[0].borrow { diff --git a/crates/compiler/mono/src/inc_dec.rs b/crates/compiler/mono/src/inc_dec.rs index c570451131..7953e82d81 100644 --- a/crates/compiler/mono/src/inc_dec.rs +++ b/crates/compiler/mono/src/inc_dec.rs @@ -748,17 +748,6 @@ impl<'a> Context<'a> { handle_ownerships_pre!(Stmt::Let(z, v, l, b), ownerships) } - ListMapWithIndex { xs } => { - let ownerships = [(xs, function_ps[0])]; - - let b = self.add_dec_after_lowlevel(after_arguments, &borrows, b, b_live_vars); - - let b = handle_ownerships_post!(b, ownerships); - - let v = create_call!(function_ps.get(2)); - - handle_ownerships_pre!(Stmt::Let(z, v, l, b), ownerships) - } ListSortWith { xs } => { // NOTE: we may apply the function to the same argument multiple times. // for that to be valid, the function must borrow its argument. This is not diff --git a/crates/compiler/mono/src/low_level.rs b/crates/compiler/mono/src/low_level.rs index 8a59c88f80..768ad0f28c 100644 --- a/crates/compiler/mono/src/low_level.rs +++ b/crates/compiler/mono/src/low_level.rs @@ -20,9 +20,6 @@ pub enum HigherOrder { zs: Symbol, ws: Symbol, }, - ListMapWithIndex { - xs: Symbol, - }, ListSortWith { xs: Symbol, }, @@ -39,7 +36,6 @@ impl HigherOrder { HigherOrder::ListMap2 { .. } => 2, HigherOrder::ListMap3 { .. } => 3, HigherOrder::ListMap4 { .. } => 4, - HigherOrder::ListMapWithIndex { .. } => 2, HigherOrder::ListSortWith { .. } => 2, HigherOrder::DictWalk { .. } => 2, } @@ -51,7 +47,7 @@ impl HigherOrder { use HigherOrder::*; match self { - ListMap { .. } | ListMapWithIndex { .. } | ListSortWith { .. } => 2, + ListMap { .. } | ListSortWith { .. } => 2, ListMap2 { .. } => 3, ListMap3 { .. } => 4, ListMap4 { .. } => 5, From 40231535fafed083b56d909f1e6efc30407b8d06 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Mon, 4 Jul 2022 15:14:32 +0100 Subject: [PATCH 5/8] builtins: Delete Zig implementation of List.mapWithIndex --- crates/compiler/builtins/bitcode/src/list.zig | 32 ------------------- crates/compiler/builtins/bitcode/src/main.zig | 1 - crates/compiler/builtins/src/bitcode.rs | 1 - .../compiler/gen_llvm/src/llvm/build_list.rs | 24 -------------- 4 files changed, 58 deletions(-) diff --git a/crates/compiler/builtins/bitcode/src/list.zig b/crates/compiler/builtins/bitcode/src/list.zig index 3c4a3494ae..cb38bf92ab 100644 --- a/crates/compiler/builtins/bitcode/src/list.zig +++ b/crates/compiler/builtins/bitcode/src/list.zig @@ -227,38 +227,6 @@ pub fn listMap( } } -// List.mapWithIndex : List before, (before, Nat -> after) -> List after -pub fn listMapWithIndex( - list: RocList, - caller: Caller2, - data: Opaque, - inc_n_data: IncN, - data_is_owned: bool, - alignment: u32, - old_element_width: usize, - new_element_width: usize, -) callconv(.C) RocList { - if (list.bytes) |source_ptr| { - const size = list.len(); - var i: usize = 0; - const output = RocList.allocate(alignment, size, new_element_width); - const target_ptr = output.bytes orelse unreachable; - - if (data_is_owned) { - inc_n_data(data, size); - } - - while (i < size) : (i += 1) { - // before, Nat -> after - caller(data, source_ptr + (i * old_element_width), @ptrCast(?[*]u8, &i), target_ptr + (i * new_element_width)); - } - - return output; - } else { - return RocList.empty(); - } -} - fn decrementTail(list: RocList, start_index: usize, element_width: usize, dec: Dec) void { if (list.bytes) |source| { var i = start_index; diff --git a/crates/compiler/builtins/bitcode/src/main.zig b/crates/compiler/builtins/bitcode/src/main.zig index 1c6fd8e7d0..7f09eae50d 100644 --- a/crates/compiler/builtins/bitcode/src/main.zig +++ b/crates/compiler/builtins/bitcode/src/main.zig @@ -40,7 +40,6 @@ comptime { exportListFn(list.listMap2, "map2"); exportListFn(list.listMap3, "map3"); exportListFn(list.listMap4, "map4"); - exportListFn(list.listMapWithIndex, "map_with_index"); exportListFn(list.listAppend, "append"); exportListFn(list.listPrepend, "prepend"); exportListFn(list.listWithCapacity, "with_capacity"); diff --git a/crates/compiler/builtins/src/bitcode.rs b/crates/compiler/builtins/src/bitcode.rs index bef34989fa..0b69828fbd 100644 --- a/crates/compiler/builtins/src/bitcode.rs +++ b/crates/compiler/builtins/src/bitcode.rs @@ -354,7 +354,6 @@ pub const LIST_MAP: &str = "roc_builtins.list.map"; pub const LIST_MAP2: &str = "roc_builtins.list.map2"; pub const LIST_MAP3: &str = "roc_builtins.list.map3"; pub const LIST_MAP4: &str = "roc_builtins.list.map4"; -pub const LIST_MAP_WITH_INDEX: &str = "roc_builtins.list.map_with_index"; pub const LIST_APPEND: &str = "roc_builtins.list.append"; pub const LIST_PREPEND: &str = "roc_builtins.list.prepend"; pub const LIST_SUBLIST: &str = "roc_builtins.list.sublist"; diff --git a/crates/compiler/gen_llvm/src/llvm/build_list.rs b/crates/compiler/gen_llvm/src/llvm/build_list.rs index 5a8773a4bf..fcd4ff9761 100644 --- a/crates/compiler/gen_llvm/src/llvm/build_list.rs +++ b/crates/compiler/gen_llvm/src/llvm/build_list.rs @@ -367,30 +367,6 @@ pub fn list_sort_with<'a, 'ctx, 'env>( ) } -/// List.mapWithIndex : List before, (before, Nat -> after) -> List after -pub fn list_map_with_index<'a, 'ctx, 'env>( - env: &Env<'a, 'ctx, 'env>, - roc_function_call: RocFunctionCall<'ctx>, - list: BasicValueEnum<'ctx>, - element_layout: &Layout<'a>, - return_layout: &Layout<'a>, -) -> BasicValueEnum<'ctx> { - call_list_bitcode_fn( - env, - &[ - list_to_c_abi(env, list).into(), - roc_function_call.caller.into(), - pass_as_opaque(env, roc_function_call.data), - roc_function_call.inc_n_data.into(), - roc_function_call.data_is_owned.into(), - env.alignment_intvalue(element_layout), - layout_width(env, element_layout), - layout_width(env, return_layout), - ], - bitcode::LIST_MAP_WITH_INDEX, - ) -} - /// List.map : List before, (before -> after) -> List after pub fn list_map<'a, 'ctx, 'env>( env: &Env<'a, 'ctx, 'env>, From 62e93dd9210f68d483c313ae9f72754b2e79ded8 Mon Sep 17 00:00:00 2001 From: Brian Carroll Date: Mon, 4 Jul 2022 15:14:52 +0100 Subject: [PATCH 6/8] wasm: enable test for List.mapWithIndex --- crates/compiler/test_gen/src/gen_list.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/compiler/test_gen/src/gen_list.rs b/crates/compiler/test_gen/src/gen_list.rs index c4501796f3..b6f91ae664 100644 --- a/crates/compiler/test_gen/src/gen_list.rs +++ b/crates/compiler/test_gen/src/gen_list.rs @@ -2567,7 +2567,7 @@ fn list_keep_errs() { } #[test] -#[cfg(any(feature = "gen-llvm"))] +#[cfg(any(feature = "gen-llvm", feature = "gen-wasm"))] fn list_map_with_index() { assert_evals_to!( "List.mapWithIndex [0,0,0] (\\x, index -> Num.intCast index + x)", From f86f2e2bdd9a861d23cb5a9be8e17567ea6939e6 Mon Sep 17 00:00:00 2001 From: Folkert Date: Tue, 5 Jul 2022 00:51:10 +0200 Subject: [PATCH 7/8] format --- crates/compiler/gen_wasm/src/low_level.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/compiler/gen_wasm/src/low_level.rs b/crates/compiler/gen_wasm/src/low_level.rs index 13912250d3..23e3881b96 100644 --- a/crates/compiler/gen_wasm/src/low_level.rs +++ b/crates/compiler/gen_wasm/src/low_level.rs @@ -301,8 +301,7 @@ impl<'a> LowLevelCall<'a> { ListIsUnique => self.load_args_and_call_zig(backend, bitcode::LIST_IS_UNIQUE), - ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith - | DictWalk => { + ListMap | ListMap2 | ListMap3 | ListMap4 | ListSortWith | DictWalk => { internal_error!("HigherOrder lowlevels should not be handled here") } From 36c8723214321c8b3a251dd7613b37356e03b3f7 Mon Sep 17 00:00:00 2001 From: Folkert Date: Tue, 5 Jul 2022 00:52:10 +0200 Subject: [PATCH 8/8] update mono tests --- .../test_mono/generated/closure_in_list.txt | 4 +- .../generated/empty_list_of_function_type.txt | 28 ++++----- .../compiler/test_mono/generated/encode.txt | 4 +- .../test_mono/generated/ir_int_add.txt | 4 +- ...cialize_errors_behind_unified_branches.txt | 54 ++++++++--------- .../test_mono/generated/list_append.txt | 4 +- .../generated/list_append_closure.txt | 4 +- .../generated/list_cannot_update_inplace.txt | 36 +++++------ .../compiler/test_mono/generated/list_get.txt | 28 ++++----- .../compiler/test_mono/generated/list_len.txt | 8 +-- .../generated/list_map_closure_borrows.txt | 32 +++++----- .../generated/list_map_closure_owns.txt | 32 +++++----- .../generated/list_pass_to_function.txt | 36 +++++------ .../test_mono/generated/list_sort_asc.txt | 14 ++--- .../test_mono/generated/quicksort_swap.txt | 60 +++++++++---------- .../compiler/test_mono/generated/rigids.txt | 60 +++++++++---------- 16 files changed, 204 insertions(+), 204 deletions(-) diff --git a/crates/compiler/test_mono/generated/closure_in_list.txt b/crates/compiler/test_mono/generated/closure_in_list.txt index 8efa4cf634..98b7d82974 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.266 : U64 = lowlevel ListLen #Attr.2; - ret List.266; + let List.279 : U64 = lowlevel ListLen #Attr.2; + ret List.279; procedure Test.1 (Test.5): let Test.2 : I64 = 41i64; 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 f378649fab..56aeb77f64 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,22 +1,22 @@ -procedure List.2 (List.74, List.75): - let List.272 : U64 = CallByName List.6 List.74; - let List.268 : Int1 = CallByName Num.22 List.75 List.272; - if List.268 then - let List.270 : {} = CallByName List.60 List.74 List.75; - let List.269 : [C {}, C {}] = TagId(1) List.270; - ret List.269; +procedure List.2 (List.75, List.76): + let List.285 : U64 = CallByName List.6 List.75; + let List.281 : Int1 = CallByName Num.22 List.76 List.285; + if List.281 then + let List.283 : {} = CallByName List.60 List.75 List.76; + let List.282 : [C {}, C {}] = TagId(1) List.283; + ret List.282; else - let List.267 : {} = Struct {}; - let List.266 : [C {}, C {}] = TagId(0) List.267; - ret List.266; + let List.280 : {} = Struct {}; + let List.279 : [C {}, C {}] = TagId(0) List.280; + ret List.279; procedure List.6 (#Attr.2): - let List.275 : U64 = lowlevel ListLen #Attr.2; - ret List.275; + let List.288 : U64 = lowlevel ListLen #Attr.2; + ret List.288; procedure List.60 (#Attr.2, #Attr.3): - let List.274 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.274; + let List.287 : {} = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.287; procedure Num.22 (#Attr.2, #Attr.3): let Num.188 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/encode.txt b/crates/compiler/test_mono/generated/encode.txt index fdebaf3203..d3f32bd601 100644 --- a/crates/compiler/test_mono/generated/encode.txt +++ b/crates/compiler/test_mono/generated/encode.txt @@ -1,6 +1,6 @@ procedure List.4 (#Attr.2, #Attr.3): - let List.266 : List U8 = lowlevel ListAppend #Attr.2 #Attr.3; - ret List.266; + let List.279 : List U8 = lowlevel ListAppend #Attr.2 #Attr.3; + ret List.279; procedure Test.20 (Test.22): let Test.34 : {U8} = Struct {Test.22}; diff --git a/crates/compiler/test_mono/generated/ir_int_add.txt b/crates/compiler/test_mono/generated/ir_int_add.txt index f4d92f2cfc..d24b68c2f3 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.266 : U64 = lowlevel ListLen #Attr.2; - ret List.266; + let List.279 : U64 = lowlevel ListLen #Attr.2; + ret List.279; procedure Num.19 (#Attr.2, #Attr.3): let Num.190 : 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 6c72fdda41..a7cc7bc9db 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,37 +1,37 @@ -procedure List.2 (List.74, List.75): - let List.281 : U64 = CallByName List.6 List.74; - let List.277 : Int1 = CallByName Num.22 List.75 List.281; - if List.277 then - let List.279 : I64 = CallByName List.60 List.74 List.75; - let List.278 : [C {}, C I64] = TagId(1) List.279; - ret List.278; +procedure List.2 (List.75, List.76): + let List.294 : U64 = CallByName List.6 List.75; + let List.290 : Int1 = CallByName Num.22 List.76 List.294; + if List.290 then + let List.292 : I64 = CallByName List.60 List.75 List.76; + let List.291 : [C {}, C I64] = TagId(1) List.292; + ret List.291; else - let List.276 : {} = Struct {}; - let List.275 : [C {}, C I64] = TagId(0) List.276; - ret List.275; + let List.289 : {} = Struct {}; + let List.288 : [C {}, C I64] = TagId(0) List.289; + ret List.288; procedure List.6 (#Attr.2): - let List.282 : U64 = lowlevel ListLen #Attr.2; - ret List.282; + let List.295 : U64 = lowlevel ListLen #Attr.2; + ret List.295; procedure List.60 (#Attr.2, #Attr.3): - let List.280 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.280; + let List.293 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.293; -procedure List.9 (List.188): - let List.273 : U64 = 0i64; - let List.266 : [C {}, C I64] = CallByName List.2 List.188 List.273; - let List.270 : U8 = 1i64; - let List.271 : U8 = GetTagId List.266; - let List.272 : Int1 = lowlevel Eq List.270 List.271; - if List.272 then - let List.189 : I64 = UnionAtIndex (Id 1) (Index 0) List.266; - let List.267 : [C Int1, C I64] = TagId(1) List.189; - ret List.267; +procedure List.9 (List.201): + let List.286 : U64 = 0i64; + let List.279 : [C {}, C I64] = CallByName List.2 List.201 List.286; + let List.283 : U8 = 1i64; + let List.284 : U8 = GetTagId List.279; + let List.285 : Int1 = lowlevel Eq List.283 List.284; + if List.285 then + let List.202 : I64 = UnionAtIndex (Id 1) (Index 0) List.279; + let List.280 : [C Int1, C I64] = TagId(1) List.202; + ret List.280; else - let List.269 : Int1 = true; - let List.268 : [C Int1, C I64] = TagId(0) List.269; - ret List.268; + let List.282 : Int1 = true; + let List.281 : [C Int1, C I64] = TagId(0) List.282; + ret List.281; procedure Num.22 (#Attr.2, #Attr.3): let Num.188 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; diff --git a/crates/compiler/test_mono/generated/list_append.txt b/crates/compiler/test_mono/generated/list_append.txt index bd91996634..bf8b33a041 100644 --- a/crates/compiler/test_mono/generated/list_append.txt +++ b/crates/compiler/test_mono/generated/list_append.txt @@ -1,6 +1,6 @@ procedure List.4 (#Attr.2, #Attr.3): - let List.266 : List I64 = lowlevel ListAppend #Attr.2 #Attr.3; - ret List.266; + let List.279 : List I64 = lowlevel ListAppend #Attr.2 #Attr.3; + ret List.279; 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 d3b8b4a722..b846e182e1 100644 --- a/crates/compiler/test_mono/generated/list_append_closure.txt +++ b/crates/compiler/test_mono/generated/list_append_closure.txt @@ -1,6 +1,6 @@ procedure List.4 (#Attr.2, #Attr.3): - let List.266 : List I64 = lowlevel ListAppend #Attr.2 #Attr.3; - ret List.266; + let List.279 : List I64 = lowlevel ListAppend #Attr.2 #Attr.3; + ret List.279; 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 ed68035643..07b801d50c 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.82, List.83, List.84): - let List.269 : {List I64, I64} = CallByName List.57 List.82 List.83 List.84; - let List.268 : List I64 = StructAtIndex 0 List.269; - inc List.268; - dec List.269; - ret List.268; +procedure List.3 (List.83, List.84, List.85): + let List.282 : {List I64, I64} = CallByName List.57 List.83 List.84 List.85; + let List.281 : List I64 = StructAtIndex 0 List.282; + inc List.281; + dec List.282; + ret List.281; -procedure List.57 (List.79, List.80, List.81): - let List.275 : U64 = CallByName List.6 List.79; - let List.272 : Int1 = CallByName Num.22 List.80 List.275; - if List.272 then - let List.273 : {List I64, I64} = CallByName List.61 List.79 List.80 List.81; - ret List.273; +procedure List.57 (List.80, List.81, List.82): + let List.288 : U64 = CallByName List.6 List.80; + let List.285 : Int1 = CallByName Num.22 List.81 List.288; + if List.285 then + let List.286 : {List I64, I64} = CallByName List.61 List.80 List.81 List.82; + ret List.286; else - let List.271 : {List I64, I64} = Struct {List.79, List.81}; - ret List.271; + let List.284 : {List I64, I64} = Struct {List.80, List.82}; + ret List.284; procedure List.6 (#Attr.2): - let List.267 : U64 = lowlevel ListLen #Attr.2; - ret List.267; + let List.280 : U64 = lowlevel ListLen #Attr.2; + ret List.280; procedure List.61 (#Attr.2, #Attr.3, #Attr.4): - let List.274 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; - ret List.274; + let List.287 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; + ret List.287; procedure Num.19 (#Attr.2, #Attr.3): let Num.188 : 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 e54a7a6995..70fc48a262 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.74, List.75): - let List.272 : U64 = CallByName List.6 List.74; - let List.268 : Int1 = CallByName Num.22 List.75 List.272; - if List.268 then - let List.270 : I64 = CallByName List.60 List.74 List.75; - let List.269 : [C {}, C I64] = TagId(1) List.270; - ret List.269; +procedure List.2 (List.75, List.76): + let List.285 : U64 = CallByName List.6 List.75; + let List.281 : Int1 = CallByName Num.22 List.76 List.285; + if List.281 then + let List.283 : I64 = CallByName List.60 List.75 List.76; + let List.282 : [C {}, C I64] = TagId(1) List.283; + ret List.282; else - let List.267 : {} = Struct {}; - let List.266 : [C {}, C I64] = TagId(0) List.267; - ret List.266; + let List.280 : {} = Struct {}; + let List.279 : [C {}, C I64] = TagId(0) List.280; + ret List.279; procedure List.6 (#Attr.2): - let List.275 : U64 = lowlevel ListLen #Attr.2; - ret List.275; + let List.288 : U64 = lowlevel ListLen #Attr.2; + ret List.288; procedure List.60 (#Attr.2, #Attr.3): - let List.274 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.274; + let List.287 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.287; procedure Num.22 (#Attr.2, #Attr.3): let Num.188 : 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 f06fa86d6b..ede7079850 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.266 : U64 = lowlevel ListLen #Attr.2; - ret List.266; + let List.279 : U64 = lowlevel ListLen #Attr.2; + ret List.279; procedure List.6 (#Attr.2): - let List.267 : U64 = lowlevel ListLen #Attr.2; - ret List.267; + let List.280 : U64 = lowlevel ListLen #Attr.2; + ret List.280; procedure Num.19 (#Attr.2, #Attr.3): let Num.188 : 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 f01ce2d803..dc1ecdf972 100644 --- a/crates/compiler/test_mono/generated/list_map_closure_borrows.txt +++ b/crates/compiler/test_mono/generated/list_map_closure_borrows.txt @@ -1,26 +1,26 @@ -procedure List.2 (List.74, List.75): - let List.272 : U64 = CallByName List.6 List.74; - let List.268 : Int1 = CallByName Num.22 List.75 List.272; - if List.268 then - let List.270 : Str = CallByName List.60 List.74 List.75; - let List.269 : [C {}, C Str] = TagId(1) List.270; - ret List.269; +procedure List.2 (List.75, List.76): + let List.285 : U64 = CallByName List.6 List.75; + let List.281 : Int1 = CallByName Num.22 List.76 List.285; + if List.281 then + let List.283 : Str = CallByName List.60 List.75 List.76; + let List.282 : [C {}, C Str] = TagId(1) List.283; + ret List.282; else - let List.267 : {} = Struct {}; - let List.266 : [C {}, C Str] = TagId(0) List.267; - ret List.266; + let List.280 : {} = Struct {}; + let List.279 : [C {}, C Str] = TagId(0) List.280; + ret List.279; procedure List.5 (#Attr.2, #Attr.3): - let List.274 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3; - ret List.274; + let List.287 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3; + ret List.287; procedure List.6 (#Attr.2): - let List.276 : U64 = lowlevel ListLen #Attr.2; - ret List.276; + let List.289 : U64 = lowlevel ListLen #Attr.2; + ret List.289; procedure List.60 (#Attr.2, #Attr.3): - let List.275 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.275; + let List.288 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.288; procedure Num.22 (#Attr.2, #Attr.3): let Num.188 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; 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 6b251728f0..2902403b02 100644 --- a/crates/compiler/test_mono/generated/list_map_closure_owns.txt +++ b/crates/compiler/test_mono/generated/list_map_closure_owns.txt @@ -1,28 +1,28 @@ -procedure List.2 (List.74, List.75): - let List.272 : U64 = CallByName List.6 List.74; - let List.268 : Int1 = CallByName Num.22 List.75 List.272; - if List.268 then - let List.270 : Str = CallByName List.60 List.74 List.75; - let List.269 : [C {}, C Str] = TagId(1) List.270; - ret List.269; +procedure List.2 (List.75, List.76): + let List.285 : U64 = CallByName List.6 List.75; + let List.281 : Int1 = CallByName Num.22 List.76 List.285; + if List.281 then + let List.283 : Str = CallByName List.60 List.75 List.76; + let List.282 : [C {}, C Str] = TagId(1) List.283; + ret List.282; else - let List.267 : {} = Struct {}; - let List.266 : [C {}, C Str] = TagId(0) List.267; - ret List.266; + let List.280 : {} = Struct {}; + let List.279 : [C {}, C Str] = TagId(0) List.280; + ret List.279; procedure List.5 (#Attr.2, #Attr.3): inc #Attr.2; - let List.274 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3; + let List.287 : List Str = lowlevel ListMap { xs: `#Attr.#arg1` } #Attr.2 Test.3 #Attr.3; decref #Attr.2; - ret List.274; + ret List.287; procedure List.6 (#Attr.2): - let List.276 : U64 = lowlevel ListLen #Attr.2; - ret List.276; + let List.289 : U64 = lowlevel ListLen #Attr.2; + ret List.289; procedure List.60 (#Attr.2, #Attr.3): - let List.275 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.275; + let List.288 : Str = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.288; procedure Num.22 (#Attr.2, #Attr.3): let Num.188 : Int1 = lowlevel NumLt #Attr.2 #Attr.3; 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 e97bf720c0..c27bb5d644 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.82, List.83, List.84): - let List.267 : {List I64, I64} = CallByName List.57 List.82 List.83 List.84; - let List.266 : List I64 = StructAtIndex 0 List.267; - inc List.266; - dec List.267; - ret List.266; +procedure List.3 (List.83, List.84, List.85): + let List.280 : {List I64, I64} = CallByName List.57 List.83 List.84 List.85; + let List.279 : List I64 = StructAtIndex 0 List.280; + inc List.279; + dec List.280; + ret List.279; -procedure List.57 (List.79, List.80, List.81): - let List.273 : U64 = CallByName List.6 List.79; - let List.270 : Int1 = CallByName Num.22 List.80 List.273; - if List.270 then - let List.271 : {List I64, I64} = CallByName List.61 List.79 List.80 List.81; - ret List.271; +procedure List.57 (List.80, List.81, List.82): + let List.286 : U64 = CallByName List.6 List.80; + let List.283 : Int1 = CallByName Num.22 List.81 List.286; + if List.283 then + let List.284 : {List I64, I64} = CallByName List.61 List.80 List.81 List.82; + ret List.284; else - let List.269 : {List I64, I64} = Struct {List.79, List.81}; - ret List.269; + let List.282 : {List I64, I64} = Struct {List.80, List.82}; + ret List.282; procedure List.6 (#Attr.2): - let List.274 : U64 = lowlevel ListLen #Attr.2; - ret List.274; + let List.287 : U64 = lowlevel ListLen #Attr.2; + ret List.287; procedure List.61 (#Attr.2, #Attr.3, #Attr.4): - let List.272 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; - ret List.272; + let List.285 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; + ret List.285; procedure Num.22 (#Attr.2, #Attr.3): let Num.188 : 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 7762a77377..5e6d35ea2f 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.269 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3; + let List.282 : List I64 = lowlevel ListSortWith { xs: `#Attr.#arg1` } #Attr.2 Num.46 #Attr.3; let Bool.9 : Int1 = lowlevel ListIsUnique #Attr.2; if Bool.9 then - ret List.269; + ret List.282; else decref #Attr.2; - ret List.269; + ret List.282; -procedure List.54 (List.183): - let List.267 : {} = Struct {}; - let List.266 : List I64 = CallByName List.28 List.183 List.267; - ret List.266; +procedure List.54 (List.196): + let List.280 : {} = Struct {}; + let List.279 : List I64 = CallByName List.28 List.196 List.280; + ret List.279; procedure Num.46 (#Attr.2, #Attr.3): let Num.188 : 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 e71e93a6b4..ae38b69c79 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.74, List.75): - let List.286 : U64 = CallByName List.6 List.74; - let List.282 : Int1 = CallByName Num.22 List.75 List.286; - if List.282 then - let List.284 : I64 = CallByName List.60 List.74 List.75; - let List.283 : [C {}, C I64] = TagId(1) List.284; - ret List.283; +procedure List.2 (List.75, List.76): + let List.299 : U64 = CallByName List.6 List.75; + let List.295 : Int1 = CallByName Num.22 List.76 List.299; + if List.295 then + let List.297 : I64 = CallByName List.60 List.75 List.76; + let List.296 : [C {}, C I64] = TagId(1) List.297; + ret List.296; else - let List.281 : {} = Struct {}; - let List.280 : [C {}, C I64] = TagId(0) List.281; - ret List.280; + let List.294 : {} = Struct {}; + let List.293 : [C {}, C I64] = TagId(0) List.294; + ret List.293; -procedure List.3 (List.82, List.83, List.84): - let List.270 : {List I64, I64} = CallByName List.57 List.82 List.83 List.84; - let List.269 : List I64 = StructAtIndex 0 List.270; - inc List.269; - dec List.270; - ret List.269; +procedure List.3 (List.83, List.84, List.85): + let List.283 : {List I64, I64} = CallByName List.57 List.83 List.84 List.85; + let List.282 : List I64 = StructAtIndex 0 List.283; + inc List.282; + dec List.283; + ret List.282; -procedure List.57 (List.79, List.80, List.81): - let List.292 : U64 = CallByName List.6 List.79; - let List.289 : Int1 = CallByName Num.22 List.80 List.292; - if List.289 then - let List.290 : {List I64, I64} = CallByName List.61 List.79 List.80 List.81; - ret List.290; +procedure List.57 (List.80, List.81, List.82): + let List.305 : U64 = CallByName List.6 List.80; + let List.302 : Int1 = CallByName Num.22 List.81 List.305; + if List.302 then + let List.303 : {List I64, I64} = CallByName List.61 List.80 List.81 List.82; + ret List.303; else - let List.288 : {List I64, I64} = Struct {List.79, List.81}; - ret List.288; + let List.301 : {List I64, I64} = Struct {List.80, List.82}; + ret List.301; procedure List.6 (#Attr.2): - let List.293 : U64 = lowlevel ListLen #Attr.2; - ret List.293; + let List.306 : U64 = lowlevel ListLen #Attr.2; + ret List.306; procedure List.60 (#Attr.2, #Attr.3): - let List.294 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.294; + let List.307 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.307; procedure List.61 (#Attr.2, #Attr.3, #Attr.4): - let List.291 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; - ret List.291; + let List.304 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; + ret List.304; procedure Num.22 (#Attr.2, #Attr.3): let Num.190 : 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 b9b09bca94..11c599f14b 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.74, List.75): - let List.286 : U64 = CallByName List.6 List.74; - let List.282 : Int1 = CallByName Num.22 List.75 List.286; - if List.282 then - let List.284 : I64 = CallByName List.60 List.74 List.75; - let List.283 : [C {}, C I64] = TagId(1) List.284; - ret List.283; +procedure List.2 (List.75, List.76): + let List.299 : U64 = CallByName List.6 List.75; + let List.295 : Int1 = CallByName Num.22 List.76 List.299; + if List.295 then + let List.297 : I64 = CallByName List.60 List.75 List.76; + let List.296 : [C {}, C I64] = TagId(1) List.297; + ret List.296; else - let List.281 : {} = Struct {}; - let List.280 : [C {}, C I64] = TagId(0) List.281; - ret List.280; + let List.294 : {} = Struct {}; + let List.293 : [C {}, C I64] = TagId(0) List.294; + ret List.293; -procedure List.3 (List.82, List.83, List.84): - let List.270 : {List I64, I64} = CallByName List.57 List.82 List.83 List.84; - let List.269 : List I64 = StructAtIndex 0 List.270; - inc List.269; - dec List.270; - ret List.269; +procedure List.3 (List.83, List.84, List.85): + let List.283 : {List I64, I64} = CallByName List.57 List.83 List.84 List.85; + let List.282 : List I64 = StructAtIndex 0 List.283; + inc List.282; + dec List.283; + ret List.282; -procedure List.57 (List.79, List.80, List.81): - let List.292 : U64 = CallByName List.6 List.79; - let List.289 : Int1 = CallByName Num.22 List.80 List.292; - if List.289 then - let List.290 : {List I64, I64} = CallByName List.61 List.79 List.80 List.81; - ret List.290; +procedure List.57 (List.80, List.81, List.82): + let List.305 : U64 = CallByName List.6 List.80; + let List.302 : Int1 = CallByName Num.22 List.81 List.305; + if List.302 then + let List.303 : {List I64, I64} = CallByName List.61 List.80 List.81 List.82; + ret List.303; else - let List.288 : {List I64, I64} = Struct {List.79, List.81}; - ret List.288; + let List.301 : {List I64, I64} = Struct {List.80, List.82}; + ret List.301; procedure List.6 (#Attr.2): - let List.293 : U64 = lowlevel ListLen #Attr.2; - ret List.293; + let List.306 : U64 = lowlevel ListLen #Attr.2; + ret List.306; procedure List.60 (#Attr.2, #Attr.3): - let List.294 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; - ret List.294; + let List.307 : I64 = lowlevel ListGetUnsafe #Attr.2 #Attr.3; + ret List.307; procedure List.61 (#Attr.2, #Attr.3, #Attr.4): - let List.291 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; - ret List.291; + let List.304 : {List I64, I64} = lowlevel ListReplaceUnsafe #Attr.2 #Attr.3 #Attr.4; + ret List.304; procedure Num.22 (#Attr.2, #Attr.3): let Num.190 : Int1 = lowlevel NumLt #Attr.2 #Attr.3;