From 427f426012638d5ebe100897cd702df2e479700f Mon Sep 17 00:00:00 2001 From: Vineeth Kashyap Date: Mon, 2 Dec 2024 12:16:09 -0500 Subject: [PATCH] [compiler-v2] Optimize stackless-bytecode assign instructions --- .../compiler-v2-doc/token_event_store.md | 58 ++++- .../move-stdlib/tests/compiler-v2-doc/mem.md | 115 ++++++++++ .../move/move-compiler-v2/src/experiments.rs | 6 + .../function_generator.rs | 19 +- .../bug-10253.off.exp | 208 ++++++++---------- .../bug-10253.on.exp | 190 +++++++--------- .../jump-label.off.exp | 69 +++--- .../jump-label.on.exp | 69 +++--- .../eager-pushes/framework_reduced_06.exp | 35 ++- .../eager-pushes/move_stdlib_reduced.exp | 27 +-- .../tests/eager-pushes/txn_reduced_01.exp | 176 +++++++++++++++ .../tests/eager-pushes/txn_reduced_01.move | 16 ++ .../file-format-generator/bug_14762.opt.exp | 47 ++-- .../file-format-generator/fields.opt.exp | 3 - .../file-format-generator/vector.opt.exp | 33 ++- .../tests/flush-writes/def_use_07.off.exp | 1 - .../tests/flush-writes/def_use_07.on.exp | 1 - .../tests/flush-writes/loop_01.off.exp | 13 +- .../tests/flush-writes/loop_01.on.exp | 13 +- .../args_with_side_effects.exp | 15 +- .../args_with_side_effects.opt.exp | 15 +- .../variable-coalescing/borrowed_var.exp | 1 - .../variable-coalescing/borrowed_var.opt.exp | 1 - .../tests/variable-coalescing/branch_2.exp | 1 - .../variable-coalescing/branch_2.opt.exp | 1 - .../tests/variable-coalescing/branch_3.exp | 1 - .../variable-coalescing/branch_3.opt.exp | 1 - ...branch_assigns_then_moves_then_assigns.exp | 2 - ...ch_assigns_then_moves_then_assigns.opt.exp | 2 - .../tests/variable-coalescing/consume_1.exp | 20 +- .../variable-coalescing/consume_1.opt.exp | 20 +- .../tests/variable-coalescing/consume_3.exp | 2 - .../variable-coalescing/consume_3.opt.exp | 2 - .../tests/variable-coalescing/consume_4.exp | 2 - .../variable-coalescing/consume_4.opt.exp | 2 - .../cyclic_assignments.exp | 1 - .../cyclic_assignments.opt.exp | 1 - .../variable-coalescing/cyclic_dead_store.exp | 16 +- .../cyclic_dead_store.opt.exp | 16 +- .../variable-coalescing/immut_refs_2.exp | 1 - .../variable-coalescing/immut_refs_2.opt.exp | 1 - .../variable-coalescing/intermingled_1.exp | 1 - .../intermingled_2.opt.exp | 5 +- .../tests/variable-coalescing/loop_1.exp | 10 +- .../tests/variable-coalescing/loop_1.opt.exp | 10 +- .../tests/variable-coalescing/loop_2.exp | 16 +- .../tests/variable-coalescing/loop_2.opt.exp | 16 +- .../tests/variable-coalescing/mut_refs_1.exp | 17 +- .../variable-coalescing/mut_refs_1.opt.exp | 17 +- .../tests/variable-coalescing/seq_kills_1.exp | 12 +- .../variable-coalescing/seq_kills_1.opt.exp | 12 +- .../tests/variable-coalescing/seq_kills_2.exp | 12 +- .../variable-coalescing/seq_kills_2.opt.exp | 12 +- .../straight_line_kills.exp | 17 +- .../straight_line_kills.opt.exp | 17 +- .../tests/variable-coalescing/swap.exp | 14 +- .../tests/variable-coalescing/swap.opt.exp | 14 +- .../variable-coalescing/swap_in_a_loop.exp | 26 +-- .../swap_in_a_loop.opt.exp | 26 +-- .../assert_one.optimize-no-simplify.exp | 2 +- .../no-v1-comparison/assert_one.optimize.exp | 2 +- 61 files changed, 849 insertions(+), 632 deletions(-) create mode 100644 aptos-move/framework/move-stdlib/tests/compiler-v2-doc/mem.md create mode 100644 third_party/move/move-compiler-v2/tests/eager-pushes/txn_reduced_01.exp create mode 100644 third_party/move/move-compiler-v2/tests/eager-pushes/txn_reduced_01.move diff --git a/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_event_store.md b/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_event_store.md index 807296df0f1734..8381f28f36fc09 100644 --- a/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_event_store.md +++ b/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_event_store.md @@ -11,7 +11,7 @@ This module provides utils to add and emit new token events that are not in toke - [Struct `CollectionUriMutateEvent`](#0x3_token_event_store_CollectionUriMutateEvent) - [Struct `CollectionUriMutate`](#0x3_token_event_store_CollectionUriMutate) - [Struct `CollectionMaxiumMutateEvent`](#0x3_token_event_store_CollectionMaxiumMutateEvent) -- [Struct `CollectionMaxiumMutate`](#0x3_token_event_store_CollectionMaxiumMutate) +- [Struct `CollectionMaximumMutate`](#0x3_token_event_store_CollectionMaximumMutate) - [Struct `OptInTransferEvent`](#0x3_token_event_store_OptInTransferEvent) - [Struct `OptInTransfer`](#0x3_token_event_store_OptInTransfer) - [Struct `UriMutationEvent`](#0x3_token_event_store_UriMutationEvent) @@ -25,6 +25,7 @@ This module provides utils to add and emit new token events that are not in toke - [Struct `MaxiumMutateEvent`](#0x3_token_event_store_MaxiumMutateEvent) - [Struct `MaximumMutate`](#0x3_token_event_store_MaximumMutate) - [Resource `TokenEventStoreV1`](#0x3_token_event_store_TokenEventStoreV1) +- [Struct `CollectionMaxiumMutate`](#0x3_token_event_store_CollectionMaxiumMutate) - [Function `initialize_token_event_store`](#0x3_token_event_store_initialize_token_event_store) - [Function `emit_collection_uri_mutate_event`](#0x3_token_event_store_emit_collection_uri_mutate_event) - [Function `emit_collection_description_mutate_event`](#0x3_token_event_store_emit_collection_description_mutate_event) @@ -292,15 +293,15 @@ Event emitted when the collection maximum is mutated - + -## Struct `CollectionMaxiumMutate` +## Struct `CollectionMaximumMutate` Event emitted when the collection maximum is mutated
#[event]
-struct CollectionMaxiumMutate has drop, store
+struct CollectionMaximumMutate has drop, store
 
@@ -1066,6 +1067,53 @@ Event emitted when the token maximum is mutated + + + + +## Struct `CollectionMaxiumMutate` + + + +
#[event]
+#[deprecated]
+struct CollectionMaxiumMutate has drop, store
+
+ + + +
+Fields + + +
+
+creator_addr: address +
+
+ +
+
+collection_name: string::String +
+
+ +
+
+old_maximum: u64 +
+
+ +
+
+new_maximum: u64 +
+
+ +
+
+ +
@@ -1226,7 +1274,7 @@ Emit the collection maximum mutation event let token_event_store = borrow_global_mut<TokenEventStoreV1>(signer::address_of(creator)); if (std::features::module_event_migration_enabled()) { event::emit( - CollectionMaxiumMutate { + CollectionMaximumMutate { creator_addr: signer::address_of(creator), collection_name: collection, old_maximum, diff --git a/aptos-move/framework/move-stdlib/tests/compiler-v2-doc/mem.md b/aptos-move/framework/move-stdlib/tests/compiler-v2-doc/mem.md new file mode 100644 index 00000000000000..b4ac9b3f608be0 --- /dev/null +++ b/aptos-move/framework/move-stdlib/tests/compiler-v2-doc/mem.md @@ -0,0 +1,115 @@ + + + +# Module `0x1::mem` + +Module with methods for safe memory manipulation. + + +- [Function `swap`](#0x1_mem_swap) +- [Function `replace`](#0x1_mem_replace) +- [Specification](#@Specification_0) + - [Function `swap`](#@Specification_0_swap) + - [Function `replace`](#@Specification_0_replace) + + +
+ + + + + +## Function `swap` + +Swap contents of two passed mutable references. + +Move prevents from having two mutable references to the same value, +so left and right references are always distinct. + + +
public(friend) fun swap<T>(left: &mut T, right: &mut T)
+
+ + + +
+Implementation + + +
public(friend) native fun swap<T>(left: &mut T, right: &mut T);
+
+ + + +
+ + + +## Function `replace` + +Replace the value reference points to with the given new value, +and return the value it had before. + + +
public(friend) fun replace<T>(ref: &mut T, new: T): T
+
+ + + +
+Implementation + + +
public(friend) fun replace<T>(ref: &mut T, new: T): T {
+    swap(ref, &mut new);
+    new
+}
+
+ + + +
+ + + +## Specification + + + + +### Function `swap` + + +
public(friend) fun swap<T>(left: &mut T, right: &mut T)
+
+ + + + +
pragma opaque;
+aborts_if false;
+ensures right == old(left);
+ensures left == old(right);
+
+ + + + + +### Function `replace` + + +
public(friend) fun replace<T>(ref: &mut T, new: T): T
+
+ + + + +
pragma opaque;
+aborts_if false;
+ensures result == old(ref);
+ensures ref == new;
+
+ + +[move-book]: https://aptos.dev/move/book/SUMMARY diff --git a/third_party/move/move-compiler-v2/src/experiments.rs b/third_party/move/move-compiler-v2/src/experiments.rs index a5190496900132..fd6174e8231bf0 100644 --- a/third_party/move/move-compiler-v2/src/experiments.rs +++ b/third_party/move/move-compiler-v2/src/experiments.rs @@ -271,6 +271,11 @@ pub static EXPERIMENTS: Lazy> = Lazy::new(|| { .to_string(), default: Given(false), }, + Experiment { + name: Experiment::AVOID_STORE_IN_ASSIGNS.to_string(), + description: "Avoid storing to a local during assigns".to_string(), + default: Inherited(Experiment::OPTIMIZE_WAITING_FOR_COMPARE_TESTS.to_string()), + }, ]; experiments .into_iter() @@ -286,6 +291,7 @@ impl Experiment { pub const AST_SIMPLIFY: &'static str = "ast-simplify"; pub const AST_SIMPLIFY_FULL: &'static str = "ast-simplify-full"; pub const ATTACH_COMPILED_MODULE: &'static str = "attach-compiled-module"; + pub const AVOID_STORE_IN_ASSIGNS: &'static str = "avoid-store-in-assigns"; pub const CFG_SIMPLIFICATION: &'static str = "cfg-simplification"; pub const CHECKS: &'static str = "checks"; pub const COPY_PROPAGATION: &'static str = "copy-propagation"; diff --git a/third_party/move/move-compiler-v2/src/file_format_generator/function_generator.rs b/third_party/move/move-compiler-v2/src/file_format_generator/function_generator.rs index 3a61f63bd19e69..85e5e9402fc541 100644 --- a/third_party/move/move-compiler-v2/src/file_format_generator/function_generator.rs +++ b/third_party/move/move-compiler-v2/src/file_format_generator/function_generator.rs @@ -285,9 +285,22 @@ impl<'a> FunctionGenerator<'a> { std::slice::from_ref(source), ); self.abstract_push_args(ctx, vec![*source], Some(mode)); - let local = self.temp_to_local(ctx.fun_ctx, Some(ctx.attr_id), *dest); - self.emit(FF::Bytecode::StLoc(local)); - self.abstract_pop(ctx) + // TODO: the below conditional check is temporary, the plan is to get rid of the `else` + // case if comparison testing is successful. + let options = ctx + .fun_ctx + .module + .env + .get_extension::() + .expect("Options is available"); + if options.experiment_on(Experiment::AVOID_STORE_IN_ASSIGNS) { + self.abstract_pop(ctx); + self.abstract_push_result(ctx, std::slice::from_ref(dest)); + } else { + let local = self.temp_to_local(ctx.fun_ctx, Some(ctx.attr_id), *dest); + self.emit(FF::Bytecode::StLoc(local)); + self.abstract_pop(ctx); + } }, Bytecode::Ret(_, result) => { self.balance_stack_end_of_block(ctx, result); diff --git a/third_party/move/move-compiler-v2/tests/control-flow-simplification/bug-10253.off.exp b/third_party/move/move-compiler-v2/tests/control-flow-simplification/bug-10253.off.exp index dfad2c56753be7..fcda55f1a11a3a 100644 --- a/third_party/move/move-compiler-v2/tests/control-flow-simplification/bug-10253.off.exp +++ b/third_party/move/move-compiler-v2/tests/control-flow-simplification/bug-10253.off.exp @@ -8,7 +8,6 @@ entry public guess_flips(Arg0: vector) /* def_idx: 0 */ { L1: loc0: &vector L2: loc1: u64 L3: loc2: u64 -L4: loc3: u64 B0: 0: ImmBorrowLoc[0](Arg0: vector) 1: StLoc[1](loc0: &vector) @@ -16,80 +15,71 @@ B0: 3: StLoc[2](loc1: u64) B1: 4: CopyLoc[2](loc1: u64) - 5: StLoc[3](loc2: u64) - 6: CopyLoc[1](loc0: &vector) - 7: VecLen(2) - 8: StLoc[4](loc3: u64) - 9: MoveLoc[3](loc2: u64) - 10: MoveLoc[4](loc3: u64) - 11: Lt - 12: BrFalse(28) + 5: CopyLoc[1](loc0: &vector) + 6: VecLen(2) + 7: Lt + 8: BrFalse(24) B2: - 13: CopyLoc[1](loc0: &vector) - 14: CopyLoc[2](loc1: u64) - 15: VecImmBorrow(2) - 16: ReadRef - 17: LdU8(0) - 18: Neq - 19: BrFalse(23) + 9: CopyLoc[1](loc0: &vector) + 10: CopyLoc[2](loc1: u64) + 11: VecImmBorrow(2) + 12: ReadRef + 13: LdU8(0) + 14: Neq + 15: BrFalse(19) B3: - 20: MoveLoc[1](loc0: &vector) - 21: Pop - 22: Branch(32) + 16: MoveLoc[1](loc0: &vector) + 17: Pop + 18: Branch(28) B4: - 23: MoveLoc[2](loc1: u64) - 24: LdU64(1) - 25: Add - 26: StLoc[2](loc1: u64) - 27: Branch(31) + 19: MoveLoc[2](loc1: u64) + 20: LdU64(1) + 21: Add + 22: StLoc[2](loc1: u64) + 23: Branch(27) B5: - 28: MoveLoc[1](loc0: &vector) - 29: Pop - 30: Branch(32) + 24: MoveLoc[1](loc0: &vector) + 25: Pop + 26: Branch(28) B6: - 31: Branch(4) + 27: Branch(4) B7: - 32: Ret + 28: Ret } entry public guess_flips_directly(Arg0: vector) /* def_idx: 1 */ { L1: loc0: u64 L2: loc1: u64 -L3: loc2: u64 B0: 0: LdU64(0) 1: StLoc[1](loc0: u64) B1: 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: ImmBorrowLoc[0](Arg0: vector) - 5: VecLen(2) - 6: StLoc[3](loc2: u64) - 7: MoveLoc[2](loc1: u64) - 8: MoveLoc[3](loc2: u64) - 9: Lt - 10: BrFalse(24) + 3: ImmBorrowLoc[0](Arg0: vector) + 4: VecLen(2) + 5: Lt + 6: BrFalse(20) B2: - 11: ImmBorrowLoc[0](Arg0: vector) - 12: CopyLoc[1](loc0: u64) - 13: VecImmBorrow(2) - 14: ReadRef - 15: LdU8(0) - 16: Neq - 17: BrFalse(19) + 7: ImmBorrowLoc[0](Arg0: vector) + 8: CopyLoc[1](loc0: u64) + 9: VecImmBorrow(2) + 10: ReadRef + 11: LdU8(0) + 12: Neq + 13: BrFalse(15) B3: - 18: Branch(26) + 14: Branch(22) B4: - 19: MoveLoc[1](loc0: u64) - 20: LdU64(1) - 21: Add - 22: StLoc[1](loc0: u64) - 23: Branch(25) + 15: MoveLoc[1](loc0: u64) + 16: LdU64(1) + 17: Add + 18: StLoc[1](loc0: u64) + 19: Branch(21) B5: - 24: Branch(26) + 20: Branch(22) B6: - 25: Branch(2) + 21: Branch(2) B7: - 26: Ret + 22: Ret } entry public guess_with_break_without_inline(Arg0: vector) /* def_idx: 2 */ { B0: @@ -101,7 +91,6 @@ entry public guess_without_break_with_inline(Arg0: vector) /* def_idx: 3 */ L1: loc0: &vector L2: loc1: u64 L3: loc2: u64 -L4: loc3: u64 B0: 0: ImmBorrowLoc[0](Arg0: vector) 1: StLoc[1](loc0: &vector) @@ -109,87 +98,78 @@ B0: 3: StLoc[2](loc1: u64) B1: 4: CopyLoc[2](loc1: u64) - 5: StLoc[3](loc2: u64) - 6: CopyLoc[1](loc0: &vector) - 7: VecLen(2) - 8: StLoc[4](loc3: u64) - 9: MoveLoc[3](loc2: u64) - 10: MoveLoc[4](loc3: u64) - 11: Lt - 12: BrFalse(30) + 5: CopyLoc[1](loc0: &vector) + 6: VecLen(2) + 7: Lt + 8: BrFalse(26) B2: - 13: CopyLoc[1](loc0: &vector) - 14: CopyLoc[2](loc1: u64) - 15: VecImmBorrow(2) - 16: ReadRef - 17: LdU8(0) - 18: Eq - 19: BrFalse(21) + 9: CopyLoc[1](loc0: &vector) + 10: CopyLoc[2](loc1: u64) + 11: VecImmBorrow(2) + 12: ReadRef + 13: LdU8(0) + 14: Eq + 15: BrFalse(17) B3: - 20: Branch(25) + 16: Branch(21) B4: - 21: MoveLoc[1](loc0: &vector) - 22: Pop - 23: LdU64(3) - 24: Abort + 17: MoveLoc[1](loc0: &vector) + 18: Pop + 19: LdU64(3) + 20: Abort B5: - 25: MoveLoc[2](loc1: u64) - 26: LdU64(1) - 27: Add - 28: StLoc[2](loc1: u64) - 29: Branch(33) + 21: MoveLoc[2](loc1: u64) + 22: LdU64(1) + 23: Add + 24: StLoc[2](loc1: u64) + 25: Branch(29) B6: - 30: MoveLoc[1](loc0: &vector) - 31: Pop - 32: Branch(34) + 26: MoveLoc[1](loc0: &vector) + 27: Pop + 28: Branch(30) B7: - 33: Branch(4) + 29: Branch(4) B8: - 34: Ret + 30: Ret } loops_with_break_no_inline(Arg0: &vector) /* def_idx: 4 */ { L1: loc0: u64 L2: loc1: u64 -L3: loc2: u64 B0: 0: LdU64(0) 1: StLoc[1](loc0: u64) B1: 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: CopyLoc[0](Arg0: &vector) - 5: VecLen(2) - 6: StLoc[3](loc2: u64) - 7: MoveLoc[2](loc1: u64) - 8: MoveLoc[3](loc2: u64) - 9: Lt - 10: BrFalse(26) + 3: CopyLoc[0](Arg0: &vector) + 4: VecLen(2) + 5: Lt + 6: BrFalse(22) B2: - 11: CopyLoc[0](Arg0: &vector) - 12: CopyLoc[1](loc0: u64) - 13: VecImmBorrow(2) - 14: ReadRef - 15: LdU8(0) - 16: Neq - 17: BrFalse(21) + 7: CopyLoc[0](Arg0: &vector) + 8: CopyLoc[1](loc0: u64) + 9: VecImmBorrow(2) + 10: ReadRef + 11: LdU8(0) + 12: Neq + 13: BrFalse(17) B3: - 18: MoveLoc[0](Arg0: &vector) - 19: Pop - 20: Branch(30) + 14: MoveLoc[0](Arg0: &vector) + 15: Pop + 16: Branch(26) B4: - 21: MoveLoc[1](loc0: u64) - 22: LdU64(1) - 23: Add - 24: StLoc[1](loc0: u64) - 25: Branch(29) + 17: MoveLoc[1](loc0: u64) + 18: LdU64(1) + 19: Add + 20: StLoc[1](loc0: u64) + 21: Branch(25) B5: - 26: MoveLoc[0](Arg0: &vector) - 27: Pop - 28: Branch(30) + 22: MoveLoc[0](Arg0: &vector) + 23: Pop + 24: Branch(26) B6: - 29: Branch(2) + 25: Branch(2) B7: - 30: Ret + 26: Ret } test_guess_directly() /* def_idx: 5 */ { B0: diff --git a/third_party/move/move-compiler-v2/tests/control-flow-simplification/bug-10253.on.exp b/third_party/move/move-compiler-v2/tests/control-flow-simplification/bug-10253.on.exp index f5fce68026abf2..11a6f4028f8eb0 100644 --- a/third_party/move/move-compiler-v2/tests/control-flow-simplification/bug-10253.on.exp +++ b/third_party/move/move-compiler-v2/tests/control-flow-simplification/bug-10253.on.exp @@ -234,7 +234,6 @@ entry public guess_flips(Arg0: vector) /* def_idx: 0 */ { L1: loc0: &vector L2: loc1: u64 L3: loc2: u64 -L4: loc3: u64 B0: 0: ImmBorrowLoc[0](Arg0: vector) 1: StLoc[1](loc0: &vector) @@ -242,75 +241,66 @@ B0: 3: StLoc[2](loc1: u64) B1: 4: CopyLoc[2](loc1: u64) - 5: StLoc[3](loc2: u64) - 6: CopyLoc[1](loc0: &vector) - 7: VecLen(2) - 8: StLoc[4](loc3: u64) - 9: MoveLoc[3](loc2: u64) - 10: MoveLoc[4](loc3: u64) - 11: Lt - 12: BrFalse(28) + 5: CopyLoc[1](loc0: &vector) + 6: VecLen(2) + 7: Lt + 8: BrFalse(24) B2: - 13: CopyLoc[1](loc0: &vector) - 14: CopyLoc[2](loc1: u64) - 15: VecImmBorrow(2) - 16: ReadRef - 17: LdU8(0) - 18: Neq - 19: BrFalse(23) + 9: CopyLoc[1](loc0: &vector) + 10: CopyLoc[2](loc1: u64) + 11: VecImmBorrow(2) + 12: ReadRef + 13: LdU8(0) + 14: Neq + 15: BrFalse(19) B3: - 20: MoveLoc[1](loc0: &vector) - 21: Pop + 16: MoveLoc[1](loc0: &vector) + 17: Pop B4: - 22: Ret + 18: Ret B5: - 23: MoveLoc[2](loc1: u64) - 24: LdU64(1) - 25: Add - 26: StLoc[2](loc1: u64) - 27: Branch(4) + 19: MoveLoc[2](loc1: u64) + 20: LdU64(1) + 21: Add + 22: StLoc[2](loc1: u64) + 23: Branch(4) B6: - 28: MoveLoc[1](loc0: &vector) - 29: Pop - 30: Branch(22) + 24: MoveLoc[1](loc0: &vector) + 25: Pop + 26: Branch(18) } entry public guess_flips_directly(Arg0: vector) /* def_idx: 1 */ { L1: loc0: u64 L2: loc1: u64 -L3: loc2: u64 B0: 0: LdU64(0) 1: StLoc[1](loc0: u64) B1: 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: ImmBorrowLoc[0](Arg0: vector) - 5: VecLen(2) - 6: StLoc[3](loc2: u64) - 7: MoveLoc[2](loc1: u64) - 8: MoveLoc[3](loc2: u64) - 9: Lt - 10: BrTrue(12) + 3: ImmBorrowLoc[0](Arg0: vector) + 4: VecLen(2) + 5: Lt + 6: BrTrue(8) B2: - 11: Branch(20) + 7: Branch(16) B3: - 12: ImmBorrowLoc[0](Arg0: vector) - 13: CopyLoc[1](loc0: u64) - 14: VecImmBorrow(2) - 15: ReadRef - 16: LdU8(0) - 17: Neq - 18: BrFalse(21) + 8: ImmBorrowLoc[0](Arg0: vector) + 9: CopyLoc[1](loc0: u64) + 10: VecImmBorrow(2) + 11: ReadRef + 12: LdU8(0) + 13: Neq + 14: BrFalse(17) B4: - 19: Branch(20) + 15: Branch(16) B5: - 20: Ret + 16: Ret B6: - 21: MoveLoc[1](loc0: u64) - 22: LdU64(1) - 23: Add - 24: StLoc[1](loc0: u64) - 25: Branch(2) + 17: MoveLoc[1](loc0: u64) + 18: LdU64(1) + 19: Add + 20: StLoc[1](loc0: u64) + 21: Branch(2) } entry public guess_with_break_without_inline(Arg0: vector) /* def_idx: 2 */ { B0: @@ -322,7 +312,6 @@ entry public guess_without_break_with_inline(Arg0: vector) /* def_idx: 3 */ L1: loc0: &vector L2: loc1: u64 L3: loc2: u64 -L4: loc3: u64 B0: 0: ImmBorrowLoc[0](Arg0: vector) 1: StLoc[1](loc0: &vector) @@ -330,78 +319,69 @@ B0: 3: StLoc[2](loc1: u64) B1: 4: CopyLoc[2](loc1: u64) - 5: StLoc[3](loc2: u64) - 6: CopyLoc[1](loc0: &vector) - 7: VecLen(2) - 8: StLoc[4](loc3: u64) - 9: MoveLoc[3](loc2: u64) - 10: MoveLoc[4](loc3: u64) - 11: Lt - 12: BrFalse(29) + 5: CopyLoc[1](loc0: &vector) + 6: VecLen(2) + 7: Lt + 8: BrFalse(25) B2: - 13: CopyLoc[1](loc0: &vector) - 14: CopyLoc[2](loc1: u64) - 15: VecImmBorrow(2) - 16: ReadRef - 17: LdU8(0) - 18: Eq - 19: BrFalse(25) + 9: CopyLoc[1](loc0: &vector) + 10: CopyLoc[2](loc1: u64) + 11: VecImmBorrow(2) + 12: ReadRef + 13: LdU8(0) + 14: Eq + 15: BrFalse(21) B3: - 20: MoveLoc[2](loc1: u64) - 21: LdU64(1) - 22: Add - 23: StLoc[2](loc1: u64) - 24: Branch(4) + 16: MoveLoc[2](loc1: u64) + 17: LdU64(1) + 18: Add + 19: StLoc[2](loc1: u64) + 20: Branch(4) B4: + 21: MoveLoc[1](loc0: &vector) + 22: Pop + 23: LdU64(3) + 24: Abort +B5: 25: MoveLoc[1](loc0: &vector) 26: Pop - 27: LdU64(3) - 28: Abort -B5: - 29: MoveLoc[1](loc0: &vector) - 30: Pop - 31: Ret + 27: Ret } loops_with_break_no_inline(Arg0: &vector) /* def_idx: 4 */ { L1: loc0: u64 L2: loc1: u64 -L3: loc2: u64 B0: 0: LdU64(0) 1: StLoc[1](loc0: u64) B1: 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: CopyLoc[0](Arg0: &vector) - 5: VecLen(2) - 6: StLoc[3](loc2: u64) - 7: MoveLoc[2](loc1: u64) - 8: MoveLoc[3](loc2: u64) - 9: Lt - 10: BrFalse(26) + 3: CopyLoc[0](Arg0: &vector) + 4: VecLen(2) + 5: Lt + 6: BrFalse(22) B2: - 11: CopyLoc[0](Arg0: &vector) - 12: CopyLoc[1](loc0: u64) - 13: VecImmBorrow(2) - 14: ReadRef - 15: LdU8(0) - 16: Neq - 17: BrFalse(21) + 7: CopyLoc[0](Arg0: &vector) + 8: CopyLoc[1](loc0: u64) + 9: VecImmBorrow(2) + 10: ReadRef + 11: LdU8(0) + 12: Neq + 13: BrFalse(17) B3: - 18: MoveLoc[0](Arg0: &vector) - 19: Pop + 14: MoveLoc[0](Arg0: &vector) + 15: Pop B4: - 20: Ret + 16: Ret B5: - 21: MoveLoc[1](loc0: u64) - 22: LdU64(1) - 23: Add - 24: StLoc[1](loc0: u64) - 25: Branch(2) + 17: MoveLoc[1](loc0: u64) + 18: LdU64(1) + 19: Add + 20: StLoc[1](loc0: u64) + 21: Branch(2) B6: - 26: MoveLoc[0](Arg0: &vector) - 27: Pop - 28: Branch(20) + 22: MoveLoc[0](Arg0: &vector) + 23: Pop + 24: Branch(16) } test_guess_directly() /* def_idx: 5 */ { B0: diff --git a/third_party/move/move-compiler-v2/tests/control-flow-simplification/jump-label.off.exp b/third_party/move/move-compiler-v2/tests/control-flow-simplification/jump-label.off.exp index 7894953e360c3d..af6586a3f51123 100644 --- a/third_party/move/move-compiler-v2/tests/control-flow-simplification/jump-label.off.exp +++ b/third_party/move/move-compiler-v2/tests/control-flow-simplification/jump-label.off.exp @@ -10,55 +10,46 @@ use 0000000000000000000000000000000000000000000000000000000000000001::string; test(Arg0: vector): Ty0 /* def_idx: 0 */ { L1: loc0: String L2: loc1: String -L3: loc2: String B0: 0: Call foo(): String 1: StLoc[1](loc0: String) 2: CopyLoc[1](loc0: String) - 3: StLoc[2](loc1: String) - 4: LdConst[0](Vector(U8): [4, 98, 111, 111, 108]) - 5: Call string::utf8(vector): String - 6: StLoc[3](loc2: String) - 7: MoveLoc[2](loc1: String) - 8: MoveLoc[3](loc2: String) - 9: Eq - 10: BrFalse(15) + 3: LdConst[0](Vector(U8): [4, 98, 111, 111, 108]) + 4: Call string::utf8(vector): String + 5: Eq + 6: BrFalse(11) B1: - 11: MoveLoc[0](Arg0: vector) - 12: Call baz(vector): bool - 13: Call bar(bool): Ty0 - 14: Ret + 7: MoveLoc[0](Arg0: vector) + 8: Call baz(vector): bool + 9: Call bar(bool): Ty0 + 10: Ret B2: - 15: CopyLoc[1](loc0: String) - 16: StLoc[2](loc1: String) - 17: LdConst[1](Vector(U8): [2, 117, 56]) - 18: Call string::utf8(vector): String - 19: StLoc[3](loc2: String) - 20: MoveLoc[2](loc1: String) - 21: MoveLoc[3](loc2: String) - 22: Eq - 23: BrFalse(28) + 11: CopyLoc[1](loc0: String) + 12: LdConst[1](Vector(U8): [2, 117, 56]) + 13: Call string::utf8(vector): String + 14: Eq + 15: BrFalse(20) B3: - 24: MoveLoc[0](Arg0: vector) - 25: Call baz(vector): bool - 26: Call bar(bool): Ty0 - 27: Ret + 16: MoveLoc[0](Arg0: vector) + 17: Call baz(vector): bool + 18: Call bar(bool): Ty0 + 19: Ret B4: - 28: LdConst[2](Vector(U8): [3, 117, 54, 52]) - 29: Call string::utf8(vector): String - 30: StLoc[2](loc1: String) - 31: MoveLoc[1](loc0: String) - 32: MoveLoc[2](loc1: String) - 33: Eq - 34: BrFalse(39) + 20: LdConst[2](Vector(U8): [3, 117, 54, 52]) + 21: Call string::utf8(vector): String + 22: StLoc[2](loc1: String) + 23: MoveLoc[1](loc0: String) + 24: MoveLoc[2](loc1: String) + 25: Eq + 26: BrFalse(31) B5: - 35: MoveLoc[0](Arg0: vector) - 36: Call baz(vector): bool - 37: Call bar(bool): Ty0 - 38: Ret + 27: MoveLoc[0](Arg0: vector) + 28: Call baz(vector): bool + 29: Call bar(bool): Ty0 + 30: Ret B6: - 39: LdU64(0) - 40: Abort + 31: LdU64(0) + 32: Abort } bar(Arg0: bool): Ty0 /* def_idx: 1 */ { B0: diff --git a/third_party/move/move-compiler-v2/tests/control-flow-simplification/jump-label.on.exp b/third_party/move/move-compiler-v2/tests/control-flow-simplification/jump-label.on.exp index 5ad35eeb9ecaeb..23438ea680516c 100644 --- a/third_party/move/move-compiler-v2/tests/control-flow-simplification/jump-label.on.exp +++ b/third_party/move/move-compiler-v2/tests/control-flow-simplification/jump-label.on.exp @@ -94,55 +94,46 @@ use 0000000000000000000000000000000000000000000000000000000000000001::string; test(Arg0: vector): Ty0 /* def_idx: 0 */ { L1: loc0: String L2: loc1: String -L3: loc2: String B0: 0: Call foo(): String 1: StLoc[1](loc0: String) 2: CopyLoc[1](loc0: String) - 3: StLoc[2](loc1: String) - 4: LdConst[0](Vector(U8): [4, 98, 111, 111, 108]) - 5: Call string::utf8(vector): String - 6: StLoc[3](loc2: String) - 7: MoveLoc[2](loc1: String) - 8: MoveLoc[3](loc2: String) - 9: Eq - 10: BrFalse(15) + 3: LdConst[0](Vector(U8): [4, 98, 111, 111, 108]) + 4: Call string::utf8(vector): String + 5: Eq + 6: BrFalse(11) B1: - 11: MoveLoc[0](Arg0: vector) - 12: Call baz(vector): bool - 13: Call bar(bool): Ty0 - 14: Ret + 7: MoveLoc[0](Arg0: vector) + 8: Call baz(vector): bool + 9: Call bar(bool): Ty0 + 10: Ret B2: - 15: CopyLoc[1](loc0: String) - 16: StLoc[2](loc1: String) - 17: LdConst[1](Vector(U8): [2, 117, 56]) - 18: Call string::utf8(vector): String - 19: StLoc[3](loc2: String) - 20: MoveLoc[2](loc1: String) - 21: MoveLoc[3](loc2: String) - 22: Eq - 23: BrFalse(28) + 11: CopyLoc[1](loc0: String) + 12: LdConst[1](Vector(U8): [2, 117, 56]) + 13: Call string::utf8(vector): String + 14: Eq + 15: BrFalse(20) B3: - 24: MoveLoc[0](Arg0: vector) - 25: Call baz(vector): bool - 26: Call bar(bool): Ty0 - 27: Ret + 16: MoveLoc[0](Arg0: vector) + 17: Call baz(vector): bool + 18: Call bar(bool): Ty0 + 19: Ret B4: - 28: LdConst[2](Vector(U8): [3, 117, 54, 52]) - 29: Call string::utf8(vector): String - 30: StLoc[2](loc1: String) - 31: MoveLoc[1](loc0: String) - 32: MoveLoc[2](loc1: String) - 33: Eq - 34: BrFalse(39) + 20: LdConst[2](Vector(U8): [3, 117, 54, 52]) + 21: Call string::utf8(vector): String + 22: StLoc[2](loc1: String) + 23: MoveLoc[1](loc0: String) + 24: MoveLoc[2](loc1: String) + 25: Eq + 26: BrFalse(31) B5: - 35: MoveLoc[0](Arg0: vector) - 36: Call baz(vector): bool - 37: Call bar(bool): Ty0 - 38: Ret + 27: MoveLoc[0](Arg0: vector) + 28: Call baz(vector): bool + 29: Call bar(bool): Ty0 + 30: Ret B6: - 39: LdU64(0) - 40: Abort + 31: LdU64(0) + 32: Abort } bar(Arg0: bool): Ty0 /* def_idx: 1 */ { B0: diff --git a/third_party/move/move-compiler-v2/tests/eager-pushes/framework_reduced_06.exp b/third_party/move/move-compiler-v2/tests/eager-pushes/framework_reduced_06.exp index f55c5a103ba6d5..937040361d4117 100644 --- a/third_party/move/move-compiler-v2/tests/eager-pushes/framework_reduced_06.exp +++ b/third_party/move/move-compiler-v2/tests/eager-pushes/framework_reduced_06.exp @@ -187,7 +187,6 @@ B0: public test(Arg0: &mut S, Arg1: S) /* def_idx: 3 */ { L2: loc0: u64 L3: loc1: u64 -L4: loc2: &mut S B0: 0: LdU64(0) 1: StLoc[2](loc0: u64) @@ -195,28 +194,24 @@ B1: 2: CopyLoc[2](loc0: u64) 3: LdU64(42) 4: Lt - 5: BrFalse(20) + 5: BrFalse(16) B2: 6: CopyLoc[0](Arg0: &mut S) - 7: StLoc[4](loc2: &mut S) - 8: MutBorrowLoc[1](Arg1: S) - 9: CopyLoc[2](loc0: u64) - 10: Call bar(&mut S, u64): u64 - 11: StLoc[3](loc1: u64) - 12: MoveLoc[4](loc2: &mut S) - 13: MoveLoc[3](loc1: u64) - 14: Call foo(&mut S, u64) - 15: MoveLoc[2](loc0: u64) - 16: LdU64(1) - 17: Add - 18: StLoc[2](loc0: u64) - 19: Branch(2) + 7: MutBorrowLoc[1](Arg1: S) + 8: CopyLoc[2](loc0: u64) + 9: Call bar(&mut S, u64): u64 + 10: Call foo(&mut S, u64) + 11: MoveLoc[2](loc0: u64) + 12: LdU64(1) + 13: Add + 14: StLoc[2](loc0: u64) + 15: Branch(2) B3: - 20: MoveLoc[0](Arg0: &mut S) - 21: Pop - 22: MoveLoc[1](Arg1: S) - 23: Call destroy(S) - 24: Ret + 16: MoveLoc[0](Arg0: &mut S) + 17: Pop + 18: MoveLoc[1](Arg1: S) + 19: Call destroy(S) + 20: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/eager-pushes/move_stdlib_reduced.exp b/third_party/move/move-compiler-v2/tests/eager-pushes/move_stdlib_reduced.exp index 5ff4fea83d589a..2ebaeb0bea0842 100644 --- a/third_party/move/move-compiler-v2/tests/eager-pushes/move_stdlib_reduced.exp +++ b/third_party/move/move-compiler-v2/tests/eager-pushes/move_stdlib_reduced.exp @@ -119,29 +119,24 @@ B0: } public foo(Arg0: &mut u64, Arg1: u64) /* def_idx: 1 */ { L2: loc0: u64 -L3: loc1: &mut u64 B0: 0: CopyLoc[1](Arg1: u64) 1: LdU64(0) 2: Gt - 3: BrFalse(16) + 3: BrFalse(12) B1: 4: CopyLoc[0](Arg0: &mut u64) - 5: StLoc[3](loc1: &mut u64) - 6: Call one(): u64 - 7: StLoc[2](loc0: u64) - 8: MoveLoc[3](loc1: &mut u64) - 9: MoveLoc[2](loc0: u64) - 10: Call bar(&mut u64, u64) - 11: MoveLoc[1](Arg1: u64) - 12: LdU64(1) - 13: Sub - 14: StLoc[1](Arg1: u64) - 15: Branch(0) + 5: Call one(): u64 + 6: Call bar(&mut u64, u64) + 7: MoveLoc[1](Arg1: u64) + 8: LdU64(1) + 9: Sub + 10: StLoc[1](Arg1: u64) + 11: Branch(0) B2: - 16: MoveLoc[0](Arg0: &mut u64) - 17: Pop - 18: Ret + 12: MoveLoc[0](Arg0: &mut u64) + 13: Pop + 14: Ret } one(): u64 /* def_idx: 2 */ { B0: diff --git a/third_party/move/move-compiler-v2/tests/eager-pushes/txn_reduced_01.exp b/third_party/move/move-compiler-v2/tests/eager-pushes/txn_reduced_01.exp new file mode 100644 index 00000000000000..a36517680038a2 --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/eager-pushes/txn_reduced_01.exp @@ -0,0 +1,176 @@ +============ initial bytecode ================ + +[variant baseline] +fun m::call_other($t0: &signer, $t1: address, $t2: u64) { + 0: return () +} + + +[variant baseline] +public fun m::test($t0: &signer, $t1: vector
, $t2: vector) { + var $t3: u64 + var $t4: &vector
+ var $t5: u64 + var $t6: bool + var $t7: &address + var $t8: &vector
+ var $t9: &u64 + var $t10: &vector + var $t11: address + var $t12: u64 + var $t13: u64 + var $t14: u64 + 0: $t4 := borrow_local($t1) + 1: $t3 := vector::length
($t4) + 2: $t5 := 0 + 3: label L0 + 4: $t6 := <($t5, $t3) + 5: if ($t6) goto 6 else goto 18 + 6: label L2 + 7: $t8 := borrow_local($t1) + 8: $t7 := vector::borrow
($t8, $t5) + 9: $t10 := borrow_local($t2) + 10: $t9 := vector::borrow($t10, $t5) + 11: $t11 := read_ref($t7) + 12: $t12 := read_ref($t9) + 13: m::call_other($t0, $t11, $t12) + 14: $t14 := 1 + 15: $t13 := +($t5, $t14) + 16: $t5 := infer($t13) + 17: goto 20 + 18: label L3 + 19: goto 22 + 20: label L4 + 21: goto 3 + 22: label L1 + 23: return () +} + +============ after LiveVarAnalysisProcessor: ================ + +[variant baseline] +fun m::call_other($t0: &signer, $t1: address, $t2: u64) { + # live vars: $t0, $t1, $t2 + 0: drop($t0) + # live vars: + 1: return () +} + + +[variant baseline] +public fun m::test($t0: &signer, $t1: vector
, $t2: vector) { + var $t3: u64 + var $t4: &vector
+ var $t5: u64 + var $t6: bool + var $t7: &address + var $t8: &vector
[unused] + var $t9: &u64 + var $t10: &vector + var $t11: address + var $t12: u64 + var $t13: u64 [unused] + var $t14: u64 [unused] + # live vars: $t0, $t1, $t2 + 0: $t4 := borrow_local($t1) + # live vars: $t0, $t1, $t2, $t4 + 1: $t3 := vector::length
($t4) + # live vars: $t0, $t1, $t2, $t3 + 2: $t5 := 0 + # live vars: $t0, $t1, $t2, $t3, $t5 + 3: label L0 + # live vars: $t0, $t1, $t2, $t3, $t5 + 4: $t6 := <($t5, $t3) + # live vars: $t0, $t1, $t2, $t3, $t5, $t6 + 5: if ($t6) goto 6 else goto 18 + # live vars: $t0, $t1, $t2, $t3, $t5 + 6: label L2 + # live vars: $t0, $t1, $t2, $t3, $t5 + 7: $t4 := borrow_local($t1) + # live vars: $t0, $t1, $t2, $t3, $t4, $t5 + 8: $t7 := vector::borrow
($t4, $t5) + # live vars: $t0, $t1, $t2, $t3, $t5, $t7 + 9: $t10 := borrow_local($t2) + # live vars: $t0, $t1, $t2, $t3, $t5, $t7, $t10 + 10: $t9 := vector::borrow($t10, $t5) + # live vars: $t0, $t1, $t2, $t3, $t5, $t7, $t9 + 11: $t11 := read_ref($t7) + # live vars: $t0, $t1, $t2, $t3, $t5, $t9, $t11 + 12: $t12 := read_ref($t9) + # live vars: $t0, $t1, $t2, $t3, $t5, $t11, $t12 + 13: m::call_other($t0, $t11, $t12) + # live vars: $t0, $t1, $t2, $t3, $t5 + 14: $t12 := 1 + # live vars: $t0, $t1, $t2, $t3, $t5, $t12 + 15: $t12 := +($t5, $t12) + # live vars: $t0, $t1, $t2, $t3, $t12 + 16: $t5 := move($t12) + # live vars: $t0, $t1, $t2, $t3, $t5 + 17: goto 3 + # live vars: $t0, $t1, $t2, $t3, $t5 + 18: label L3 + # live vars: $t0 + 19: drop($t0) + # live vars: + 20: return () +} + + +============ disassembled file-format ================== +// Move bytecode v7 +module c0ffee.m { + + +call_other(Arg0: &signer, Arg1: address, Arg2: u64) /* def_idx: 0 */ { +B0: + 0: MoveLoc[0](Arg0: &signer) + 1: Pop + 2: Ret +} +public test(Arg0: &signer, Arg1: vector
, Arg2: vector) /* def_idx: 1 */ { +L3: loc0: u64 +L4: loc1: u64 +L5: loc2: &u64 +L6: loc3: &address +L7: loc4: u64 +L8: loc5: address +B0: + 0: ImmBorrowLoc[1](Arg1: vector
) + 1: VecLen(3) + 2: StLoc[3](loc0: u64) + 3: LdU64(0) + 4: StLoc[4](loc1: u64) +B1: + 5: CopyLoc[4](loc1: u64) + 6: CopyLoc[3](loc0: u64) + 7: Lt + 8: BrFalse(30) +B2: + 9: ImmBorrowLoc[1](Arg1: vector
) + 10: CopyLoc[4](loc1: u64) + 11: VecImmBorrow(3) + 12: ImmBorrowLoc[2](Arg2: vector) + 13: CopyLoc[4](loc1: u64) + 14: VecImmBorrow(4) + 15: StLoc[5](loc2: &u64) + 16: ReadRef + 17: MoveLoc[5](loc2: &u64) + 18: ReadRef + 19: StLoc[7](loc4: u64) + 20: StLoc[8](loc5: address) + 21: CopyLoc[0](Arg0: &signer) + 22: MoveLoc[8](loc5: address) + 23: MoveLoc[7](loc4: u64) + 24: Call call_other(&signer, address, u64) + 25: MoveLoc[4](loc1: u64) + 26: LdU64(1) + 27: Add + 28: StLoc[4](loc1: u64) + 29: Branch(5) +B3: + 30: MoveLoc[0](Arg0: &signer) + 31: Pop + 32: Ret +} +} +============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/eager-pushes/txn_reduced_01.move b/third_party/move/move-compiler-v2/tests/eager-pushes/txn_reduced_01.move new file mode 100644 index 00000000000000..362a29eea4abef --- /dev/null +++ b/third_party/move/move-compiler-v2/tests/eager-pushes/txn_reduced_01.move @@ -0,0 +1,16 @@ +module 0xc0ffee::m { + use std::vector; + + public fun test(from: &signer, to_vec: vector
, amount_vec: vector) { + let len = vector::length(&to_vec); + let i = 0; + while (i < len) { + let to = vector::borrow(&to_vec, i); + let amount = vector::borrow(&amount_vec, i); + call_other(from, *to, *amount); + i = i + 1; + } + } + + fun call_other(_from: &signer, _to: address, _amount: u64) {} +} diff --git a/third_party/move/move-compiler-v2/tests/file-format-generator/bug_14762.opt.exp b/third_party/move/move-compiler-v2/tests/file-format-generator/bug_14762.opt.exp index cf9cf708cd9e36..d04e138c63dba1 100644 --- a/third_party/move/move-compiler-v2/tests/file-format-generator/bug_14762.opt.exp +++ b/third_party/move/move-compiler-v2/tests/file-format-generator/bug_14762.opt.exp @@ -23,10 +23,9 @@ L3: loc1: bool L4: loc2: u64 L5: loc3: u64 L6: loc4: u64 -L7: loc5: bool -L8: loc6: u64 +L7: loc5: u64 +L8: loc6: bool L9: loc7: Option -L10: loc8: Option B0: 0: CopyLoc[0](Arg0: &mut S) 1: ImmBorrowField[0](S.entries: vector) @@ -55,7 +54,7 @@ B3: 21: ReadRef 22: CopyLoc[1](Arg1: vector) 23: Eq - 24: BrFalse(53) + 24: BrFalse(51) B4: 25: LdTrue 26: StLoc[3](loc1: bool) @@ -66,37 +65,35 @@ B5: 30: MoveLoc[2](loc0: &vector) 31: Pop 32: MoveLoc[3](loc1: bool) - 33: StLoc[7](loc5: bool) - 34: MoveLoc[4](loc2: u64) - 35: StLoc[8](loc6: u64) - 36: MoveLoc[7](loc5: bool) - 37: BrFalse(48) + 33: MoveLoc[4](loc2: u64) + 34: StLoc[7](loc5: u64) + 35: StLoc[8](loc6: bool) + 36: MoveLoc[8](loc6: bool) + 37: BrFalse(46) B6: 38: MoveLoc[0](Arg0: &mut S) 39: MutBorrowField[0](S.entries: vector) - 40: MoveLoc[8](loc6: u64) + 40: MoveLoc[7](loc5: u64) 41: Call vector::remove(&mut vector, u64): T 42: Call option::some(T): Option 43: StLoc[9](loc7: Option) B7: 44: MoveLoc[9](loc7: Option) - 45: StLoc[10](loc8: Option) - 46: MoveLoc[10](loc8: Option) - 47: Ret + 45: Ret B8: - 48: MoveLoc[0](Arg0: &mut S) - 49: Pop - 50: Call option::none(): Option - 51: StLoc[9](loc7: Option) - 52: Branch(44) + 46: MoveLoc[0](Arg0: &mut S) + 47: Pop + 48: Call option::none(): Option + 49: StLoc[9](loc7: Option) + 50: Branch(44) B9: - 53: LdU64(1) - 54: StLoc[8](loc6: u64) - 55: MoveLoc[5](loc3: u64) - 56: MoveLoc[8](loc6: u64) - 57: Add - 58: StLoc[5](loc3: u64) - 59: Branch(12) + 51: LdU64(1) + 52: StLoc[7](loc5: u64) + 53: MoveLoc[5](loc3: u64) + 54: MoveLoc[7](loc5: u64) + 55: Add + 56: StLoc[5](loc3: u64) + 57: Branch(12) } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/file-format-generator/fields.opt.exp b/third_party/move/move-compiler-v2/tests/file-format-generator/fields.opt.exp index e5a00ea3e8bf88..bddcd323020fa2 100644 --- a/third_party/move/move-compiler-v2/tests/file-format-generator/fields.opt.exp +++ b/third_party/move/move-compiler-v2/tests/file-format-generator/fields.opt.exp @@ -28,7 +28,6 @@ B0: } write_local_direct(): S /* def_idx: 2 */ { L0: loc0: S -L1: loc1: S B0: 0: LdU64(0) 1: LdU64(0) @@ -48,7 +47,6 @@ L0: loc0: S L1: loc1: u64 L2: loc2: &mut S L3: loc3: &mut u64 -L4: loc4: S B0: 0: LdU64(0) 1: LdU64(0) @@ -75,7 +73,6 @@ B0: 5: Ret } write_val(Arg0: S): S /* def_idx: 5 */ { -L1: loc0: S B0: 0: LdU64(42) 1: MutBorrowLoc[0](Arg0: S) diff --git a/third_party/move/move-compiler-v2/tests/file-format-generator/vector.opt.exp b/third_party/move/move-compiler-v2/tests/file-format-generator/vector.opt.exp index 86fe0b29dd1f55..59b0000ee2d3c7 100644 --- a/third_party/move/move-compiler-v2/tests/file-format-generator/vector.opt.exp +++ b/third_party/move/move-compiler-v2/tests/file-format-generator/vector.opt.exp @@ -10,8 +10,7 @@ use 0000000000000000000000000000000000000000000000000000000000000001::vector as public remove(Arg0: &mut vector, Arg1: u64): Ty0 /* def_idx: 0 */ { L2: loc0: u64 L3: loc1: u64 -L4: loc2: &mut vector -L5: loc3: u64 +L4: loc2: u64 B0: 0: CopyLoc[0](Arg0: &mut vector) 1: FreezeRef @@ -35,27 +34,21 @@ B3: 16: CopyLoc[1](Arg1: u64) 17: CopyLoc[2](loc0: u64) 18: Lt - 19: BrFalse(35) + 19: BrFalse(29) B4: 20: CopyLoc[0](Arg0: &mut vector) - 21: StLoc[4](loc2: &mut vector) - 22: CopyLoc[1](Arg1: u64) - 23: StLoc[3](loc1: u64) - 24: MoveLoc[1](Arg1: u64) - 25: LdU64(1) - 26: Add - 27: StLoc[1](Arg1: u64) - 28: CopyLoc[1](Arg1: u64) - 29: StLoc[5](loc3: u64) - 30: MoveLoc[4](loc2: &mut vector) - 31: MoveLoc[3](loc1: u64) - 32: MoveLoc[5](loc3: u64) - 33: VecSwap(1) - 34: Branch(16) + 21: CopyLoc[1](Arg1: u64) + 22: MoveLoc[1](Arg1: u64) + 23: LdU64(1) + 24: Add + 25: StLoc[1](Arg1: u64) + 26: CopyLoc[1](Arg1: u64) + 27: VecSwap(1) + 28: Branch(16) B5: - 35: MoveLoc[0](Arg0: &mut vector) - 36: VecPopBack(1) - 37: Ret + 29: MoveLoc[0](Arg0: &mut vector) + 30: VecPopBack(1) + 31: Ret } create(): vector /* def_idx: 1 */ { B0: diff --git a/third_party/move/move-compiler-v2/tests/flush-writes/def_use_07.off.exp b/third_party/move/move-compiler-v2/tests/flush-writes/def_use_07.off.exp index 6e0f61006aa5ab..da91b1fbdbafcb 100644 --- a/third_party/move/move-compiler-v2/tests/flush-writes/def_use_07.off.exp +++ b/third_party/move/move-compiler-v2/tests/flush-writes/def_use_07.off.exp @@ -18,7 +18,6 @@ B0: 1: Ret } public test(): u64 /* def_idx: 2 */ { -L0: loc0: u64 B0: 0: Call one(): u64 1: Call foo(u64): u64 diff --git a/third_party/move/move-compiler-v2/tests/flush-writes/def_use_07.on.exp b/third_party/move/move-compiler-v2/tests/flush-writes/def_use_07.on.exp index 27772260db6d99..e30fa68798f35d 100644 --- a/third_party/move/move-compiler-v2/tests/flush-writes/def_use_07.on.exp +++ b/third_party/move/move-compiler-v2/tests/flush-writes/def_use_07.on.exp @@ -58,7 +58,6 @@ B0: 1: Ret } public test(): u64 /* def_idx: 2 */ { -L0: loc0: u64 B0: 0: Call one(): u64 1: Call foo(u64): u64 diff --git a/third_party/move/move-compiler-v2/tests/flush-writes/loop_01.off.exp b/third_party/move/move-compiler-v2/tests/flush-writes/loop_01.off.exp index e42136755a54d0..9c907cf1b4e38f 100644 --- a/third_party/move/move-compiler-v2/tests/flush-writes/loop_01.off.exp +++ b/third_party/move/move-compiler-v2/tests/flush-writes/loop_01.off.exp @@ -6,17 +6,12 @@ module c0ffee.m { foo(Arg0: u64): u64 * u64 /* def_idx: 0 */ { L1: loc0: u64 -L2: loc1: u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: MoveLoc[0](Arg0: u64) - 3: LdU64(1) - 4: Sub - 5: StLoc[0](Arg0: u64) - 6: MoveLoc[1](loc0: u64) - 7: MoveLoc[0](Arg0: u64) - 8: Ret + 1: MoveLoc[0](Arg0: u64) + 2: LdU64(1) + 3: Sub + 4: Ret } public test1(Arg0: u64) /* def_idx: 1 */ { L1: loc0: u64 diff --git a/third_party/move/move-compiler-v2/tests/flush-writes/loop_01.on.exp b/third_party/move/move-compiler-v2/tests/flush-writes/loop_01.on.exp index 934f8720dab1c0..4640def1c25d2e 100644 --- a/third_party/move/move-compiler-v2/tests/flush-writes/loop_01.on.exp +++ b/third_party/move/move-compiler-v2/tests/flush-writes/loop_01.on.exp @@ -69,17 +69,12 @@ module c0ffee.m { foo(Arg0: u64): u64 * u64 /* def_idx: 0 */ { L1: loc0: u64 -L2: loc1: u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: MoveLoc[0](Arg0: u64) - 3: LdU64(1) - 4: Sub - 5: StLoc[0](Arg0: u64) - 6: MoveLoc[1](loc0: u64) - 7: MoveLoc[0](Arg0: u64) - 8: Ret + 1: MoveLoc[0](Arg0: u64) + 2: LdU64(1) + 3: Sub + 4: Ret } public test1(Arg0: u64) /* def_idx: 1 */ { B0: diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/args_with_side_effects.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/args_with_side_effects.exp index eb59c1bd4fbf04..a58b76fe10539c 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/args_with_side_effects.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/args_with_side_effects.exp @@ -160,18 +160,13 @@ B0: } public test(Arg0: u64): u64 /* def_idx: 1 */ { L1: loc0: u64 -L2: loc1: u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: MoveLoc[0](Arg0: u64) - 3: LdU64(1) - 4: Add - 5: StLoc[0](Arg0: u64) - 6: MoveLoc[1](loc0: u64) - 7: MoveLoc[0](Arg0: u64) - 8: Call add(u64, u64): u64 - 9: Ret + 1: MoveLoc[0](Arg0: u64) + 2: LdU64(1) + 3: Add + 4: Call add(u64, u64): u64 + 5: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/args_with_side_effects.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/args_with_side_effects.opt.exp index eb59c1bd4fbf04..a58b76fe10539c 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/args_with_side_effects.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/args_with_side_effects.opt.exp @@ -160,18 +160,13 @@ B0: } public test(Arg0: u64): u64 /* def_idx: 1 */ { L1: loc0: u64 -L2: loc1: u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: MoveLoc[0](Arg0: u64) - 3: LdU64(1) - 4: Add - 5: StLoc[0](Arg0: u64) - 6: MoveLoc[1](loc0: u64) - 7: MoveLoc[0](Arg0: u64) - 8: Call add(u64, u64): u64 - 9: Ret + 1: MoveLoc[0](Arg0: u64) + 2: LdU64(1) + 3: Add + 4: Call add(u64, u64): u64 + 5: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/borrowed_var.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/borrowed_var.exp index 95104220eaeb71..3fa0178005ebe8 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/borrowed_var.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/borrowed_var.exp @@ -139,7 +139,6 @@ module c0ffee.m { test() /* def_idx: 0 */ { L0: loc0: u64 L1: loc1: &u64 -L2: loc2: &u64 B0: 0: LdU64(5) 1: StLoc[0](loc0: u64) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/borrowed_var.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/borrowed_var.opt.exp index 6b10a489c154c2..8504db07966845 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/borrowed_var.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/borrowed_var.opt.exp @@ -151,7 +151,6 @@ test() /* def_idx: 0 */ { L0: loc0: u64 L1: loc1: &u64 L2: loc2: u64 -L3: loc3: &u64 B0: 0: LdU64(5) 1: StLoc[0](loc0: u64) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_2.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_2.exp index 4011aa65aadae6..0ca6e1586c9fd9 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_2.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_2.exp @@ -107,7 +107,6 @@ module c0ffee.m { test(Arg0: bool, Arg1: u64, Arg2: u64): u64 /* def_idx: 0 */ { L3: loc0: u64 -L4: loc1: u64 B0: 0: MoveLoc[0](Arg0: bool) 1: BrFalse(6) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_2.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_2.opt.exp index 4011aa65aadae6..0ca6e1586c9fd9 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_2.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_2.opt.exp @@ -107,7 +107,6 @@ module c0ffee.m { test(Arg0: bool, Arg1: u64, Arg2: u64): u64 /* def_idx: 0 */ { L3: loc0: u64 -L4: loc1: u64 B0: 0: MoveLoc[0](Arg0: bool) 1: BrFalse(6) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_3.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_3.exp index 957082ac783f06..62a6a6a09d546d 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_3.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_3.exp @@ -106,7 +106,6 @@ module c0ffee.m { test(Arg0: bool, Arg1: u64): u64 /* def_idx: 0 */ { L2: loc0: u64 -L3: loc1: u64 B0: 0: MoveLoc[0](Arg0: bool) 1: BrFalse(6) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_3.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_3.opt.exp index 957082ac783f06..62a6a6a09d546d 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_3.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_3.opt.exp @@ -106,7 +106,6 @@ module c0ffee.m { test(Arg0: bool, Arg1: u64): u64 /* def_idx: 0 */ { L2: loc0: u64 -L3: loc1: u64 B0: 0: MoveLoc[0](Arg0: bool) 1: BrFalse(6) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_assigns_then_moves_then_assigns.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_assigns_then_moves_then_assigns.exp index 2732ee278296f7..4ecbc23e87cafa 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_assigns_then_moves_then_assigns.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_assigns_then_moves_then_assigns.exp @@ -229,8 +229,6 @@ script { main() /* def_idx: 0 */ { L0: loc0: u64 -L1: loc1: u64 -L2: loc2: u64 B0: 0: LdU64(5) 1: StLoc[0](loc0: u64) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_assigns_then_moves_then_assigns.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_assigns_then_moves_then_assigns.opt.exp index 2732ee278296f7..4ecbc23e87cafa 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_assigns_then_moves_then_assigns.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/branch_assigns_then_moves_then_assigns.opt.exp @@ -229,8 +229,6 @@ script { main() /* def_idx: 0 */ { L0: loc0: u64 -L1: loc1: u64 -L2: loc2: u64 B0: 0: LdU64(5) 1: StLoc[0](loc0: u64) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_1.exp index 74ef544575ec32..aaa97c341d3f8b 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_1.exp @@ -312,18 +312,14 @@ B0: 0: Ret } public test1(Arg0: u64) /* def_idx: 2 */ { -L1: loc0: u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: MoveLoc[0](Arg0: u64) + 1: MoveLoc[0](Arg0: u64) + 2: Call consume(u64) 3: Call consume(u64) - 4: MoveLoc[1](loc0: u64) - 5: Call consume(u64) - 6: Ret + 4: Ret } public test2(Arg0: u64) /* def_idx: 3 */ { -L1: loc0: u64 B0: 0: CopyLoc[0](Arg0: u64) 1: Call consume(u64) @@ -332,18 +328,14 @@ B0: 4: Ret } public test3(Arg0: W) /* def_idx: 4 */ { -L1: loc0: W B0: 0: CopyLoc[0](Arg0: W) - 1: StLoc[1](loc0: W) - 2: MoveLoc[0](Arg0: W) + 1: MoveLoc[0](Arg0: W) + 2: Call consume_(W) 3: Call consume_(W) - 4: MoveLoc[1](loc0: W) - 5: Call consume_(W) - 6: Ret + 4: Ret } public test4(Arg0: W) /* def_idx: 5 */ { -L1: loc0: W B0: 0: CopyLoc[0](Arg0: W) 1: Call consume_(W) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_1.opt.exp index 74ef544575ec32..aaa97c341d3f8b 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_1.opt.exp @@ -312,18 +312,14 @@ B0: 0: Ret } public test1(Arg0: u64) /* def_idx: 2 */ { -L1: loc0: u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: MoveLoc[0](Arg0: u64) + 1: MoveLoc[0](Arg0: u64) + 2: Call consume(u64) 3: Call consume(u64) - 4: MoveLoc[1](loc0: u64) - 5: Call consume(u64) - 6: Ret + 4: Ret } public test2(Arg0: u64) /* def_idx: 3 */ { -L1: loc0: u64 B0: 0: CopyLoc[0](Arg0: u64) 1: Call consume(u64) @@ -332,18 +328,14 @@ B0: 4: Ret } public test3(Arg0: W) /* def_idx: 4 */ { -L1: loc0: W B0: 0: CopyLoc[0](Arg0: W) - 1: StLoc[1](loc0: W) - 2: MoveLoc[0](Arg0: W) + 1: MoveLoc[0](Arg0: W) + 2: Call consume_(W) 3: Call consume_(W) - 4: MoveLoc[1](loc0: W) - 5: Call consume_(W) - 6: Ret + 4: Ret } public test4(Arg0: W) /* def_idx: 5 */ { -L1: loc0: W B0: 0: CopyLoc[0](Arg0: W) 1: Call consume_(W) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_3.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_3.exp index 7ecc0e6a884b10..c15338be6f7e76 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_3.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_3.exp @@ -198,7 +198,6 @@ B0: 0: Ret } public test(Arg0: u32) /* def_idx: 2 */ { -L1: loc0: u32 B0: 0: CopyLoc[0](Arg0: u32) 1: Call consume(u32) @@ -207,7 +206,6 @@ B0: 4: Ret } public test_(Arg0: W) /* def_idx: 3 */ { -L1: loc0: W B0: 0: CopyLoc[0](Arg0: W) 1: Call consume_(W) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_3.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_3.opt.exp index 7ecc0e6a884b10..c15338be6f7e76 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_3.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_3.opt.exp @@ -198,7 +198,6 @@ B0: 0: Ret } public test(Arg0: u32) /* def_idx: 2 */ { -L1: loc0: u32 B0: 0: CopyLoc[0](Arg0: u32) 1: Call consume(u32) @@ -207,7 +206,6 @@ B0: 4: Ret } public test_(Arg0: W) /* def_idx: 3 */ { -L1: loc0: W B0: 0: CopyLoc[0](Arg0: W) 1: Call consume_(W) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_4.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_4.exp index f2b1a0c6caaf76..e801617e44e8f0 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_4.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_4.exp @@ -220,7 +220,6 @@ B0: 0: Ret } public test(Arg0: u32) /* def_idx: 2 */ { -L1: loc0: u32 B0: 0: CopyLoc[0](Arg0: u32) 1: Call consume(u32) @@ -229,7 +228,6 @@ B0: 4: Ret } public test_struct(Arg0: W) /* def_idx: 3 */ { -L1: loc0: W B0: 0: CopyLoc[0](Arg0: W) 1: Call consume_(W) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_4.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_4.opt.exp index f2b1a0c6caaf76..e801617e44e8f0 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_4.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/consume_4.opt.exp @@ -220,7 +220,6 @@ B0: 0: Ret } public test(Arg0: u32) /* def_idx: 2 */ { -L1: loc0: u32 B0: 0: CopyLoc[0](Arg0: u32) 1: Call consume(u32) @@ -229,7 +228,6 @@ B0: 4: Ret } public test_struct(Arg0: W) /* def_idx: 3 */ { -L1: loc0: W B0: 0: CopyLoc[0](Arg0: W) 1: Call consume_(W) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignments.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignments.exp index 6a5b5d0f8d8ff0..8dd3b318bd40c5 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignments.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignments.exp @@ -83,7 +83,6 @@ module c0ffee.m { cyclic(Arg0: u64): u64 /* def_idx: 0 */ { -L1: loc0: u64 B0: 0: MoveLoc[0](Arg0: u64) 1: Ret diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignments.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignments.opt.exp index 6a5b5d0f8d8ff0..8dd3b318bd40c5 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignments.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_assignments.opt.exp @@ -83,7 +83,6 @@ module c0ffee.m { cyclic(Arg0: u64): u64 /* def_idx: 0 */ { -L1: loc0: u64 B0: 0: MoveLoc[0](Arg0: u64) 1: Ret diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_dead_store.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_dead_store.exp index 860e46ca74071f..532b75388a4fbe 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_dead_store.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_dead_store.exp @@ -276,15 +276,17 @@ B1: 2: CopyLoc[3](loc0: u64) 3: CopyLoc[0](Arg0: u64) 4: Lt - 5: BrFalse(11) + 5: BrFalse(13) B2: - 6: MoveLoc[3](loc0: u64) - 7: LdU64(1) - 8: Add - 9: StLoc[3](loc0: u64) - 10: Branch(2) + 6: MoveLoc[2](Arg2: u64) + 7: MoveLoc[3](loc0: u64) + 8: LdU64(1) + 9: Add + 10: StLoc[3](loc0: u64) + 11: StLoc[2](Arg2: u64) + 12: Branch(2) B3: - 11: Ret + 13: Ret } public test2(Arg0: u64, Arg1: u64) /* def_idx: 1 */ { L2: loc0: u64 diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_dead_store.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_dead_store.opt.exp index 860e46ca74071f..532b75388a4fbe 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_dead_store.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/cyclic_dead_store.opt.exp @@ -276,15 +276,17 @@ B1: 2: CopyLoc[3](loc0: u64) 3: CopyLoc[0](Arg0: u64) 4: Lt - 5: BrFalse(11) + 5: BrFalse(13) B2: - 6: MoveLoc[3](loc0: u64) - 7: LdU64(1) - 8: Add - 9: StLoc[3](loc0: u64) - 10: Branch(2) + 6: MoveLoc[2](Arg2: u64) + 7: MoveLoc[3](loc0: u64) + 8: LdU64(1) + 9: Add + 10: StLoc[3](loc0: u64) + 11: StLoc[2](Arg2: u64) + 12: Branch(2) B3: - 11: Ret + 13: Ret } public test2(Arg0: u64, Arg1: u64) /* def_idx: 1 */ { L2: loc0: u64 diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.exp index 154ea1d90c9254..180cc62af2a3bb 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.exp @@ -122,7 +122,6 @@ module c0ffee.m { test(Arg0: u64): u64 /* def_idx: 0 */ { L1: loc0: &u64 -L2: loc1: u64 B0: 0: ImmBorrowLoc[0](Arg0: u64) 1: Pop diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.opt.exp index 154ea1d90c9254..180cc62af2a3bb 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/immut_refs_2.opt.exp @@ -122,7 +122,6 @@ module c0ffee.m { test(Arg0: u64): u64 /* def_idx: 0 */ { L1: loc0: &u64 -L2: loc1: u64 B0: 0: ImmBorrowLoc[0](Arg0: u64) 1: Pop diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.exp index 1fc069963391a9..6d8197b4a1bcd0 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_1.exp @@ -112,7 +112,6 @@ module c0ffee.m { test(): u64 /* def_idx: 0 */ { L0: loc0: u64 -L1: loc1: u64 B0: 0: LdU64(1) 1: LdU64(2) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_2.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_2.opt.exp index def8e4b7b85f50..6eb72ab89b2c06 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_2.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/intermingled_2.opt.exp @@ -110,13 +110,14 @@ module c0ffee.m { test(): u64 /* def_idx: 0 */ { L0: loc0: u64 +L1: loc1: u64 B0: 0: LdU64(1) 1: LdU64(1) 2: Add - 3: StLoc[0](loc0: u64) + 3: StLoc[1](loc1: u64) 4: LdU64(2) - 5: MoveLoc[0](loc0: u64) + 5: MoveLoc[1](loc1: u64) 6: Add 7: Ret } diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_1.exp index 3c4fe82378d7c5..b8c4d57d833a0f 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_1.exp @@ -189,11 +189,11 @@ B1: 7: BrFalse(15) B2: 8: CopyLoc[0](Arg0: u64) - 9: StLoc[1](loc0: u64) - 10: MoveLoc[2](loc1: u64) - 11: LdU64(1) - 12: Add - 13: StLoc[2](loc1: u64) + 9: MoveLoc[2](loc1: u64) + 10: LdU64(1) + 11: Add + 12: StLoc[2](loc1: u64) + 13: StLoc[1](loc0: u64) 14: Branch(4) B3: 15: MoveLoc[1](loc0: u64) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_1.opt.exp index 3c4fe82378d7c5..b8c4d57d833a0f 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_1.opt.exp @@ -189,11 +189,11 @@ B1: 7: BrFalse(15) B2: 8: CopyLoc[0](Arg0: u64) - 9: StLoc[1](loc0: u64) - 10: MoveLoc[2](loc1: u64) - 11: LdU64(1) - 12: Add - 13: StLoc[2](loc1: u64) + 9: MoveLoc[2](loc1: u64) + 10: LdU64(1) + 11: Add + 12: StLoc[2](loc1: u64) + 13: StLoc[1](loc0: u64) 14: Branch(4) B3: 15: MoveLoc[1](loc0: u64) diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_2.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_2.exp index edcfd71c7b42cc..3334689dfa1676 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_2.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_2.exp @@ -179,24 +179,24 @@ L2: loc1: u64 L3: loc2: u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: LdU64(0) + 1: LdU64(0) + 2: StLoc[1](loc0: u64) 3: StLoc[2](loc1: u64) B1: - 4: CopyLoc[2](loc1: u64) + 4: CopyLoc[1](loc0: u64) 5: LdU64(10) 6: Lt 7: BrFalse(15) B2: 8: CopyLoc[0](Arg0: u64) - 9: StLoc[1](loc0: u64) - 10: MoveLoc[2](loc1: u64) - 11: LdU64(1) - 12: Add + 9: MoveLoc[1](loc0: u64) + 10: LdU64(1) + 11: Add + 12: StLoc[1](loc0: u64) 13: StLoc[2](loc1: u64) 14: Branch(4) B3: - 15: MoveLoc[1](loc0: u64) + 15: MoveLoc[2](loc1: u64) 16: Ret } } diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_2.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_2.opt.exp index edcfd71c7b42cc..3334689dfa1676 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_2.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/loop_2.opt.exp @@ -179,24 +179,24 @@ L2: loc1: u64 L3: loc2: u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: LdU64(0) + 1: LdU64(0) + 2: StLoc[1](loc0: u64) 3: StLoc[2](loc1: u64) B1: - 4: CopyLoc[2](loc1: u64) + 4: CopyLoc[1](loc0: u64) 5: LdU64(10) 6: Lt 7: BrFalse(15) B2: 8: CopyLoc[0](Arg0: u64) - 9: StLoc[1](loc0: u64) - 10: MoveLoc[2](loc1: u64) - 11: LdU64(1) - 12: Add + 9: MoveLoc[1](loc0: u64) + 10: LdU64(1) + 11: Add + 12: StLoc[1](loc0: u64) 13: StLoc[2](loc1: u64) 14: Branch(4) B3: - 15: MoveLoc[1](loc0: u64) + 15: MoveLoc[2](loc1: u64) 16: Ret } } diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/mut_refs_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/mut_refs_1.exp index 8514f77eee3b52..f821096a76a3e7 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/mut_refs_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/mut_refs_1.exp @@ -96,18 +96,15 @@ module c0ffee.m { test(Arg0: u64): u64 /* def_idx: 0 */ { -L1: loc0: u64 -L2: loc1: &mut u64 +L1: loc0: &mut u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: MutBorrowLoc[0](Arg0: u64) - 3: StLoc[2](loc1: &mut u64) - 4: LdU64(1) - 5: MoveLoc[2](loc1: &mut u64) - 6: WriteRef - 7: MoveLoc[1](loc0: u64) - 8: Ret + 1: MutBorrowLoc[0](Arg0: u64) + 2: StLoc[1](loc0: &mut u64) + 3: LdU64(1) + 4: MoveLoc[1](loc0: &mut u64) + 5: WriteRef + 6: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/mut_refs_1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/mut_refs_1.opt.exp index 8514f77eee3b52..f821096a76a3e7 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/mut_refs_1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/mut_refs_1.opt.exp @@ -96,18 +96,15 @@ module c0ffee.m { test(Arg0: u64): u64 /* def_idx: 0 */ { -L1: loc0: u64 -L2: loc1: &mut u64 +L1: loc0: &mut u64 B0: 0: CopyLoc[0](Arg0: u64) - 1: StLoc[1](loc0: u64) - 2: MutBorrowLoc[0](Arg0: u64) - 3: StLoc[2](loc1: &mut u64) - 4: LdU64(1) - 5: MoveLoc[2](loc1: &mut u64) - 6: WriteRef - 7: MoveLoc[1](loc0: u64) - 8: Ret + 1: MutBorrowLoc[0](Arg0: u64) + 2: StLoc[1](loc0: &mut u64) + 3: LdU64(1) + 4: MoveLoc[1](loc0: &mut u64) + 5: WriteRef + 6: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.exp index a6a7f2aabdfa28..86b5890cae6d73 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.exp @@ -129,13 +129,13 @@ B0: 0: CopyLoc[0](Arg0: u64) 1: StLoc[1](loc0: u64) 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: MoveLoc[0](Arg0: u64) - 5: LdU64(1) - 6: Add - 7: Pop + 3: MoveLoc[0](Arg0: u64) + 4: LdU64(1) + 5: Add + 6: Pop + 7: StLoc[3](loc2: u64) 8: MoveLoc[1](loc0: u64) - 9: MoveLoc[2](loc1: u64) + 9: MoveLoc[3](loc2: u64) 10: Eq 11: Ret } diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.opt.exp index a6a7f2aabdfa28..86b5890cae6d73 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_1.opt.exp @@ -129,13 +129,13 @@ B0: 0: CopyLoc[0](Arg0: u64) 1: StLoc[1](loc0: u64) 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: MoveLoc[0](Arg0: u64) - 5: LdU64(1) - 6: Add - 7: Pop + 3: MoveLoc[0](Arg0: u64) + 4: LdU64(1) + 5: Add + 6: Pop + 7: StLoc[3](loc2: u64) 8: MoveLoc[1](loc0: u64) - 9: MoveLoc[2](loc1: u64) + 9: MoveLoc[3](loc2: u64) 10: Eq 11: Ret } diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.exp index 37fb2e50db1251..eb034ba9ffbafd 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.exp @@ -129,13 +129,13 @@ B0: 0: CopyLoc[0](Arg0: u64) 1: StLoc[1](loc0: u64) 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: MoveLoc[0](Arg0: u64) - 5: LdU64(1) - 6: Add - 7: Pop + 3: MoveLoc[0](Arg0: u64) + 4: LdU64(1) + 5: Add + 6: Pop + 7: StLoc[3](loc2: u64) 8: MoveLoc[1](loc0: u64) - 9: MoveLoc[2](loc1: u64) + 9: MoveLoc[3](loc2: u64) 10: Eq 11: Ret } diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.opt.exp index 37fb2e50db1251..eb034ba9ffbafd 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/seq_kills_2.opt.exp @@ -129,13 +129,13 @@ B0: 0: CopyLoc[0](Arg0: u64) 1: StLoc[1](loc0: u64) 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: MoveLoc[0](Arg0: u64) - 5: LdU64(1) - 6: Add - 7: Pop + 3: MoveLoc[0](Arg0: u64) + 4: LdU64(1) + 5: Add + 6: Pop + 7: StLoc[3](loc2: u64) 8: MoveLoc[1](loc0: u64) - 9: MoveLoc[2](loc1: u64) + 9: MoveLoc[3](loc2: u64) 10: Eq 11: Ret } diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.exp index 0d49f3e8a14f90..822f2455666243 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.exp @@ -113,20 +113,17 @@ module c0ffee.m { copy_kill(Arg0: u64): u64 /* def_idx: 0 */ { L1: loc0: u64 L2: loc1: u64 -L3: loc2: u64 B0: 0: CopyLoc[0](Arg0: u64) 1: StLoc[1](loc0: u64) 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: MoveLoc[0](Arg0: u64) - 5: LdU64(1) - 6: Add - 7: Pop - 8: MoveLoc[2](loc1: u64) - 9: MoveLoc[1](loc0: u64) - 10: Add - 11: Ret + 3: MoveLoc[0](Arg0: u64) + 4: LdU64(1) + 5: Add + 6: Pop + 7: MoveLoc[1](loc0: u64) + 8: Add + 9: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.opt.exp index 0d49f3e8a14f90..822f2455666243 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/straight_line_kills.opt.exp @@ -113,20 +113,17 @@ module c0ffee.m { copy_kill(Arg0: u64): u64 /* def_idx: 0 */ { L1: loc0: u64 L2: loc1: u64 -L3: loc2: u64 B0: 0: CopyLoc[0](Arg0: u64) 1: StLoc[1](loc0: u64) 2: CopyLoc[1](loc0: u64) - 3: StLoc[2](loc1: u64) - 4: MoveLoc[0](Arg0: u64) - 5: LdU64(1) - 6: Add - 7: Pop - 8: MoveLoc[2](loc1: u64) - 9: MoveLoc[1](loc0: u64) - 10: Add - 11: Ret + 3: MoveLoc[0](Arg0: u64) + 4: LdU64(1) + 5: Add + 6: Pop + 7: MoveLoc[1](loc0: u64) + 8: Add + 9: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/swap.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/swap.exp index 64990776e2cdc8..08533b6b6dd91c 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/swap.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/swap.exp @@ -92,14 +92,12 @@ public test(Arg0: u64, Arg1: u64): u64 * u64 /* def_idx: 0 */ { L2: loc0: u64 B0: 0: MoveLoc[0](Arg0: u64) - 1: StLoc[2](loc0: u64) - 2: MoveLoc[1](Arg1: u64) - 3: StLoc[0](Arg0: u64) - 4: MoveLoc[2](loc0: u64) - 5: StLoc[1](Arg1: u64) - 6: MoveLoc[0](Arg0: u64) - 7: MoveLoc[1](Arg1: u64) - 8: Ret + 1: MoveLoc[1](Arg1: u64) + 2: StLoc[0](Arg0: u64) + 3: StLoc[1](Arg1: u64) + 4: MoveLoc[0](Arg0: u64) + 5: MoveLoc[1](Arg1: u64) + 6: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/swap.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/swap.opt.exp index 64990776e2cdc8..08533b6b6dd91c 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/swap.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/swap.opt.exp @@ -92,14 +92,12 @@ public test(Arg0: u64, Arg1: u64): u64 * u64 /* def_idx: 0 */ { L2: loc0: u64 B0: 0: MoveLoc[0](Arg0: u64) - 1: StLoc[2](loc0: u64) - 2: MoveLoc[1](Arg1: u64) - 3: StLoc[0](Arg0: u64) - 4: MoveLoc[2](loc0: u64) - 5: StLoc[1](Arg1: u64) - 6: MoveLoc[0](Arg0: u64) - 7: MoveLoc[1](Arg1: u64) - 8: Ret + 1: MoveLoc[1](Arg1: u64) + 2: StLoc[0](Arg0: u64) + 3: StLoc[1](Arg1: u64) + 4: MoveLoc[0](Arg0: u64) + 5: MoveLoc[1](Arg1: u64) + 6: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/swap_in_a_loop.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/swap_in_a_loop.exp index e0b25100114af4..4b4283ceb66ace 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/swap_in_a_loop.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/swap_in_a_loop.exp @@ -201,23 +201,21 @@ B1: 2: CopyLoc[2](loc0: u64) 3: LdU64(0) 4: Gt - 5: BrFalse(17) + 5: BrFalse(15) B2: 6: MoveLoc[0](Arg0: u64) - 7: StLoc[3](loc1: u64) - 8: MoveLoc[1](Arg1: u64) - 9: StLoc[0](Arg0: u64) - 10: MoveLoc[3](loc1: u64) - 11: StLoc[1](Arg1: u64) - 12: MoveLoc[2](loc0: u64) - 13: LdU64(1) - 14: Sub - 15: StLoc[2](loc0: u64) - 16: Branch(2) + 7: MoveLoc[1](Arg1: u64) + 8: StLoc[0](Arg0: u64) + 9: MoveLoc[2](loc0: u64) + 10: LdU64(1) + 11: Sub + 12: StLoc[2](loc0: u64) + 13: StLoc[1](Arg1: u64) + 14: Branch(2) B3: - 17: MoveLoc[0](Arg0: u64) - 18: MoveLoc[1](Arg1: u64) - 19: Ret + 15: MoveLoc[0](Arg0: u64) + 16: MoveLoc[1](Arg1: u64) + 17: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/tests/variable-coalescing/swap_in_a_loop.opt.exp b/third_party/move/move-compiler-v2/tests/variable-coalescing/swap_in_a_loop.opt.exp index e0b25100114af4..4b4283ceb66ace 100644 --- a/third_party/move/move-compiler-v2/tests/variable-coalescing/swap_in_a_loop.opt.exp +++ b/third_party/move/move-compiler-v2/tests/variable-coalescing/swap_in_a_loop.opt.exp @@ -201,23 +201,21 @@ B1: 2: CopyLoc[2](loc0: u64) 3: LdU64(0) 4: Gt - 5: BrFalse(17) + 5: BrFalse(15) B2: 6: MoveLoc[0](Arg0: u64) - 7: StLoc[3](loc1: u64) - 8: MoveLoc[1](Arg1: u64) - 9: StLoc[0](Arg0: u64) - 10: MoveLoc[3](loc1: u64) - 11: StLoc[1](Arg1: u64) - 12: MoveLoc[2](loc0: u64) - 13: LdU64(1) - 14: Sub - 15: StLoc[2](loc0: u64) - 16: Branch(2) + 7: MoveLoc[1](Arg1: u64) + 8: StLoc[0](Arg0: u64) + 9: MoveLoc[2](loc0: u64) + 10: LdU64(1) + 11: Sub + 12: StLoc[2](loc0: u64) + 13: StLoc[1](Arg1: u64) + 14: Branch(2) B3: - 17: MoveLoc[0](Arg0: u64) - 18: MoveLoc[1](Arg1: u64) - 19: Ret + 15: MoveLoc[0](Arg0: u64) + 16: MoveLoc[1](Arg1: u64) + 17: Ret } } ============ bytecode verification succeeded ======== diff --git a/third_party/move/move-compiler-v2/transactional-tests/tests/no-v1-comparison/assert_one.optimize-no-simplify.exp b/third_party/move/move-compiler-v2/transactional-tests/tests/no-v1-comparison/assert_one.optimize-no-simplify.exp index 9d1a8ab06c8cb0..2161a50d2b658d 100644 --- a/third_party/move/move-compiler-v2/transactional-tests/tests/no-v1-comparison/assert_one.optimize-no-simplify.exp +++ b/third_party/move/move-compiler-v2/transactional-tests/tests/no-v1-comparison/assert_one.optimize-no-simplify.exp @@ -6,5 +6,5 @@ Error: Script execution failed with VMError: { sub_status: Some(14566554180833181696), location: script, indices: [], - offsets: [(FunctionDefinitionIndex(0), 31)], + offsets: [(FunctionDefinitionIndex(0), 27)], } diff --git a/third_party/move/move-compiler-v2/transactional-tests/tests/no-v1-comparison/assert_one.optimize.exp b/third_party/move/move-compiler-v2/transactional-tests/tests/no-v1-comparison/assert_one.optimize.exp index 9d1a8ab06c8cb0..2161a50d2b658d 100644 --- a/third_party/move/move-compiler-v2/transactional-tests/tests/no-v1-comparison/assert_one.optimize.exp +++ b/third_party/move/move-compiler-v2/transactional-tests/tests/no-v1-comparison/assert_one.optimize.exp @@ -6,5 +6,5 @@ Error: Script execution failed with VMError: { sub_status: Some(14566554180833181696), location: script, indices: [], - offsets: [(FunctionDefinitionIndex(0), 31)], + offsets: [(FunctionDefinitionIndex(0), 27)], }