diff --git a/examples/sizes.txt b/examples/sizes.txt index a44b56a6e2..a090be7b71 100644 --- a/examples/sizes.txt +++ b/examples/sizes.txt @@ -93,7 +93,7 @@ too_many_permutations 112 106 6 106 0 transaction/Transaction 996 932 64 932 0 tuple_support/TupleComparisons 136 75 61 75 0 - tuple_support/TupleSupport 632 406 226 406 0 + tuple_support/TupleSupport 643 413 230 413 0 typed_abi_call/Greeter 2861 2446 415 2446 0 typed_abi_call/Logger 896 762 134 762 0 unary/Unary 136 96 40 96 0 diff --git a/src/puya/ir/builder/main.py b/src/puya/ir/builder/main.py index 4b91e3282f..694e3688aa 100644 --- a/src/puya/ir/builder/main.py +++ b/src/puya/ir/builder/main.py @@ -329,6 +329,13 @@ def visit_checked_maybe(self, expr: awst_nodes.CheckedMaybe) -> TExpression: return value def visit_var_expression(self, expr: awst_nodes.VarExpression) -> TExpression: + # TODO: remove this once wtypes are available at IR layer and assign can deal with + # single item tuples correctly + if isinstance(expr.wtype, wtypes.WTuple) and len(expr.wtype.types) == 1: + ir_type = wtype_to_ir_type(expr.wtype.types[0]) + return self.context.ssa.read_variable( + expr.name, ir_type, self.context.block_builder.active_block + ) if isinstance(expr.wtype, wtypes.WTuple): return ValueTuple( source_location=expr.source_location, diff --git a/test_cases/tuple_support/out/TupleSupport.approval.mir b/test_cases/tuple_support/out/TupleSupport.approval.mir index be390af638..1e608be8c8 100644 --- a/test_cases/tuple_support/out/TupleSupport.approval.mir +++ b/test_cases/tuple_support/out/TupleSupport.approval.mir @@ -99,18 +99,19 @@ main_entrypoint@2: pop // get_uint_with_side_effect() tuple_support/tuple_support.py:57 byte "not empty2" // "not empty2" "not empty2" tuple_support/tuple_support.py:58 log // log("not empty2") tuple_support/tuple_support.py:58 - int 3 // 3 a + b tuple_support/tuple_support.py:59 - return // return a + b tuple_support/tuple_support.py:59 + callsub single_tuple // single_tuple() tuple_support/tuple_support.py:59 + int 3 // 3 a + b tuple_support/tuple_support.py:60 + return // return a + b tuple_support/tuple_support.py:60 // test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: add_three_values: - proto 3 1 // (𝕡) values.0#0,values.1#0,values.2#0 | @subroutine\ndef add_three_values(values: tuple[UInt64, UInt64, UInt64]) -> UInt64: tuple_support/tuple_support.py:121-122 + proto 3 1 // (𝕡) values.0#0,values.1#0,values.2#0 | @subroutine\ndef add_three_values(values: tuple[UInt64, UInt64, UInt64]) -> UInt64: tuple_support/tuple_support.py:128-129 byte "" // allocate 1 to stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4 | add_three_values_block@0: - int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4 | 0 UInt64(0) tuple_support/tuple_support.py:123 - // virtual: store total#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total = UInt64(0) tuple_support/tuple_support.py:123 + int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4 | 0 UInt64(0) tuple_support/tuple_support.py:130 + // virtual: store total#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total = UInt64(0) tuple_support/tuple_support.py:130 int 0 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | 0 // virtual: store tuple_index%0#0 to x-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | frame_dig -3 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | values.0#0 @@ -132,171 +133,171 @@ add_three_values_for_header_2@3: // Implicit fall through to add_three_values_for_body@4 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) value#3,tuple_index%0#0 | value#3, tuple_index%0#0 add_three_values_for_body@4: - frame_dig 1 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) value#3,tuple_index%0#0 | total#0 value#3, tuple_index%0#0 total += value tuple_support/tuple_support.py:125 - uncover 2 // load value#3 from x-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | total#0,value#3 total += value tuple_support/tuple_support.py:125 - + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | {+} total += value tuple_support/tuple_support.py:125 - dup // store total#0 to l-stack (copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | total#0,total#0 total += value tuple_support/tuple_support.py:125 - frame_bury 1 // store total#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | total#0 total += value tuple_support/tuple_support.py:125 + frame_dig 1 // load total#0 from f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) value#3,tuple_index%0#0 | total#0 value#3, tuple_index%0#0 total += value tuple_support/tuple_support.py:132 + uncover 2 // load value#3 from x-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | total#0,value#3 total += value tuple_support/tuple_support.py:132 + + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | {+} total += value tuple_support/tuple_support.py:132 + dup // store total#0 to l-stack (copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | total#0,total#0 total += value tuple_support/tuple_support.py:132 + frame_bury 1 // store total#0 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | (𝕏) tuple_index%0#0 | total#0 total += value tuple_support/tuple_support.py:132 uncover 1 // load tuple_index%0#0 from x-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0,tuple_index%0#0 dup // store tuple_index%0#0 to l-stack (copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0,tuple_index%0#0,tuple_index%0#0 int 1 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0,tuple_index%0#0,tuple_index%0#0,1 + // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0,tuple_index%0#0,{+} frame_bury 0 // store tuple_index%0#4 to f-stack (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0,tuple_index%0#0 - // virtual: load tuple_index%0#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0,tuple_index%0#0 for value in values: tuple_support/tuple_support.py:124 - switch add_three_values_for_header_1@2 add_three_values_for_header_2@3 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0 for value in values: tuple_support/tuple_support.py:124 - // virtual: load total#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0 for value in values: tuple_support/tuple_support.py:124 + // virtual: load tuple_index%0#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0,tuple_index%0#0 for value in values: tuple_support/tuple_support.py:131 + switch add_three_values_for_header_1@2 add_three_values_for_header_2@3 // (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0 for value in values: tuple_support/tuple_support.py:131 + // virtual: load total#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0 | (𝕗) tuple_index%0#4,total#0 | total#0 for value in values: tuple_support/tuple_support.py:131 frame_bury 0 - retsub // total#0 return total tuple_support/tuple_support.py:127 + retsub // total#0 return total tuple_support/tuple_support.py:134 // test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: bytes_combine: - proto 2 1 // (𝕡) arg.0#0,arg.1#0 | @subroutine\ndef bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: tuple_support/tuple_support.py:105-106 + proto 2 1 // (𝕡) arg.0#0,arg.1#0 | @subroutine\ndef bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: tuple_support/tuple_support.py:112-113 bytes_combine_block@0: - frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0 result = a + b tuple_support/tuple_support.py:108 - frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0,arg.1#0 result = a + b tuple_support/tuple_support.py:108 - concat // (𝕡) arg.0#0,arg.1#0 | {concat} a + b tuple_support/tuple_support.py:108 - // virtual: store result#0 to l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | result#0 result = a + b tuple_support/tuple_support.py:108 - // virtual: load result#0 from l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | result#0 return result tuple_support/tuple_support.py:109 - retsub // result#0 return result tuple_support/tuple_support.py:109 + frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0 result = a + b tuple_support/tuple_support.py:115 + frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | arg.0#0,arg.1#0 result = a + b tuple_support/tuple_support.py:115 + concat // (𝕡) arg.0#0,arg.1#0 | {concat} a + b tuple_support/tuple_support.py:115 + // virtual: store result#0 to l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | result#0 result = a + b tuple_support/tuple_support.py:115 + // virtual: load result#0 from l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | result#0 return result tuple_support/tuple_support.py:116 + retsub // result#0 return result tuple_support/tuple_support.py:116 // test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> uint64, uint64, uint64: addw2: - proto 4 3 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | @subroutine\ndef addw2(a: tuple[UInt64, UInt64], b: tuple[UInt64, UInt64]) -> tuple[UInt64, UInt6... tuple_support/tuple_support.py:130-131 + proto 4 3 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | @subroutine\ndef addw2(a: tuple[UInt64, UInt64], b: tuple[UInt64, UInt64]) -> tuple[UInt64, UInt6... tuple_support/tuple_support.py:137-138 addw2_block@0: - frame_dig -3 // load a.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.1#0 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:134 - frame_dig -1 // load b.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.1#0,b.1#0 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:134 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | {addw}.0,{addw}.1 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:134 - cover 1 // store c_lo#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,{addw}.0 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:134 - // virtual: store lo_carry#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:134 - frame_dig -4 // load a.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,a.0#0 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:135 - frame_dig -2 // load b.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,a.0#0,b.0#0 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:135 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,{addw}.0,{addw}.1 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:135 - // virtual: store c_mid#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,c_mid#0,{addw}.0 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:135 - // virtual: store hi_carry1#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,hi_carry1#0,c_mid#0 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:135 - // virtual: load c_mid#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,hi_carry1#0,c_mid#0 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:136 - uncover 2 // load lo_carry#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,c_mid#0,lo_carry#0 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:136 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,{addw}.0,{addw}.1 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:136 - cover 2 // store c_mid#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,{addw}.0 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:136 - // virtual: store hi_carry2#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,hi_carry2#0 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:136 - // virtual: load hi_carry1#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry2#0,hi_carry1#0 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:137 - // virtual: load hi_carry2#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,hi_carry2#0 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:137 - addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,{addw}.0,{addw}.1 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:137 - cover 1 // store c_hi#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{addw}.0 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:137 - // virtual: store did_overflow#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,did_overflow#0 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:137 - // virtual: load did_overflow#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,did_overflow#0 not did_overflow tuple_support/tuple_support.py:138 - ! // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{!} not did_overflow tuple_support/tuple_support.py:138 - // virtual: store tmp%0#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,tmp%0#0 not did_overflow tuple_support/tuple_support.py:138 - // virtual: load tmp%0#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,tmp%0#0 assert not did_overflow, "is such a thing even possible? 👽" tuple_support/tuple_support.py:138 - assert // is such a thing even possible? 👽 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0 assert not did_overflow, "is such a thing even possible? 👽" tuple_support/tuple_support.py:138 - // virtual: load c_hi#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0 return c_hi, c_mid, c_lo tuple_support/tuple_support.py:139 - uncover 1 // load c_mid#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_hi#0,c_mid#0 return c_hi, c_mid, c_lo tuple_support/tuple_support.py:139 - uncover 2 // load c_lo#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_hi#0,c_mid#0,c_lo#0 return c_hi, c_mid, c_lo tuple_support/tuple_support.py:139 - retsub // c_hi#0,c_mid#0,c_lo#0 return c_hi, c_mid, c_lo tuple_support/tuple_support.py:139 + frame_dig -3 // load a.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.1#0 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:141 + frame_dig -1 // load b.1#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | a.1#0,b.1#0 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:141 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | {addw}.0,{addw}.1 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:141 + cover 1 // store c_lo#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,{addw}.0 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:141 + // virtual: store lo_carry#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0 op.addw(a_lo, b_lo) tuple_support/tuple_support.py:141 + frame_dig -4 // load a.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,a.0#0 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:142 + frame_dig -2 // load b.0#0 from parameters (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,a.0#0,b.0#0 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:142 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,{addw}.0,{addw}.1 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:142 + // virtual: store c_mid#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,c_mid#0,{addw}.0 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:142 + // virtual: store hi_carry1#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,hi_carry1#0,c_mid#0 op.addw(a_hi, b_hi) tuple_support/tuple_support.py:142 + // virtual: load c_mid#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,lo_carry#0,hi_carry1#0,c_mid#0 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:143 + uncover 2 // load lo_carry#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,c_mid#0,lo_carry#0 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:143 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,hi_carry1#0,{addw}.0,{addw}.1 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:143 + cover 2 // store c_mid#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,{addw}.0 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:143 + // virtual: store hi_carry2#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,hi_carry2#0 op.addw(c_mid, lo_carry) tuple_support/tuple_support.py:143 + // virtual: load hi_carry1#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry2#0,hi_carry1#0 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:144 + // virtual: load hi_carry2#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,hi_carry1#0,hi_carry2#0 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:144 + addw // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,{addw}.0,{addw}.1 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:144 + cover 1 // store c_hi#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{addw}.0 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:144 + // virtual: store did_overflow#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,did_overflow#0 op.addw(hi_carry1, hi_carry2) tuple_support/tuple_support.py:144 + // virtual: load did_overflow#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,did_overflow#0 not did_overflow tuple_support/tuple_support.py:145 + ! // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,{!} not did_overflow tuple_support/tuple_support.py:145 + // virtual: store tmp%0#0 to l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,tmp%0#0 not did_overflow tuple_support/tuple_support.py:145 + // virtual: load tmp%0#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0,tmp%0#0 assert not did_overflow, "is such a thing even possible? 👽" tuple_support/tuple_support.py:145 + assert // is such a thing even possible? 👽 // (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0 assert not did_overflow, "is such a thing even possible? 👽" tuple_support/tuple_support.py:145 + // virtual: load c_hi#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_mid#0,c_hi#0 return c_hi, c_mid, c_lo tuple_support/tuple_support.py:146 + uncover 1 // load c_mid#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_lo#0,c_hi#0,c_mid#0 return c_hi, c_mid, c_lo tuple_support/tuple_support.py:146 + uncover 2 // load c_lo#0 from l-stack (no copy) (𝕡) a.0#0,a.1#0,b.0#0,b.1#0 | c_hi#0,c_mid#0,c_lo#0 return c_hi, c_mid, c_lo tuple_support/tuple_support.py:146 + retsub // c_hi#0,c_mid#0,c_lo#0 return c_hi, c_mid, c_lo tuple_support/tuple_support.py:146 // test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: bytes_multiply: - proto 2 1 // (𝕡) arg.0#0,arg.1#0 | @subroutine\ndef bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: tuple_support/tuple_support.py:112-113 + proto 2 1 // (𝕡) arg.0#0,arg.1#0 | @subroutine\ndef bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: tuple_support/tuple_support.py:119-120 bytes_multiply_block@0: - byte 0x // (𝕡) arg.0#0,arg.1#0 | 0x Bytes() tuple_support/tuple_support.py:115 - // virtual: store result#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | result = Bytes() tuple_support/tuple_support.py:115 - int 0 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | 0 urange(count) tuple_support/tuple_support.py:116 - // virtual: store range_item%0#0 to l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | range_item%0#0 _i tuple_support/tuple_support.py:116 + byte 0x // (𝕡) arg.0#0,arg.1#0 | 0x Bytes() tuple_support/tuple_support.py:122 + // virtual: store result#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | result = Bytes() tuple_support/tuple_support.py:122 + int 0 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | 0 urange(count) tuple_support/tuple_support.py:123 + // virtual: store range_item%0#0 to l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | range_item%0#0 _i tuple_support/tuple_support.py:123 // virtual: load range_item%0#0 from l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0 | range_item%0#0 // virtual: store _i#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | // Implicit fall through to bytes_multiply_for_header@1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | bytes_multiply_for_header@1: - frame_dig 1 // load _i#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0 urange(count) tuple_support/tuple_support.py:116 - frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0,arg.1#0 urange(count) tuple_support/tuple_support.py:116 - < // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {<} urange(count) tuple_support/tuple_support.py:116 - // virtual: store continue_looping%0#0 to l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | continue_looping%0#0 urange(count) tuple_support/tuple_support.py:116 - // virtual: load continue_looping%0#0 from l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | continue_looping%0#0 for _i in urange(count): tuple_support/tuple_support.py:116 - bz bytes_multiply_after_for@5 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | for _i in urange(count): tuple_support/tuple_support.py:116 - // Implicit fall through to bytes_multiply_for_body@2 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | for _i in urange(count): tuple_support/tuple_support.py:116 + frame_dig 1 // load _i#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0 urange(count) tuple_support/tuple_support.py:123 + frame_dig -1 // load arg.1#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0,arg.1#0 urange(count) tuple_support/tuple_support.py:123 + < // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {<} urange(count) tuple_support/tuple_support.py:123 + // virtual: store continue_looping%0#0 to l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | continue_looping%0#0 urange(count) tuple_support/tuple_support.py:123 + // virtual: load continue_looping%0#0 from l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | continue_looping%0#0 for _i in urange(count): tuple_support/tuple_support.py:123 + bz bytes_multiply_after_for@5 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | for _i in urange(count): tuple_support/tuple_support.py:123 + // Implicit fall through to bytes_multiply_for_body@2 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | for _i in urange(count): tuple_support/tuple_support.py:123 bytes_multiply_for_body@2: - frame_dig 0 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0 result += b tuple_support/tuple_support.py:117 - frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0,arg.0#0 result += b tuple_support/tuple_support.py:117 - concat // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {concat} result += b tuple_support/tuple_support.py:117 - frame_bury 0 // store result#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result += b tuple_support/tuple_support.py:117 - frame_dig 1 // load _i#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0 for _i in urange(count): tuple_support/tuple_support.py:116 - int 1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0,1 urange(count) tuple_support/tuple_support.py:116 - + // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {+} urange(count) tuple_support/tuple_support.py:116 - // virtual: store range_item%0#0 to l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | range_item%0#0 for _i in urange(count): tuple_support/tuple_support.py:116 + frame_dig 0 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0 result += b tuple_support/tuple_support.py:124 + frame_dig -2 // load arg.0#0 from parameters (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0,arg.0#0 result += b tuple_support/tuple_support.py:124 + concat // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {concat} result += b tuple_support/tuple_support.py:124 + frame_bury 0 // store result#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result += b tuple_support/tuple_support.py:124 + frame_dig 1 // load _i#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0 for _i in urange(count): tuple_support/tuple_support.py:123 + int 1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | _i#0,1 urange(count) tuple_support/tuple_support.py:123 + + // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | {+} urange(count) tuple_support/tuple_support.py:123 + // virtual: store range_item%0#0 to l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | range_item%0#0 for _i in urange(count): tuple_support/tuple_support.py:123 // virtual: load range_item%0#0 from l-stack (no copy) (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | range_item%0#0 frame_bury 1 // store _i#0 to f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | b bytes_multiply_for_header@1 // (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | bytes_multiply_after_for@5: - frame_dig 0 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0 return result tuple_support/tuple_support.py:118 + frame_dig 0 // load result#0 from f-stack (𝕡) arg.0#0,arg.1#0 | (𝕗) result#0,_i#0 | result#0 return result tuple_support/tuple_support.py:125 frame_bury 0 - retsub // result#0 return result tuple_support/tuple_support.py:118 + retsub // result#0 return result tuple_support/tuple_support.py:125 // test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: test_tuple_swap: - proto 1 0 // (𝕡) zero#0 | @subroutine\ndef test_tuple_swap(zero: UInt64) -> None: tuple_support/tuple_support.py:142-143 + proto 1 0 // (𝕡) zero#0 | @subroutine\ndef test_tuple_swap(zero: UInt64) -> None: tuple_support/tuple_support.py:149-150 test_tuple_swap_block@0: - frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | zero#0 a = zero + 1 tuple_support/tuple_support.py:144 - int 1 // (𝕡) zero#0 | zero#0,1 1 tuple_support/tuple_support.py:144 - + // (𝕡) zero#0 | {+} zero + 1 tuple_support/tuple_support.py:144 - // virtual: store a#0 to l-stack (no copy) (𝕡) zero#0 | a#0 a = zero + 1 tuple_support/tuple_support.py:144 - frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | a#0,zero#0 b = zero + 2 tuple_support/tuple_support.py:145 - int 2 // (𝕡) zero#0 | a#0,zero#0,2 2 tuple_support/tuple_support.py:145 - + // (𝕡) zero#0 | a#0,{+} zero + 2 tuple_support/tuple_support.py:145 - // virtual: store b#0 to l-stack (no copy) (𝕡) zero#0 | a#0,b#0 b = zero + 2 tuple_support/tuple_support.py:145 - // virtual: load b#0 from l-stack (no copy) (𝕡) zero#0 | a#0,b#0 a == 2, "a should be two" tuple_support/tuple_support.py:147 - int 2 // (𝕡) zero#0 | a#0,b#0,2 2 tuple_support/tuple_support.py:147 - == // (𝕡) zero#0 | a#0,{==} a == 2, "a should be two" tuple_support/tuple_support.py:147 - // virtual: store tmp%0#0 to l-stack (no copy) (𝕡) zero#0 | a#0,tmp%0#0 a == 2, "a should be two" tuple_support/tuple_support.py:147 - // virtual: load tmp%0#0 from l-stack (no copy) (𝕡) zero#0 | a#0,tmp%0#0 assert a == 2, "a should be two" tuple_support/tuple_support.py:147 - assert // a should be two // (𝕡) zero#0 | a#0 assert a == 2, "a should be two" tuple_support/tuple_support.py:147 - // virtual: load a#0 from l-stack (no copy) (𝕡) zero#0 | a#0 b == 1, "b should be one" tuple_support/tuple_support.py:148 - int 1 // (𝕡) zero#0 | a#0,1 1 tuple_support/tuple_support.py:148 - == // (𝕡) zero#0 | {==} b == 1, "b should be one" tuple_support/tuple_support.py:148 - // virtual: store tmp%1#0 to l-stack (no copy) (𝕡) zero#0 | tmp%1#0 b == 1, "b should be one" tuple_support/tuple_support.py:148 - // virtual: load tmp%1#0 from l-stack (no copy) (𝕡) zero#0 | tmp%1#0 assert b == 1, "b should be one" tuple_support/tuple_support.py:148 - assert // b should be one // (𝕡) zero#0 | assert b == 1, "b should be one" tuple_support/tuple_support.py:148 + frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | zero#0 a = zero + 1 tuple_support/tuple_support.py:151 + int 1 // (𝕡) zero#0 | zero#0,1 1 tuple_support/tuple_support.py:151 + + // (𝕡) zero#0 | {+} zero + 1 tuple_support/tuple_support.py:151 + // virtual: store a#0 to l-stack (no copy) (𝕡) zero#0 | a#0 a = zero + 1 tuple_support/tuple_support.py:151 + frame_dig -1 // load zero#0 from parameters (𝕡) zero#0 | a#0,zero#0 b = zero + 2 tuple_support/tuple_support.py:152 + int 2 // (𝕡) zero#0 | a#0,zero#0,2 2 tuple_support/tuple_support.py:152 + + // (𝕡) zero#0 | a#0,{+} zero + 2 tuple_support/tuple_support.py:152 + // virtual: store b#0 to l-stack (no copy) (𝕡) zero#0 | a#0,b#0 b = zero + 2 tuple_support/tuple_support.py:152 + // virtual: load b#0 from l-stack (no copy) (𝕡) zero#0 | a#0,b#0 a == 2, "a should be two" tuple_support/tuple_support.py:154 + int 2 // (𝕡) zero#0 | a#0,b#0,2 2 tuple_support/tuple_support.py:154 + == // (𝕡) zero#0 | a#0,{==} a == 2, "a should be two" tuple_support/tuple_support.py:154 + // virtual: store tmp%0#0 to l-stack (no copy) (𝕡) zero#0 | a#0,tmp%0#0 a == 2, "a should be two" tuple_support/tuple_support.py:154 + // virtual: load tmp%0#0 from l-stack (no copy) (𝕡) zero#0 | a#0,tmp%0#0 assert a == 2, "a should be two" tuple_support/tuple_support.py:154 + assert // a should be two // (𝕡) zero#0 | a#0 assert a == 2, "a should be two" tuple_support/tuple_support.py:154 + // virtual: load a#0 from l-stack (no copy) (𝕡) zero#0 | a#0 b == 1, "b should be one" tuple_support/tuple_support.py:155 + int 1 // (𝕡) zero#0 | a#0,1 1 tuple_support/tuple_support.py:155 + == // (𝕡) zero#0 | {==} b == 1, "b should be one" tuple_support/tuple_support.py:155 + // virtual: store tmp%1#0 to l-stack (no copy) (𝕡) zero#0 | tmp%1#0 b == 1, "b should be one" tuple_support/tuple_support.py:155 + // virtual: load tmp%1#0 from l-stack (no copy) (𝕡) zero#0 | tmp%1#0 assert b == 1, "b should be one" tuple_support/tuple_support.py:155 + assert // b should be one // (𝕡) zero#0 | assert b == 1, "b should be one" tuple_support/tuple_support.py:155 retsub // // test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: slicing: - proto 8 0 // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | @subroutine\ndef slicing(values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UI... tuple_support/tuple_support.py:151-152 + proto 8 0 // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | @subroutine\ndef slicing(values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UI... tuple_support/tuple_support.py:158-159 slicing_block@0: - frame_dig -8 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0 add_three_values(one_to_three) tuple_support/tuple_support.py:154 - frame_dig -7 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0,values.1#0 add_three_values(one_to_three) tuple_support/tuple_support.py:154 - frame_dig -6 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0,values.1#0,values.2#0 add_three_values(one_to_three) tuple_support/tuple_support.py:154 - callsub add_three_values // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | {add_three_values} add_three_values(one_to_three) tuple_support/tuple_support.py:154 - // virtual: store tmp%0#0 to l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0 add_three_values(one_to_three) tuple_support/tuple_support.py:154 - frame_dig -8 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,values.0#0 values[0] + values[1] tuple_support/tuple_support.py:154 - frame_dig -7 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,values.0#0,values.1#0 values[0] + values[1] tuple_support/tuple_support.py:154 - + // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,{+} values[0] + values[1] tuple_support/tuple_support.py:154 - // virtual: store tmp%1#0 to l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%1#0 values[0] + values[1] tuple_support/tuple_support.py:154 - // virtual: load tmp%1#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%1#0 values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - frame_dig -6 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%1#0,values.2#0 values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - + // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,{+} values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - // virtual: store tmp%2#0 to l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%2#0 values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - // virtual: load tmp%0#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%2#0,tmp%0#0 add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - // virtual: load tmp%2#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%2#0 add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - == // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | {==} add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - // virtual: store tmp%3#0 to l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%3#0 add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - // virtual: load tmp%3#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%3#0 assert add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 - assert // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | assert add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:154 + frame_dig -8 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0 add_three_values(one_to_three) tuple_support/tuple_support.py:161 + frame_dig -7 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0,values.1#0 add_three_values(one_to_three) tuple_support/tuple_support.py:161 + frame_dig -6 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | values.0#0,values.1#0,values.2#0 add_three_values(one_to_three) tuple_support/tuple_support.py:161 + callsub add_three_values // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | {add_three_values} add_three_values(one_to_three) tuple_support/tuple_support.py:161 + // virtual: store tmp%0#0 to l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0 add_three_values(one_to_three) tuple_support/tuple_support.py:161 + frame_dig -8 // load values.0#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,values.0#0 values[0] + values[1] tuple_support/tuple_support.py:161 + frame_dig -7 // load values.1#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,values.0#0,values.1#0 values[0] + values[1] tuple_support/tuple_support.py:161 + + // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,{+} values[0] + values[1] tuple_support/tuple_support.py:161 + // virtual: store tmp%1#0 to l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%1#0 values[0] + values[1] tuple_support/tuple_support.py:161 + // virtual: load tmp%1#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%1#0 values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + frame_dig -6 // load values.2#0 from parameters (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%1#0,values.2#0 values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + + // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,{+} values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + // virtual: store tmp%2#0 to l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%2#0 values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + // virtual: load tmp%0#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%2#0,tmp%0#0 add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + // virtual: load tmp%2#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%0#0,tmp%2#0 add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + == // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | {==} add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + // virtual: store tmp%3#0 to l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%3#0 add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + // virtual: load tmp%3#0 from l-stack (no copy) (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | tmp%3#0 assert add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 + assert // (𝕡) values.0#0,values.1#0,values.2#0,values.3#0,values.4#0,values.5#0,values.6#0,values.7#0 | assert add_three_values(one_to_three) == values[0] + values[1] + values[2] tuple_support/tuple_support.py:161 retsub // // test_cases.tuple_support.tuple_support.bin_ops() -> void: bin_ops: - proto 0 0 // @subroutine\ndef bin_ops() -> None: tuple_support/tuple_support.py:77-78 + proto 0 0 // @subroutine\ndef bin_ops() -> None: tuple_support/tuple_support.py:84-85 bin_ops_block@0: retsub // @@ -304,25 +305,33 @@ bin_ops_block@0: // test_cases.tuple_support.tuple_support.non_empty_tuple() -> uint64, uint64: non_empty_tuple: - proto 0 2 // @subroutine\ndef non_empty_tuple() -> tuple[UInt64, UInt64]: tuple_support/tuple_support.py:71-72 + proto 0 2 // @subroutine\ndef non_empty_tuple() -> tuple[UInt64, UInt64]: tuple_support/tuple_support.py:78-79 non_empty_tuple_block@0: - byte "non_empty_tuple called" // "non_empty_tuple called" "non_empty_tuple called" tuple_support/tuple_support.py:73 - log // log("non_empty_tuple called") tuple_support/tuple_support.py:73 - int 4 // 4 UInt64(4) tuple_support/tuple_support.py:74 - int 2 // 4,2 UInt64(2) tuple_support/tuple_support.py:74 - retsub // 4,2 return UInt64(4), UInt64(2) tuple_support/tuple_support.py:74 + byte "non_empty_tuple called" // "non_empty_tuple called" "non_empty_tuple called" tuple_support/tuple_support.py:80 + log // log("non_empty_tuple called") tuple_support/tuple_support.py:80 + int 4 // 4 UInt64(4) tuple_support/tuple_support.py:81 + int 2 // 4,2 UInt64(2) tuple_support/tuple_support.py:81 + retsub // 4,2 return UInt64(4), UInt64(2) tuple_support/tuple_support.py:81 // test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: get_uint_with_side_effect: - proto 0 1 // @subroutine\ndef get_uint_with_side_effect() -> UInt64: tuple_support/tuple_support.py:65-66 + proto 0 1 // @subroutine\ndef get_uint_with_side_effect() -> UInt64: tuple_support/tuple_support.py:72-73 get_uint_with_side_effect_block@0: - byte "get_uint_with_side_effect called" // "get_uint_with_side_effect called" "get_uint_with_side_effect called" tuple_support/tuple_support.py:67 - log // log("get_uint_with_side_effect called") tuple_support/tuple_support.py:67 - int 4 // 4 UInt64(4) tuple_support/tuple_support.py:68 - retsub // 4 return UInt64(4) tuple_support/tuple_support.py:68 + byte "get_uint_with_side_effect called" // "get_uint_with_side_effect called" "get_uint_with_side_effect called" tuple_support/tuple_support.py:74 + log // log("get_uint_with_side_effect called") tuple_support/tuple_support.py:74 + int 4 // 4 UInt64(4) tuple_support/tuple_support.py:75 + retsub // 4 return UInt64(4) tuple_support/tuple_support.py:75 + + +// test_cases.tuple_support.tuple_support.single_tuple() -> void: +single_tuple: + proto 0 0 // @subroutine\ndef single_tuple() -> None: tuple_support/tuple_support.py:66-67 + +single_tuple_block@0: + retsub // // test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: diff --git a/test_cases/tuple_support/out/TupleSupport.approval.teal b/test_cases/tuple_support/out/TupleSupport.approval.teal index 3faa617217..be83e2a13e 100644 --- a/test_cases/tuple_support/out/TupleSupport.approval.teal +++ b/test_cases/tuple_support/out/TupleSupport.approval.teal @@ -135,6 +135,9 @@ main_entrypoint@2: byte "not empty2" log // tuple_support/tuple_support.py:59 + // single_tuple() + callsub single_tuple + // tuple_support/tuple_support.py:60 // return a + b int 3 return @@ -142,12 +145,12 @@ main_entrypoint@2: // test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: add_three_values: - // tuple_support/tuple_support.py:121-122 + // tuple_support/tuple_support.py:128-129 // @subroutine // def add_three_values(values: tuple[UInt64, UInt64, UInt64]) -> UInt64: proto 3 1 byte "" - // tuple_support/tuple_support.py:123 + // tuple_support/tuple_support.py:130 // total = UInt64(0) int 0 frame_dig -3 @@ -164,7 +167,7 @@ add_three_values_for_header_2@3: frame_dig 0 add_three_values_for_body@4: - // tuple_support/tuple_support.py:125 + // tuple_support/tuple_support.py:132 // total += value frame_dig 1 uncover 2 @@ -176,10 +179,10 @@ add_three_values_for_body@4: int 1 + frame_bury 0 - // tuple_support/tuple_support.py:124 + // tuple_support/tuple_support.py:131 // for value in values: switch add_three_values_for_header_1@2 add_three_values_for_header_2@3 - // tuple_support/tuple_support.py:127 + // tuple_support/tuple_support.py:134 // return total frame_bury 0 retsub @@ -187,51 +190,51 @@ add_three_values_for_body@4: // test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: bytes_combine: - // tuple_support/tuple_support.py:105-106 + // tuple_support/tuple_support.py:112-113 // @subroutine // def bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: proto 2 1 - // tuple_support/tuple_support.py:108 + // tuple_support/tuple_support.py:115 // result = a + b frame_dig -2 frame_dig -1 concat - // tuple_support/tuple_support.py:109 + // tuple_support/tuple_support.py:116 // return result retsub // test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> uint64, uint64, uint64: addw2: - // tuple_support/tuple_support.py:130-131 + // tuple_support/tuple_support.py:137-138 // @subroutine // def addw2(a: tuple[UInt64, UInt64], b: tuple[UInt64, UInt64]) -> tuple[UInt64, UInt64, UInt64]: proto 4 3 - // tuple_support/tuple_support.py:134 + // tuple_support/tuple_support.py:141 // lo_carry, c_lo = op.addw(a_lo, b_lo) frame_dig -3 frame_dig -1 addw swap - // tuple_support/tuple_support.py:135 + // tuple_support/tuple_support.py:142 // hi_carry1, c_mid = op.addw(a_hi, b_hi) frame_dig -4 frame_dig -2 addw - // tuple_support/tuple_support.py:136 + // tuple_support/tuple_support.py:143 // hi_carry2, c_mid = op.addw(c_mid, lo_carry) uncover 2 addw cover 2 - // tuple_support/tuple_support.py:137 + // tuple_support/tuple_support.py:144 // did_overflow, c_hi = op.addw(hi_carry1, hi_carry2) addw swap - // tuple_support/tuple_support.py:138 + // tuple_support/tuple_support.py:145 // assert not did_overflow, "is such a thing even possible? 👽" ! assert // is such a thing even possible? 👽 - // tuple_support/tuple_support.py:139 + // tuple_support/tuple_support.py:146 // return c_hi, c_mid, c_lo swap uncover 2 @@ -240,31 +243,31 @@ addw2: // test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: bytes_multiply: - // tuple_support/tuple_support.py:112-113 + // tuple_support/tuple_support.py:119-120 // @subroutine // def bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: proto 2 1 - // tuple_support/tuple_support.py:115 + // tuple_support/tuple_support.py:122 // result = Bytes() byte 0x - // tuple_support/tuple_support.py:116 + // tuple_support/tuple_support.py:123 // for _i in urange(count): int 0 bytes_multiply_for_header@1: - // tuple_support/tuple_support.py:116 + // tuple_support/tuple_support.py:123 // for _i in urange(count): frame_dig 1 frame_dig -1 < bz bytes_multiply_after_for@5 - // tuple_support/tuple_support.py:117 + // tuple_support/tuple_support.py:124 // result += b frame_dig 0 frame_dig -2 concat frame_bury 0 - // tuple_support/tuple_support.py:116 + // tuple_support/tuple_support.py:123 // for _i in urange(count): frame_dig 1 int 1 @@ -273,33 +276,33 @@ bytes_multiply_for_header@1: b bytes_multiply_for_header@1 bytes_multiply_after_for@5: - // tuple_support/tuple_support.py:118 + // tuple_support/tuple_support.py:125 // return result retsub // test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: test_tuple_swap: - // tuple_support/tuple_support.py:142-143 + // tuple_support/tuple_support.py:149-150 // @subroutine // def test_tuple_swap(zero: UInt64) -> None: proto 1 0 - // tuple_support/tuple_support.py:144 + // tuple_support/tuple_support.py:151 // a = zero + 1 frame_dig -1 int 1 + - // tuple_support/tuple_support.py:145 + // tuple_support/tuple_support.py:152 // b = zero + 2 frame_dig -1 int 2 + - // tuple_support/tuple_support.py:147 + // tuple_support/tuple_support.py:154 // assert a == 2, "a should be two" int 2 == assert // a should be two - // tuple_support/tuple_support.py:148 + // tuple_support/tuple_support.py:155 // assert b == 1, "b should be one" int 1 == @@ -309,11 +312,11 @@ test_tuple_swap: // test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: slicing: - // tuple_support/tuple_support.py:151-152 + // tuple_support/tuple_support.py:158-159 // @subroutine // def slicing(values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64]) -> None: proto 8 0 - // tuple_support/tuple_support.py:154 + // tuple_support/tuple_support.py:161 // assert add_three_values(one_to_three) == values[0] + values[1] + values[2] frame_dig -8 frame_dig -7 @@ -331,7 +334,7 @@ slicing: // test_cases.tuple_support.tuple_support.bin_ops() -> void: bin_ops: - // tuple_support/tuple_support.py:77-78 + // tuple_support/tuple_support.py:84-85 // @subroutine // def bin_ops() -> None: proto 0 0 @@ -340,15 +343,15 @@ bin_ops: // test_cases.tuple_support.tuple_support.non_empty_tuple() -> uint64, uint64: non_empty_tuple: - // tuple_support/tuple_support.py:71-72 + // tuple_support/tuple_support.py:78-79 // @subroutine // def non_empty_tuple() -> tuple[UInt64, UInt64]: proto 0 2 - // tuple_support/tuple_support.py:73 + // tuple_support/tuple_support.py:80 // log("non_empty_tuple called") byte "non_empty_tuple called" log - // tuple_support/tuple_support.py:74 + // tuple_support/tuple_support.py:81 // return UInt64(4), UInt64(2) int 4 int 2 @@ -357,20 +360,29 @@ non_empty_tuple: // test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: get_uint_with_side_effect: - // tuple_support/tuple_support.py:65-66 + // tuple_support/tuple_support.py:72-73 // @subroutine // def get_uint_with_side_effect() -> UInt64: proto 0 1 - // tuple_support/tuple_support.py:67 + // tuple_support/tuple_support.py:74 // log("get_uint_with_side_effect called") byte "get_uint_with_side_effect called" log - // tuple_support/tuple_support.py:68 + // tuple_support/tuple_support.py:75 // return UInt64(4) int 4 retsub +// test_cases.tuple_support.tuple_support.single_tuple() -> void: +single_tuple: + // tuple_support/tuple_support.py:66-67 + // @subroutine + // def single_tuple() -> None: + proto 0 0 + retsub + + // test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: __init__: // tuple_support/tuple_support.py:5 diff --git a/test_cases/tuple_support/out/TupleSupport.clear.mir b/test_cases/tuple_support/out/TupleSupport.clear.mir index 96edc92074..66446e33d5 100644 --- a/test_cases/tuple_support/out/TupleSupport.clear.mir +++ b/test_cases/tuple_support/out/TupleSupport.clear.mir @@ -4,6 +4,6 @@ // test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: main_block@0: - int 0 // 0 UInt64(0) tuple_support/tuple_support.py:62 - return // return UInt64(0) tuple_support/tuple_support.py:62 + int 0 // 0 UInt64(0) tuple_support/tuple_support.py:63 + return // return UInt64(0) tuple_support/tuple_support.py:63 diff --git a/test_cases/tuple_support/out/TupleSupport.clear.teal b/test_cases/tuple_support/out/TupleSupport.clear.teal index f15d8a6b32..15f744fb62 100644 --- a/test_cases/tuple_support/out/TupleSupport.clear.teal +++ b/test_cases/tuple_support/out/TupleSupport.clear.teal @@ -1,7 +1,7 @@ #pragma version 10 test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program: - // tuple_support/tuple_support.py:62 + // tuple_support/tuple_support.py:63 // return UInt64(0) int 0 return diff --git a/test_cases/tuple_support/out/TupleSupport.destructured.ir b/test_cases/tuple_support/out/TupleSupport.destructured.ir index 9abe4781c6..52bafaf401 100644 --- a/test_cases/tuple_support/out/TupleSupport.destructured.ir +++ b/test_cases/tuple_support/out/TupleSupport.destructured.ir @@ -34,34 +34,35 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: (log "not empty") let awst_tmp%4#0: uint64 = test_cases.tuple_support.tuple_support.get_uint_with_side_effect() (log "not empty2") + test_cases.tuple_support.tuple_support.single_tuple() return 3u subroutine test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L121 + block@0: // L128 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u let value#3: uint64 = values.0#0 goto block@4 - block@2: // for_header_1_L124 + block@2: // for_header_1_L131 let tuple_index%0#0: uint64 = tuple_index%0#4 let value#3: uint64 = values.1#0 goto block@4 - block@3: // for_header_2_L124 + block@3: // for_header_2_L131 let tuple_index%0#0: uint64 = tuple_index%0#4 let value#3: uint64 = values.2#0 goto block@4 - block@4: // for_body_L124 + block@4: // for_body_L131 let total#0: uint64 = (+ total#0 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#0 1u) goto_nth [block@2, block@3][tuple_index%0#0] else return total#0 subroutine test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L105 + block@0: // L112 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L130 + block@0: // L137 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#0: uint64) = (addw c_mid#0 lo_carry#0) @@ -71,24 +72,24 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return c_hi#0 c_mid#0 c_lo#0 subroutine test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L112 + block@0: // L119 let result#0: bytes = 0x let range_item%0#0: uint64 = 0u let _i#0: uint64 = range_item%0#0 goto block@1 - block@1: // for_header_L116 + block@1: // for_header_L123 let continue_looping%0#0: bool = (< _i#0 arg.1#0) goto continue_looping%0#0 ? block@2 : block@5 - block@2: // for_body_L116 + block@2: // for_body_L123 let result#0: bytes = (concat result#0 arg.0#0) let range_item%0#0: uint64 = (+ _i#0 1u) let _i#0: uint64 = range_item%0#0 goto block@1 - block@5: // after_for_L116 + block@5: // after_for_L123 return result#0 subroutine test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L142 + block@0: // L149 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: bool = (== b#0 2u) @@ -98,7 +99,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: - block@0: // L151 + block@0: // L158 let tmp%0#0: uint64 = test_cases.tuple_support.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) let tmp%1#0: uint64 = (+ values.0#0 values.1#0) let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) @@ -107,19 +108,23 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.bin_ops() -> void: - block@0: // L77 + block@0: // L84 return subroutine test_cases.tuple_support.tuple_support.non_empty_tuple() -> : - block@0: // L71 + block@0: // L78 (log "non_empty_tuple called") return 4u 2u subroutine test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: - block@0: // L65 + block@0: // L72 (log "get_uint_with_side_effect called") return 4u + subroutine test_cases.tuple_support.tuple_support.single_tuple() -> void: + block@0: // L66 + return + subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -127,5 +132,5 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: program clear-state: subroutine test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L61 + block@0: // L62 return 0u \ No newline at end of file diff --git a/test_cases/tuple_support/out/TupleSupport.ssa.ir b/test_cases/tuple_support/out/TupleSupport.ssa.ir index de00df2c2a..026e03bb1e 100644 --- a/test_cases/tuple_support/out/TupleSupport.ssa.ir +++ b/test_cases/tuple_support/out/TupleSupport.ssa.ir @@ -89,44 +89,45 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: (log "not empty2") goto block@9 block@9: // after_if_else_L57 + test_cases.tuple_support.tuple_support.single_tuple() let tmp%22#0: uint64 = (+ a#0 b#0) return tmp%22#0 subroutine test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L121 + block@0: // L128 let total#0: uint64 = 0u goto block@1 - block@1: // for_header_0_L124 + block@1: // for_header_0_L131 let tuple_index%0#0: uint64 = 0u let value#0: uint64 = values.0#0 goto block@4 - block@2: // for_header_1_L124 + block@2: // for_header_1_L131 let value#1: uint64 = values.1#0 goto block@4 - block@3: // for_header_2_L124 + block@3: // for_header_2_L131 let value#2: uint64 = values.2#0 goto block@4 - block@4: // for_body_L124 + block@4: // for_body_L131 let total#1: uint64 = φ(total#0 <- block@1, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2, value#2 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) let total#4: uint64 = (+ total#1 value#3) goto block@5 - block@5: // for_footer_L124 + block@5: // for_footer_L131 let tuple_index%0#4: uint64 = (+ tuple_index%0#1 1u) goto_nth [block@2, block@3][tuple_index%0#1] else goto block@6 - block@6: // after_for_L124 + block@6: // after_for_L131 return total#4 subroutine test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L105 + block@0: // L112 let a#0: bytes = arg.0#0 let b#0: bytes = arg.1#0 let result#0: bytes = (concat a#0 b#0) return result#0 subroutine test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L130 + block@0: // L137 let a_hi#0: uint64 = a.0#0 let a_lo#0: uint64 = a.1#0 let b_hi#0: uint64 = b.0#0 @@ -149,32 +150,32 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L112 + block@0: // L119 let b#0: bytes = arg.0#0 let count#0: uint64 = arg.1#0 let result#0: bytes = 0x (assert 1u) // Step cannot be zero let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L116 + block@1: // for_header_L123 let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0, range_item%0#3 <- block@4) let result#3: bytes = φ(result#0 <- block@0, result#2 <- block@4) let continue_looping%0#0: bool = (< range_item%0#1 count#0) goto continue_looping%0#0 ? block@2 : block@5 - block@2: // for_body_L116 + block@2: // for_body_L123 let _i#0: uint64 = range_item%0#1 let result#2: bytes = (concat result#3 b#0) goto block@3 - block@3: // for_footer_L116 + block@3: // for_footer_L123 goto block@4 - block@4: // for_increment_L116 + block@4: // for_increment_L123 let range_item%0#3: uint64 = (+ range_item%0#1 1u) goto block@1 - block@5: // after_for_L116 + block@5: // after_for_L123 return result#3 subroutine test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L142 + block@0: // L149 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let a#1: uint64 = b#0 @@ -186,7 +187,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: - block@0: // L151 + block@0: // L158 let (one_to_three.0#0: uint64, one_to_three.1#0: uint64, one_to_three.2#0: uint64) = (values.0#0, values.1#0, values.2#0) let tmp%0#0: uint64 = test_cases.tuple_support.tuple_support.add_three_values(one_to_three.0#0, one_to_three.1#0, one_to_three.2#0) let tmp%1#0: uint64 = (+ values.0#0 values.1#0) @@ -205,7 +206,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.bin_ops() -> void: - block@0: // L77 + block@0: // L84 let (a.0#0: uint64, a.1#0: uint64, a.2#0: uint64) = (1u, 1u, 1u) let tmp%0#0: bool = (== a.0#0 1u) (assert tmp%0#0) @@ -246,15 +247,22 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.non_empty_tuple() -> : - block@0: // L71 + block@0: // L78 (log "non_empty_tuple called") return 4u 2u subroutine test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: - block@0: // L65 + block@0: // L72 (log "get_uint_with_side_effect called") return 4u + subroutine test_cases.tuple_support.tuple_support.single_tuple() -> void: + block@0: // L66 + let tup#0: uint64 = (1u) + let tmp%0#0: bool = (== tup#0 1u) + (assert tmp%0#0) + return + subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -262,5 +270,5 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: program clear-state: subroutine test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L61 + block@0: // L62 return 0u \ No newline at end of file diff --git a/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_1.ir b/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_1.ir index 58ea01d136..5854c8e4df 100644 --- a/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_1.ir +++ b/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_1.ir @@ -69,19 +69,20 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: (log "not empty2") goto block@9 block@9: // after_if_else_L57 + test_cases.tuple_support.tuple_support.single_tuple() let tmp%22#0: uint64 = 3u return tmp%22#0 subroutine test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L121 + block@0: // L128 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u goto block@4 - block@2: // for_header_1_L124 + block@2: // for_header_1_L131 goto block@4 - block@3: // for_header_2_L124 + block@3: // for_header_2_L131 goto block@4 - block@4: // for_body_L124 + block@4: // for_body_L131 let total#1: uint64 = φ(total#0 <- block@0, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(values.0#0 <- block@0, values.1#0 <- block@2, values.2#0 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@0, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) @@ -90,12 +91,12 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: goto_nth [block@2, block@3][tuple_index%0#1] else return total#4 subroutine test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L105 + block@0: // L112 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L130 + block@0: // L137 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -105,24 +106,24 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L112 + block@0: // L119 let result#0: bytes = 0x let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L116 + block@1: // for_header_L123 let _i#0: uint64 = φ(range_item%0#0 <- block@0, range_item%0#3 <- block@2) let result#3: bytes = φ(result#0 <- block@0, result#2 <- block@2) let continue_looping%0#0: bool = (< _i#0 arg.1#0) goto continue_looping%0#0 ? block@2 : block@5 - block@2: // for_body_L116 + block@2: // for_body_L123 let result#2: bytes = (concat result#3 arg.0#0) let range_item%0#3: uint64 = (+ _i#0 1u) goto block@1 - block@5: // after_for_L116 + block@5: // after_for_L123 return result#3 subroutine test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L142 + block@0: // L149 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: bool = (== b#0 2u) @@ -132,7 +133,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: - block@0: // L151 + block@0: // L158 let tmp%0#0: uint64 = test_cases.tuple_support.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) let tmp%1#0: uint64 = (+ values.0#0 values.1#0) let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) @@ -149,7 +150,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.bin_ops() -> void: - block@0: // L77 + block@0: // L84 let tmp%0#0: bool = 1u (assert tmp%0#0) let tmp%1#0: bool = 1u @@ -185,15 +186,21 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.non_empty_tuple() -> : - block@0: // L71 + block@0: // L78 (log "non_empty_tuple called") return 4u 2u subroutine test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: - block@0: // L65 + block@0: // L72 (log "get_uint_with_side_effect called") return 4u + subroutine test_cases.tuple_support.tuple_support.single_tuple() -> void: + block@0: // L66 + let tmp%0#0: bool = 1u + (assert tmp%0#0) + return + subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -201,5 +208,5 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: program clear-state: subroutine test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L61 + block@0: // L62 return 0u \ No newline at end of file diff --git a/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_2.ir b/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_2.ir index 1c951bf2c6..001a766d8b 100644 --- a/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_2.ir +++ b/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_2.ir @@ -47,18 +47,19 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: block@7: // after_if_else_L55 let awst_tmp%4#0: uint64 = test_cases.tuple_support.tuple_support.get_uint_with_side_effect() (log "not empty2") + test_cases.tuple_support.tuple_support.single_tuple() return 3u subroutine test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L121 + block@0: // L128 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u goto block@4 - block@2: // for_header_1_L124 + block@2: // for_header_1_L131 goto block@4 - block@3: // for_header_2_L124 + block@3: // for_header_2_L131 goto block@4 - block@4: // for_body_L124 + block@4: // for_body_L131 let total#1: uint64 = φ(total#0 <- block@0, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(values.0#0 <- block@0, values.1#0 <- block@2, values.2#0 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@0, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) @@ -67,12 +68,12 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: goto_nth [block@2, block@3][tuple_index%0#1] else return total#4 subroutine test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L105 + block@0: // L112 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L130 + block@0: // L137 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -82,24 +83,24 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L112 + block@0: // L119 let result#0: bytes = 0x let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L116 + block@1: // for_header_L123 let _i#0: uint64 = φ(range_item%0#0 <- block@0, range_item%0#3 <- block@2) let result#3: bytes = φ(result#0 <- block@0, result#2 <- block@2) let continue_looping%0#0: bool = (< _i#0 arg.1#0) goto continue_looping%0#0 ? block@2 : block@5 - block@2: // for_body_L116 + block@2: // for_body_L123 let result#2: bytes = (concat result#3 arg.0#0) let range_item%0#3: uint64 = (+ _i#0 1u) goto block@1 - block@5: // after_for_L116 + block@5: // after_for_L123 return result#3 subroutine test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L142 + block@0: // L149 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: bool = (== b#0 2u) @@ -109,7 +110,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: - block@0: // L151 + block@0: // L158 let tmp%0#0: uint64 = test_cases.tuple_support.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) let tmp%1#0: uint64 = (+ values.0#0 values.1#0) let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) @@ -121,19 +122,23 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.bin_ops() -> void: - block@0: // L77 + block@0: // L84 return subroutine test_cases.tuple_support.tuple_support.non_empty_tuple() -> : - block@0: // L71 + block@0: // L78 (log "non_empty_tuple called") return 4u 2u subroutine test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: - block@0: // L65 + block@0: // L72 (log "get_uint_with_side_effect called") return 4u + subroutine test_cases.tuple_support.tuple_support.single_tuple() -> void: + block@0: // L66 + return + subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -141,5 +146,5 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: program clear-state: subroutine test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L61 + block@0: // L62 return 0u \ No newline at end of file diff --git a/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_3.ir b/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_3.ir index 76f3693ea1..0a6dffcc5a 100644 --- a/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_3.ir +++ b/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_3.ir @@ -38,18 +38,19 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: (log "not empty") let awst_tmp%4#0: uint64 = test_cases.tuple_support.tuple_support.get_uint_with_side_effect() (log "not empty2") + test_cases.tuple_support.tuple_support.single_tuple() return 3u subroutine test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L121 + block@0: // L128 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u goto block@4 - block@2: // for_header_1_L124 + block@2: // for_header_1_L131 goto block@4 - block@3: // for_header_2_L124 + block@3: // for_header_2_L131 goto block@4 - block@4: // for_body_L124 + block@4: // for_body_L131 let total#1: uint64 = φ(total#0 <- block@0, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(values.0#0 <- block@0, values.1#0 <- block@2, values.2#0 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@0, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) @@ -58,12 +59,12 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: goto_nth [block@2, block@3][tuple_index%0#1] else return total#4 subroutine test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L105 + block@0: // L112 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L130 + block@0: // L137 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -73,24 +74,24 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L112 + block@0: // L119 let result#0: bytes = 0x let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L116 + block@1: // for_header_L123 let _i#0: uint64 = φ(range_item%0#0 <- block@0, range_item%0#3 <- block@2) let result#3: bytes = φ(result#0 <- block@0, result#2 <- block@2) let continue_looping%0#0: bool = (< _i#0 arg.1#0) goto continue_looping%0#0 ? block@2 : block@5 - block@2: // for_body_L116 + block@2: // for_body_L123 let result#2: bytes = (concat result#3 arg.0#0) let range_item%0#3: uint64 = (+ _i#0 1u) goto block@1 - block@5: // after_for_L116 + block@5: // after_for_L123 return result#3 subroutine test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L142 + block@0: // L149 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: bool = (== b#0 2u) @@ -100,7 +101,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: - block@0: // L151 + block@0: // L158 let tmp%0#0: uint64 = test_cases.tuple_support.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) let tmp%1#0: uint64 = (+ values.0#0 values.1#0) let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) @@ -111,19 +112,23 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.bin_ops() -> void: - block@0: // L77 + block@0: // L84 return subroutine test_cases.tuple_support.tuple_support.non_empty_tuple() -> : - block@0: // L71 + block@0: // L78 (log "non_empty_tuple called") return 4u 2u subroutine test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: - block@0: // L65 + block@0: // L72 (log "get_uint_with_side_effect called") return 4u + subroutine test_cases.tuple_support.tuple_support.single_tuple() -> void: + block@0: // L66 + return + subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -131,5 +136,5 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: program clear-state: subroutine test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L61 + block@0: // L62 return 0u \ No newline at end of file diff --git a/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_4.ir b/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_4.ir index 859a1c4555..e7924e0aa7 100644 --- a/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_4.ir +++ b/test_cases/tuple_support/out/TupleSupport.ssa.opt_pass_4.ir @@ -34,18 +34,19 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: (log "not empty") let awst_tmp%4#0: uint64 = test_cases.tuple_support.tuple_support.get_uint_with_side_effect() (log "not empty2") + test_cases.tuple_support.tuple_support.single_tuple() return 3u subroutine test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L121 + block@0: // L128 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u goto block@4 - block@2: // for_header_1_L124 + block@2: // for_header_1_L131 goto block@4 - block@3: // for_header_2_L124 + block@3: // for_header_2_L131 goto block@4 - block@4: // for_body_L124 + block@4: // for_body_L131 let total#1: uint64 = φ(total#0 <- block@0, total#4 <- block@2, total#4 <- block@3) let value#3: uint64 = φ(values.0#0 <- block@0, values.1#0 <- block@2, values.2#0 <- block@3) let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@0, tuple_index%0#4 <- block@2, tuple_index%0#4 <- block@3) @@ -54,12 +55,12 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: goto_nth [block@2, block@3][tuple_index%0#1] else return total#4 subroutine test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L105 + block@0: // L112 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L130 + block@0: // L137 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#1: uint64) = (addw c_mid#0 lo_carry#0) @@ -69,24 +70,24 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return c_hi#0 c_mid#1 c_lo#0 subroutine test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L112 + block@0: // L119 let result#0: bytes = 0x let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L116 + block@1: // for_header_L123 let _i#0: uint64 = φ(range_item%0#0 <- block@0, range_item%0#3 <- block@2) let result#3: bytes = φ(result#0 <- block@0, result#2 <- block@2) let continue_looping%0#0: bool = (< _i#0 arg.1#0) goto continue_looping%0#0 ? block@2 : block@5 - block@2: // for_body_L116 + block@2: // for_body_L123 let result#2: bytes = (concat result#3 arg.0#0) let range_item%0#3: uint64 = (+ _i#0 1u) goto block@1 - block@5: // after_for_L116 + block@5: // after_for_L123 return result#3 subroutine test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L142 + block@0: // L149 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: bool = (== b#0 2u) @@ -96,7 +97,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: - block@0: // L151 + block@0: // L158 let tmp%0#0: uint64 = test_cases.tuple_support.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) let tmp%1#0: uint64 = (+ values.0#0 values.1#0) let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) @@ -105,19 +106,23 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.bin_ops() -> void: - block@0: // L77 + block@0: // L84 return subroutine test_cases.tuple_support.tuple_support.non_empty_tuple() -> : - block@0: // L71 + block@0: // L78 (log "non_empty_tuple called") return 4u 2u subroutine test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: - block@0: // L65 + block@0: // L72 (log "get_uint_with_side_effect called") return 4u + subroutine test_cases.tuple_support.tuple_support.single_tuple() -> void: + block@0: // L66 + return + subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -125,5 +130,5 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: program clear-state: subroutine test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L61 + block@0: // L62 return 0u \ No newline at end of file diff --git a/test_cases/tuple_support/out/tuple_support.awst b/test_cases/tuple_support/out/tuple_support.awst index efb405f301..c25df0a045 100644 --- a/test_cases/tuple_support/out/tuple_support.awst +++ b/test_cases/tuple_support/out/tuple_support.awst @@ -50,6 +50,7 @@ contract TupleSupport if (SINGLE_EVAL(id=3, source=test_cases.tuple_support.tuple_support::get_uint_with_side_effect()) == SINGLE_EVAL(id=3, source=test_cases.tuple_support.tuple_support::get_uint_with_side_effect())) { log('not empty2') } + test_cases.tuple_support.tuple_support::single_tuple() return a + b } @@ -59,6 +60,12 @@ contract TupleSupport } } +subroutine single_tuple(): void +{ + tup: tuple = (1u) + assert(tup[0] == 1u) +} + subroutine get_uint_with_side_effect(): uint64 { log('get_uint_with_side_effect called') diff --git a/test_cases/tuple_support/out_O2/TupleSupport.approval.teal b/test_cases/tuple_support/out_O2/TupleSupport.approval.teal index 36de3a00c5..a0ca977105 100644 --- a/test_cases/tuple_support/out_O2/TupleSupport.approval.teal +++ b/test_cases/tuple_support/out_O2/TupleSupport.approval.teal @@ -63,6 +63,7 @@ main_entrypoint@2: pop byte "not empty2" log + callsub single_tuple int 3 return @@ -217,6 +218,12 @@ get_uint_with_side_effect: retsub +// test_cases.tuple_support.tuple_support.single_tuple() -> void: +single_tuple: + proto 0 0 + retsub + + // test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: __init__: proto 0 0 diff --git a/test_cases/tuple_support/out_O2/TupleSupport.destructured.ir b/test_cases/tuple_support/out_O2/TupleSupport.destructured.ir index 9abe4781c6..52bafaf401 100644 --- a/test_cases/tuple_support/out_O2/TupleSupport.destructured.ir +++ b/test_cases/tuple_support/out_O2/TupleSupport.destructured.ir @@ -34,34 +34,35 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: (log "not empty") let awst_tmp%4#0: uint64 = test_cases.tuple_support.tuple_support.get_uint_with_side_effect() (log "not empty2") + test_cases.tuple_support.tuple_support.single_tuple() return 3u subroutine test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L121 + block@0: // L128 let total#0: uint64 = 0u let tuple_index%0#0: uint64 = 0u let value#3: uint64 = values.0#0 goto block@4 - block@2: // for_header_1_L124 + block@2: // for_header_1_L131 let tuple_index%0#0: uint64 = tuple_index%0#4 let value#3: uint64 = values.1#0 goto block@4 - block@3: // for_header_2_L124 + block@3: // for_header_2_L131 let tuple_index%0#0: uint64 = tuple_index%0#4 let value#3: uint64 = values.2#0 goto block@4 - block@4: // for_body_L124 + block@4: // for_body_L131 let total#0: uint64 = (+ total#0 value#3) let tuple_index%0#4: uint64 = (+ tuple_index%0#0 1u) goto_nth [block@2, block@3][tuple_index%0#0] else return total#0 subroutine test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L105 + block@0: // L112 let result#0: bytes = (concat arg.0#0 arg.1#0) return result#0 subroutine test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L130 + block@0: // L137 let (lo_carry#0: uint64, c_lo#0: uint64) = (addw a.1#0 b.1#0) let (hi_carry1#0: uint64, c_mid#0: uint64) = (addw a.0#0 b.0#0) let (hi_carry2#0: uint64, c_mid#0: uint64) = (addw c_mid#0 lo_carry#0) @@ -71,24 +72,24 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return c_hi#0 c_mid#0 c_lo#0 subroutine test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L112 + block@0: // L119 let result#0: bytes = 0x let range_item%0#0: uint64 = 0u let _i#0: uint64 = range_item%0#0 goto block@1 - block@1: // for_header_L116 + block@1: // for_header_L123 let continue_looping%0#0: bool = (< _i#0 arg.1#0) goto continue_looping%0#0 ? block@2 : block@5 - block@2: // for_body_L116 + block@2: // for_body_L123 let result#0: bytes = (concat result#0 arg.0#0) let range_item%0#0: uint64 = (+ _i#0 1u) let _i#0: uint64 = range_item%0#0 goto block@1 - block@5: // after_for_L116 + block@5: // after_for_L123 return result#0 subroutine test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L142 + block@0: // L149 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let tmp%0#0: bool = (== b#0 2u) @@ -98,7 +99,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: - block@0: // L151 + block@0: // L158 let tmp%0#0: uint64 = test_cases.tuple_support.tuple_support.add_three_values(values.0#0, values.1#0, values.2#0) let tmp%1#0: uint64 = (+ values.0#0 values.1#0) let tmp%2#0: uint64 = (+ tmp%1#0 values.2#0) @@ -107,19 +108,23 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.bin_ops() -> void: - block@0: // L77 + block@0: // L84 return subroutine test_cases.tuple_support.tuple_support.non_empty_tuple() -> : - block@0: // L71 + block@0: // L78 (log "non_empty_tuple called") return 4u 2u subroutine test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: - block@0: // L65 + block@0: // L72 (log "get_uint_with_side_effect called") return 4u + subroutine test_cases.tuple_support.tuple_support.single_tuple() -> void: + block@0: // L66 + return + subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -127,5 +132,5 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: program clear-state: subroutine test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L61 + block@0: // L62 return 0u \ No newline at end of file diff --git a/test_cases/tuple_support/out_unoptimized/TupleSupport.approval.teal b/test_cases/tuple_support/out_unoptimized/TupleSupport.approval.teal index 5e852115ad..0bcb2a1e2c 100644 --- a/test_cases/tuple_support/out_unoptimized/TupleSupport.approval.teal +++ b/test_cases/tuple_support/out_unoptimized/TupleSupport.approval.teal @@ -248,11 +248,14 @@ main_after_if_else@7: log main_after_if_else@9: + // tuple_support/tuple_support.py:59 + // single_tuple() + callsub single_tuple // tuple_support/tuple_support.py:11 // (a, b) = (UInt64(1), UInt64(2)) int 1 int 2 - // tuple_support/tuple_support.py:59 + // tuple_support/tuple_support.py:60 // return a + b + return @@ -260,24 +263,24 @@ main_after_if_else@9: // test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: add_three_values: - // tuple_support/tuple_support.py:121-122 + // tuple_support/tuple_support.py:128-129 // @subroutine // def add_three_values(values: tuple[UInt64, UInt64, UInt64]) -> UInt64: proto 3 1 byte "" dup - // tuple_support/tuple_support.py:123 + // tuple_support/tuple_support.py:130 // total = UInt64(0) int 0 int 0 frame_bury 0 - // tuple_support/tuple_support.py:124 + // tuple_support/tuple_support.py:131 // for value in values: frame_dig -3 b add_three_values_for_body@4 add_three_values_for_header_1@2: - // tuple_support/tuple_support.py:124 + // tuple_support/tuple_support.py:131 // for value in values: frame_dig -2 frame_dig 1 @@ -285,14 +288,14 @@ add_three_values_for_header_1@2: b add_three_values_for_body@4 add_three_values_for_header_2@3: - // tuple_support/tuple_support.py:124 + // tuple_support/tuple_support.py:131 // for value in values: frame_dig -1 frame_dig 1 frame_bury 0 add_three_values_for_body@4: - // tuple_support/tuple_support.py:125 + // tuple_support/tuple_support.py:132 // total += value frame_dig 2 uncover 1 @@ -303,10 +306,10 @@ add_three_values_for_body@4: int 1 + frame_bury 1 - // tuple_support/tuple_support.py:124 + // tuple_support/tuple_support.py:131 // for value in values: switch add_three_values_for_header_1@2 add_three_values_for_header_2@3 - // tuple_support/tuple_support.py:127 + // tuple_support/tuple_support.py:134 // return total frame_dig 2 frame_bury 0 @@ -315,62 +318,62 @@ add_three_values_for_body@4: // test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: bytes_combine: - // tuple_support/tuple_support.py:105-106 + // tuple_support/tuple_support.py:112-113 // @subroutine // def bytes_combine(arg: tuple[Bytes, Bytes]) -> Bytes: proto 2 1 - // tuple_support/tuple_support.py:107 + // tuple_support/tuple_support.py:114 // a, b = arg frame_dig -2 frame_dig -1 - // tuple_support/tuple_support.py:108 + // tuple_support/tuple_support.py:115 // result = a + b concat - // tuple_support/tuple_support.py:109 + // tuple_support/tuple_support.py:116 // return result retsub // test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> uint64, uint64, uint64: addw2: - // tuple_support/tuple_support.py:130-131 + // tuple_support/tuple_support.py:137-138 // @subroutine // def addw2(a: tuple[UInt64, UInt64], b: tuple[UInt64, UInt64]) -> tuple[UInt64, UInt64, UInt64]: proto 4 3 - // tuple_support/tuple_support.py:132 + // tuple_support/tuple_support.py:139 // a_hi, a_lo = a frame_dig -4 frame_dig -3 - // tuple_support/tuple_support.py:133 + // tuple_support/tuple_support.py:140 // b_hi, b_lo = b frame_dig -2 cover 1 frame_dig -1 - // tuple_support/tuple_support.py:134 + // tuple_support/tuple_support.py:141 // lo_carry, c_lo = op.addw(a_lo, b_lo) addw cover 1 cover 2 cover 3 - // tuple_support/tuple_support.py:135 + // tuple_support/tuple_support.py:142 // hi_carry1, c_mid = op.addw(a_hi, b_hi) uncover 2 uncover 1 addw - // tuple_support/tuple_support.py:136 + // tuple_support/tuple_support.py:143 // hi_carry2, c_mid = op.addw(c_mid, lo_carry) uncover 2 addw cover 2 - // tuple_support/tuple_support.py:137 + // tuple_support/tuple_support.py:144 // did_overflow, c_hi = op.addw(hi_carry1, hi_carry2) addw cover 1 - // tuple_support/tuple_support.py:138 + // tuple_support/tuple_support.py:145 // assert not did_overflow, "is such a thing even possible? 👽" ! assert // is such a thing even possible? 👽 - // tuple_support/tuple_support.py:139 + // tuple_support/tuple_support.py:146 // return c_hi, c_mid, c_lo uncover 1 uncover 2 @@ -379,37 +382,37 @@ addw2: // test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: bytes_multiply: - // tuple_support/tuple_support.py:112-113 + // tuple_support/tuple_support.py:119-120 // @subroutine // def bytes_multiply(arg: tuple[Bytes, UInt64]) -> Bytes: proto 2 1 - // tuple_support/tuple_support.py:114 + // tuple_support/tuple_support.py:121 // b, count = arg frame_dig -2 frame_dig -1 - // tuple_support/tuple_support.py:115 + // tuple_support/tuple_support.py:122 // result = Bytes() byte 0x - // tuple_support/tuple_support.py:116 + // tuple_support/tuple_support.py:123 // for _i in urange(count): int 1 assert // Step cannot be zero int 0 bytes_multiply_for_header@1: - // tuple_support/tuple_support.py:116 + // tuple_support/tuple_support.py:123 // for _i in urange(count): frame_dig 3 frame_dig 1 < bz bytes_multiply_after_for@5 - // tuple_support/tuple_support.py:117 + // tuple_support/tuple_support.py:124 // result += b frame_dig 2 frame_dig 0 concat frame_bury 2 - // tuple_support/tuple_support.py:116 + // tuple_support/tuple_support.py:123 // for _i in urange(count): frame_dig 3 int 1 @@ -418,7 +421,7 @@ bytes_multiply_for_header@1: b bytes_multiply_for_header@1 bytes_multiply_after_for@5: - // tuple_support/tuple_support.py:118 + // tuple_support/tuple_support.py:125 // return result frame_dig 2 frame_bury 0 @@ -427,26 +430,26 @@ bytes_multiply_after_for@5: // test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: test_tuple_swap: - // tuple_support/tuple_support.py:142-143 + // tuple_support/tuple_support.py:149-150 // @subroutine // def test_tuple_swap(zero: UInt64) -> None: proto 1 0 - // tuple_support/tuple_support.py:144 + // tuple_support/tuple_support.py:151 // a = zero + 1 frame_dig -1 int 1 + - // tuple_support/tuple_support.py:145 + // tuple_support/tuple_support.py:152 // b = zero + 2 frame_dig -1 int 2 + - // tuple_support/tuple_support.py:147 + // tuple_support/tuple_support.py:154 // assert a == 2, "a should be two" int 2 == assert // a should be two - // tuple_support/tuple_support.py:148 + // tuple_support/tuple_support.py:155 // assert b == 1, "b should be one" int 1 == @@ -456,16 +459,16 @@ test_tuple_swap: // test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: slicing: - // tuple_support/tuple_support.py:151-152 + // tuple_support/tuple_support.py:158-159 // @subroutine // def slicing(values: tuple[UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64, UInt64]) -> None: proto 8 0 - // tuple_support/tuple_support.py:153 + // tuple_support/tuple_support.py:160 // one_to_three = values[0:3] frame_dig -8 frame_dig -7 frame_dig -6 - // tuple_support/tuple_support.py:154 + // tuple_support/tuple_support.py:161 // assert add_three_values(one_to_three) == values[0] + values[1] + values[2] dig 2 dig 2 @@ -478,13 +481,13 @@ slicing: + == assert - // tuple_support/tuple_support.py:156 + // tuple_support/tuple_support.py:163 // assert one_to_three[-2:-1][0] == one_to_three[1] dig 1 dig 2 == assert - // tuple_support/tuple_support.py:158 + // tuple_support/tuple_support.py:165 // assert one_to_three == one_to_three[:] dig 2 cover 1 @@ -509,134 +512,134 @@ slicing: // test_cases.tuple_support.tuple_support.bin_ops() -> void: bin_ops: - // tuple_support/tuple_support.py:77-78 + // tuple_support/tuple_support.py:84-85 // @subroutine // def bin_ops() -> None: proto 0 0 - // tuple_support/tuple_support.py:79 + // tuple_support/tuple_support.py:86 // a = (UInt64(1),) * 3 int 1 - // tuple_support/tuple_support.py:80 + // tuple_support/tuple_support.py:87 // assert a[0] == 1 int 1 == assert - // tuple_support/tuple_support.py:79 + // tuple_support/tuple_support.py:86 // a = (UInt64(1),) * 3 int 1 - // tuple_support/tuple_support.py:81 + // tuple_support/tuple_support.py:88 // assert a[1] == 1 int 1 == assert - // tuple_support/tuple_support.py:79 + // tuple_support/tuple_support.py:86 // a = (UInt64(1),) * 3 int 1 - // tuple_support/tuple_support.py:82 + // tuple_support/tuple_support.py:89 // assert a[2] == 1 int 1 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 1 - // tuple_support/tuple_support.py:86 + // tuple_support/tuple_support.py:93 // assert b[0] == 1 int 1 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 2 - // tuple_support/tuple_support.py:87 + // tuple_support/tuple_support.py:94 // assert b[1] == 2 int 2 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 1 - // tuple_support/tuple_support.py:88 + // tuple_support/tuple_support.py:95 // assert b[2] == 1 int 1 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 2 - // tuple_support/tuple_support.py:89 + // tuple_support/tuple_support.py:96 // assert b[3] == 2 int 2 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 1 - // tuple_support/tuple_support.py:90 + // tuple_support/tuple_support.py:97 // assert b[4] == 1 int 1 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 2 - // tuple_support/tuple_support.py:91 + // tuple_support/tuple_support.py:98 // assert b[5] == 2 int 2 == assert - // tuple_support/tuple_support.py:93 + // tuple_support/tuple_support.py:100 // c = (UInt64(1),) + (Bytes(b"2"), UInt64(3)) # noqa: RUF005 int 1 - // tuple_support/tuple_support.py:94 + // tuple_support/tuple_support.py:101 // assert c[0] == 1 int 1 == assert - // tuple_support/tuple_support.py:93 + // tuple_support/tuple_support.py:100 // c = (UInt64(1),) + (Bytes(b"2"), UInt64(3)) # noqa: RUF005 byte 0x32 - // tuple_support/tuple_support.py:95 + // tuple_support/tuple_support.py:102 // assert c[1] == b"2" byte 0x32 == assert - // tuple_support/tuple_support.py:93 + // tuple_support/tuple_support.py:100 // c = (UInt64(1),) + (Bytes(b"2"), UInt64(3)) # noqa: RUF005 int 3 - // tuple_support/tuple_support.py:96 + // tuple_support/tuple_support.py:103 // assert c[2] == 3 int 3 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 1 - // tuple_support/tuple_support.py:99 + // tuple_support/tuple_support.py:106 // assert d[0] == 1 int 1 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 2 - // tuple_support/tuple_support.py:100 + // tuple_support/tuple_support.py:107 // assert d[1] == 2 int 2 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 1 - // tuple_support/tuple_support.py:101 + // tuple_support/tuple_support.py:108 // assert d[2] == 1 int 1 == assert - // tuple_support/tuple_support.py:84 + // tuple_support/tuple_support.py:91 // tup = (UInt64(1), UInt64(2)) int 2 - // tuple_support/tuple_support.py:102 + // tuple_support/tuple_support.py:109 // assert d[3] == 2 int 2 == @@ -646,15 +649,15 @@ bin_ops: // test_cases.tuple_support.tuple_support.non_empty_tuple() -> uint64, uint64: non_empty_tuple: - // tuple_support/tuple_support.py:71-72 + // tuple_support/tuple_support.py:78-79 // @subroutine // def non_empty_tuple() -> tuple[UInt64, UInt64]: proto 0 2 - // tuple_support/tuple_support.py:73 + // tuple_support/tuple_support.py:80 // log("non_empty_tuple called") byte "non_empty_tuple called" log - // tuple_support/tuple_support.py:74 + // tuple_support/tuple_support.py:81 // return UInt64(4), UInt64(2) int 4 int 2 @@ -663,20 +666,37 @@ non_empty_tuple: // test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: get_uint_with_side_effect: - // tuple_support/tuple_support.py:65-66 + // tuple_support/tuple_support.py:72-73 // @subroutine // def get_uint_with_side_effect() -> UInt64: proto 0 1 - // tuple_support/tuple_support.py:67 + // tuple_support/tuple_support.py:74 // log("get_uint_with_side_effect called") byte "get_uint_with_side_effect called" log - // tuple_support/tuple_support.py:68 + // tuple_support/tuple_support.py:75 // return UInt64(4) int 4 retsub +// test_cases.tuple_support.tuple_support.single_tuple() -> void: +single_tuple: + // tuple_support/tuple_support.py:66-67 + // @subroutine + // def single_tuple() -> None: + proto 0 0 + // tuple_support/tuple_support.py:68 + // tup = (UInt64(1),) + int 1 + // tuple_support/tuple_support.py:69 + // assert tup[0] == 1 + int 1 + == + assert + retsub + + // test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: __init__: // tuple_support/tuple_support.py:5 diff --git a/test_cases/tuple_support/out_unoptimized/TupleSupport.clear.teal b/test_cases/tuple_support/out_unoptimized/TupleSupport.clear.teal index f15d8a6b32..15f744fb62 100644 --- a/test_cases/tuple_support/out_unoptimized/TupleSupport.clear.teal +++ b/test_cases/tuple_support/out_unoptimized/TupleSupport.clear.teal @@ -1,7 +1,7 @@ #pragma version 10 test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program: - // tuple_support/tuple_support.py:62 + // tuple_support/tuple_support.py:63 // return UInt64(0) int 0 return diff --git a/test_cases/tuple_support/out_unoptimized/TupleSupport.destructured.ir b/test_cases/tuple_support/out_unoptimized/TupleSupport.destructured.ir index 9776894ab5..8c6ee1f746 100644 --- a/test_cases/tuple_support/out_unoptimized/TupleSupport.destructured.ir +++ b/test_cases/tuple_support/out_unoptimized/TupleSupport.destructured.ir @@ -79,43 +79,44 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: (log "not empty2") goto block@9 block@9: // after_if_else_L57 + test_cases.tuple_support.tuple_support.single_tuple() let tmp%22#0: uint64 = (+ 1u 2u) return tmp%22#0 subroutine test_cases.tuple_support.tuple_support.add_three_values(values.0: uint64, values.1: uint64, values.2: uint64) -> uint64: - block@0: // L121 + block@0: // L128 let total#0: uint64 = 0u goto block@1 - block@1: // for_header_0_L124 + block@1: // for_header_0_L131 let tuple_index%0#0: uint64 = 0u let value#0: uint64 = values.0#0 goto block@4 - block@2: // for_header_1_L124 + block@2: // for_header_1_L131 let value#0: uint64 = values.1#0 let tuple_index%0#0: uint64 = tuple_index%0#4 goto block@4 - block@3: // for_header_2_L124 + block@3: // for_header_2_L131 let value#0: uint64 = values.2#0 let tuple_index%0#0: uint64 = tuple_index%0#4 goto block@4 - block@4: // for_body_L124 + block@4: // for_body_L131 let total#0: uint64 = (+ total#0 value#0) goto block@5 - block@5: // for_footer_L124 + block@5: // for_footer_L131 let tuple_index%0#4: uint64 = (+ tuple_index%0#0 1u) goto_nth [block@2, block@3][tuple_index%0#0] else goto block@6 - block@6: // after_for_L124 + block@6: // after_for_L131 return total#0 subroutine test_cases.tuple_support.tuple_support.bytes_combine(arg.0: bytes, arg.1: bytes) -> bytes: - block@0: // L105 + block@0: // L112 let a#0: bytes = arg.0#0 let b#0: bytes = arg.1#0 let result#0: bytes = (concat a#0 b#0) return result#0 subroutine test_cases.tuple_support.tuple_support.addw2(a.0: uint64, a.1: uint64, b.0: uint64, b.1: uint64) -> : - block@0: // L130 + block@0: // L137 let a_hi#0: uint64 = a.0#0 let a_lo#0: uint64 = a.1#0 let b_hi#0: uint64 = b.0#0 @@ -138,29 +139,29 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return c_hi#0 c_mid#0 c_lo#0 subroutine test_cases.tuple_support.tuple_support.bytes_multiply(arg.0: bytes, arg.1: uint64) -> bytes: - block@0: // L112 + block@0: // L119 let b#0: bytes = arg.0#0 let count#0: uint64 = arg.1#0 let result#0: bytes = 0x (assert 1u) // Step cannot be zero let range_item%0#0: uint64 = 0u goto block@1 - block@1: // for_header_L116 + block@1: // for_header_L123 let continue_looping%0#0: bool = (< range_item%0#0 count#0) goto continue_looping%0#0 ? block@2 : block@5 - block@2: // for_body_L116 + block@2: // for_body_L123 let result#0: bytes = (concat result#0 b#0) goto block@3 - block@3: // for_footer_L116 + block@3: // for_footer_L123 goto block@4 - block@4: // for_increment_L116 + block@4: // for_increment_L123 let range_item%0#0: uint64 = (+ range_item%0#0 1u) goto block@1 - block@5: // after_for_L116 + block@5: // after_for_L123 return result#0 subroutine test_cases.tuple_support.tuple_support.test_tuple_swap(zero: uint64) -> void: - block@0: // L142 + block@0: // L149 let a#0: uint64 = (+ zero#0 1u) let b#0: uint64 = (+ zero#0 2u) let a#1: uint64 = b#0 @@ -172,7 +173,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.slicing(values.0: uint64, values.1: uint64, values.2: uint64, values.3: uint64, values.4: uint64, values.5: uint64, values.6: uint64, values.7: uint64) -> void: - block@0: // L151 + block@0: // L158 let one_to_three.0#0: uint64 = values.0#0 let one_to_three.1#0: uint64 = values.1#0 let one_to_three.2#0: uint64 = values.2#0 @@ -195,7 +196,7 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.bin_ops() -> void: - block@0: // L77 + block@0: // L84 let tmp%0#0: bool = (== 1u 1u) (assert tmp%0#0) let tmp%1#0: bool = (== 1u 1u) @@ -231,15 +232,21 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: return subroutine test_cases.tuple_support.tuple_support.non_empty_tuple() -> : - block@0: // L71 + block@0: // L78 (log "non_empty_tuple called") return 4u 2u subroutine test_cases.tuple_support.tuple_support.get_uint_with_side_effect() -> uint64: - block@0: // L65 + block@0: // L72 (log "get_uint_with_side_effect called") return 4u + subroutine test_cases.tuple_support.tuple_support.single_tuple() -> void: + block@0: // L66 + let tmp%0#0: bool = (== 1u 1u) + (assert tmp%0#0) + return + subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__() -> void: block@0: // L5 (app_global_put "state" 0u) @@ -247,5 +254,5 @@ contract test_cases.tuple_support.tuple_support.TupleSupport: program clear-state: subroutine test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program() -> uint64: - block@0: // L61 + block@0: // L62 return 0u \ No newline at end of file diff --git a/test_cases/tuple_support/puya.log b/test_cases/tuple_support/puya.log index f41ef8c36a..d19d861bd8 100644 --- a/test_cases/tuple_support/puya.log +++ b/test_cases/tuple_support/puya.log @@ -526,113 +526,115 @@ debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@0: // L10 debug: Terminated block@0: // L10 -debug: Sealing block@0: // L121 -debug: Terminated block@0: // L121 -debug: Sealing block@1: // for_header_0_L124 -debug: Terminated block@1: // for_header_0_L124 -debug: Terminated block@2: // for_header_1_L124 -debug: Terminated block@3: // for_header_2_L124 -debug: Sealing block@None: // for_body_L124 -debug: Created Phi assignment: let total#1: uint64 = undefined while trying to resolve 'total' in block@4: // for_body_L124 -debug: Added total#0 to Phi node: let total#1: uint64 = φ(total#0 <- block@1) in block@1: // for_header_0_L124 -debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L124 -debug: Created Phi assignment: let total#2: uint64 = undefined while trying to resolve 'total' in block@2: // for_header_1_L124 -debug: Added total#2 to Phi node: let total#1: uint64 = φ(total#0 <- block@1, total#2 <- block@2) in block@2: // for_header_1_L124 -debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@3: // for_header_2_L124 -debug: Created Phi assignment: let total#3: uint64 = undefined while trying to resolve 'total' in block@3: // for_header_2_L124 -debug: Added total#3 to Phi node: let total#1: uint64 = φ(total#0 <- block@1, total#2 <- block@2, total#3 <- block@3) in block@3: // for_header_2_L124 -debug: Created Phi assignment: let value#3: uint64 = undefined while trying to resolve 'value' in block@4: // for_body_L124 -debug: Added value#0 to Phi node: let value#3: uint64 = φ(value#0 <- block@1) in block@1: // for_header_0_L124 -debug: Added value#1 to Phi node: let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2) in block@2: // for_header_1_L124 -debug: Added value#2 to Phi node: let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2, value#2 <- block@3) in block@3: // for_header_2_L124 -debug: Terminated block@4: // for_body_L124 -debug: Sealing block@5: // for_footer_L124 -debug: Created Phi assignment: let tuple_index%0#1: uint64 = undefined while trying to resolve 'tuple_index%0' in block@4: // for_body_L124 -debug: Added tuple_index%0#0 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1) in block@1: // for_header_0_L124 -debug: Looking for 'tuple_index%0' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L124 -debug: Created Phi assignment: let tuple_index%0#2: uint64 = undefined while trying to resolve 'tuple_index%0' in block@2: // for_header_1_L124 -debug: Added tuple_index%0#2 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#2 <- block@2) in block@2: // for_header_1_L124 -debug: Looking for 'tuple_index%0' in an unsealed block creating an incomplete Phi: block@3: // for_header_2_L124 -debug: Created Phi assignment: let tuple_index%0#3: uint64 = undefined while trying to resolve 'tuple_index%0' in block@3: // for_header_2_L124 -debug: Added tuple_index%0#3 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#2 <- block@2, tuple_index%0#3 <- block@3) in block@3: // for_header_2_L124 -debug: Terminated block@5: // for_footer_L124 -debug: Sealing block@2: // for_header_1_L124 -debug: Added total#4 to Phi node: let total#2: uint64 = φ(total#4 <- block@5) in block@5: // for_footer_L124 +debug: Sealing block@0: // L128 +debug: Terminated block@0: // L128 +debug: Sealing block@1: // for_header_0_L131 +debug: Terminated block@1: // for_header_0_L131 +debug: Terminated block@2: // for_header_1_L131 +debug: Terminated block@3: // for_header_2_L131 +debug: Sealing block@None: // for_body_L131 +debug: Created Phi assignment: let total#1: uint64 = undefined while trying to resolve 'total' in block@4: // for_body_L131 +debug: Added total#0 to Phi node: let total#1: uint64 = φ(total#0 <- block@1) in block@1: // for_header_0_L131 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L131 +debug: Created Phi assignment: let total#2: uint64 = undefined while trying to resolve 'total' in block@2: // for_header_1_L131 +debug: Added total#2 to Phi node: let total#1: uint64 = φ(total#0 <- block@1, total#2 <- block@2) in block@2: // for_header_1_L131 +debug: Looking for 'total' in an unsealed block creating an incomplete Phi: block@3: // for_header_2_L131 +debug: Created Phi assignment: let total#3: uint64 = undefined while trying to resolve 'total' in block@3: // for_header_2_L131 +debug: Added total#3 to Phi node: let total#1: uint64 = φ(total#0 <- block@1, total#2 <- block@2, total#3 <- block@3) in block@3: // for_header_2_L131 +debug: Created Phi assignment: let value#3: uint64 = undefined while trying to resolve 'value' in block@4: // for_body_L131 +debug: Added value#0 to Phi node: let value#3: uint64 = φ(value#0 <- block@1) in block@1: // for_header_0_L131 +debug: Added value#1 to Phi node: let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2) in block@2: // for_header_1_L131 +debug: Added value#2 to Phi node: let value#3: uint64 = φ(value#0 <- block@1, value#1 <- block@2, value#2 <- block@3) in block@3: // for_header_2_L131 +debug: Terminated block@4: // for_body_L131 +debug: Sealing block@5: // for_footer_L131 +debug: Created Phi assignment: let tuple_index%0#1: uint64 = undefined while trying to resolve 'tuple_index%0' in block@4: // for_body_L131 +debug: Added tuple_index%0#0 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1) in block@1: // for_header_0_L131 +debug: Looking for 'tuple_index%0' in an unsealed block creating an incomplete Phi: block@2: // for_header_1_L131 +debug: Created Phi assignment: let tuple_index%0#2: uint64 = undefined while trying to resolve 'tuple_index%0' in block@2: // for_header_1_L131 +debug: Added tuple_index%0#2 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#2 <- block@2) in block@2: // for_header_1_L131 +debug: Looking for 'tuple_index%0' in an unsealed block creating an incomplete Phi: block@3: // for_header_2_L131 +debug: Created Phi assignment: let tuple_index%0#3: uint64 = undefined while trying to resolve 'tuple_index%0' in block@3: // for_header_2_L131 +debug: Added tuple_index%0#3 to Phi node: let tuple_index%0#1: uint64 = φ(tuple_index%0#0 <- block@1, tuple_index%0#2 <- block@2, tuple_index%0#3 <- block@3) in block@3: // for_header_2_L131 +debug: Terminated block@5: // for_footer_L131 +debug: Sealing block@2: // for_header_1_L131 +debug: Added total#4 to Phi node: let total#2: uint64 = φ(total#4 <- block@5) in block@5: // for_footer_L131 debug: Replacing trivial Phi node: let total#2: uint64 = φ(total#4 <- block@5) (total#2) with total#4 debug: Deleting Phi assignment: let total#2: uint64 = φ(total#4 <- block@5) debug: Replaced trivial Phi node: let total#2: uint64 = φ(total#4 <- block@5) (total#2) with total#4 in current definition for 1 blocks -debug: Added tuple_index%0#4 to Phi node: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) in block@5: // for_footer_L124 +debug: Added tuple_index%0#4 to Phi node: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) in block@5: // for_footer_L131 debug: Replacing trivial Phi node: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) (tuple_index%0#2) with tuple_index%0#4 debug: Deleting Phi assignment: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) debug: Replaced trivial Phi node: let tuple_index%0#2: uint64 = φ(tuple_index%0#4 <- block@5) (tuple_index%0#2) with tuple_index%0#4 in current definition for 1 blocks -debug: Sealing block@3: // for_header_2_L124 -debug: Added total#4 to Phi node: let total#3: uint64 = φ(total#4 <- block@5) in block@5: // for_footer_L124 +debug: Sealing block@3: // for_header_2_L131 +debug: Added total#4 to Phi node: let total#3: uint64 = φ(total#4 <- block@5) in block@5: // for_footer_L131 debug: Replacing trivial Phi node: let total#3: uint64 = φ(total#4 <- block@5) (total#3) with total#4 debug: Deleting Phi assignment: let total#3: uint64 = φ(total#4 <- block@5) debug: Replaced trivial Phi node: let total#3: uint64 = φ(total#4 <- block@5) (total#3) with total#4 in current definition for 1 blocks -debug: Added tuple_index%0#4 to Phi node: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) in block@5: // for_footer_L124 +debug: Added tuple_index%0#4 to Phi node: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) in block@5: // for_footer_L131 debug: Replacing trivial Phi node: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) (tuple_index%0#3) with tuple_index%0#4 debug: Deleting Phi assignment: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) debug: Replaced trivial Phi node: let tuple_index%0#3: uint64 = φ(tuple_index%0#4 <- block@5) (tuple_index%0#3) with tuple_index%0#4 in current definition for 1 blocks -debug: Sealing block@None: // after_for_L124 -debug: Terminated block@6: // after_for_L124 -debug: Sealing block@0: // L105 -debug: Terminated block@0: // L105 -debug: Sealing block@0: // L130 -debug: Terminated block@0: // L130 +debug: Sealing block@None: // after_for_L131 +debug: Terminated block@6: // after_for_L131 debug: Sealing block@0: // L112 debug: Terminated block@0: // L112 -debug: Looking for 'range_item%0' in an unsealed block creating an incomplete Phi: block@1: // for_header_L116 -debug: Created Phi assignment: let range_item%0#1: uint64 = undefined while trying to resolve 'range_item%0' in block@1: // for_header_L116 -debug: Terminated block@1: // for_header_L116 -debug: Looking for 'range_item%0' in an unsealed block creating an incomplete Phi: block@2: // for_body_L116 -debug: Created Phi assignment: let range_item%0#2: uint64 = undefined while trying to resolve 'range_item%0' in block@2: // for_body_L116 -debug: Looking for 'result' in an unsealed block creating an incomplete Phi: block@2: // for_body_L116 -debug: Created Phi assignment: let result#1: bytes = undefined while trying to resolve 'result' in block@2: // for_body_L116 -debug: Looking for 'b' in an unsealed block creating an incomplete Phi: block@2: // for_body_L116 -debug: Created Phi assignment: let b#1: bytes = undefined while trying to resolve 'b' in block@2: // for_body_L116 -debug: Terminated block@2: // for_body_L116 -debug: Sealing block@3: // for_footer_L116 -debug: Terminated block@3: // for_footer_L116 -debug: Sealing block@4: // for_increment_L116 -debug: Terminated block@4: // for_increment_L116 -debug: Sealing block@1: // for_header_L116 -debug: Added range_item%0#0 to Phi node: let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0) in block@0: // L112 -debug: Added range_item%0#3 to Phi node: let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0, range_item%0#3 <- block@4) in block@4: // for_increment_L116 -debug: Sealing block@2: // for_body_L116 -debug: Added range_item%0#1 to Phi node: let range_item%0#2: uint64 = φ(range_item%0#1 <- block@1) in block@1: // for_header_L116 +debug: Sealing block@0: // L137 +debug: Terminated block@0: // L137 +debug: Sealing block@0: // L119 +debug: Terminated block@0: // L119 +debug: Looking for 'range_item%0' in an unsealed block creating an incomplete Phi: block@1: // for_header_L123 +debug: Created Phi assignment: let range_item%0#1: uint64 = undefined while trying to resolve 'range_item%0' in block@1: // for_header_L123 +debug: Terminated block@1: // for_header_L123 +debug: Looking for 'range_item%0' in an unsealed block creating an incomplete Phi: block@2: // for_body_L123 +debug: Created Phi assignment: let range_item%0#2: uint64 = undefined while trying to resolve 'range_item%0' in block@2: // for_body_L123 +debug: Looking for 'result' in an unsealed block creating an incomplete Phi: block@2: // for_body_L123 +debug: Created Phi assignment: let result#1: bytes = undefined while trying to resolve 'result' in block@2: // for_body_L123 +debug: Looking for 'b' in an unsealed block creating an incomplete Phi: block@2: // for_body_L123 +debug: Created Phi assignment: let b#1: bytes = undefined while trying to resolve 'b' in block@2: // for_body_L123 +debug: Terminated block@2: // for_body_L123 +debug: Sealing block@3: // for_footer_L123 +debug: Terminated block@3: // for_footer_L123 +debug: Sealing block@4: // for_increment_L123 +debug: Terminated block@4: // for_increment_L123 +debug: Sealing block@1: // for_header_L123 +debug: Added range_item%0#0 to Phi node: let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0) in block@0: // L119 +debug: Added range_item%0#3 to Phi node: let range_item%0#1: uint64 = φ(range_item%0#0 <- block@0, range_item%0#3 <- block@4) in block@4: // for_increment_L123 +debug: Sealing block@2: // for_body_L123 +debug: Added range_item%0#1 to Phi node: let range_item%0#2: uint64 = φ(range_item%0#1 <- block@1) in block@1: // for_header_L123 debug: Replacing trivial Phi node: let range_item%0#2: uint64 = φ(range_item%0#1 <- block@1) (range_item%0#2) with range_item%0#1 debug: Deleting Phi assignment: let range_item%0#2: uint64 = φ(range_item%0#1 <- block@1) debug: Replaced trivial Phi node: let range_item%0#2: uint64 = φ(range_item%0#1 <- block@1) (range_item%0#2) with range_item%0#1 in current definition for 2 blocks -debug: Created Phi assignment: let result#3: bytes = undefined while trying to resolve 'result' in block@1: // for_header_L116 -debug: Added result#0 to Phi node: let result#3: bytes = φ(result#0 <- block@0) in block@0: // L112 -debug: Added result#2 to Phi node: let result#3: bytes = φ(result#0 <- block@0, result#2 <- block@4) in block@4: // for_increment_L116 -debug: Added result#3 to Phi node: let result#1: bytes = φ(result#3 <- block@1) in block@1: // for_header_L116 +debug: Created Phi assignment: let result#3: bytes = undefined while trying to resolve 'result' in block@1: // for_header_L123 +debug: Added result#0 to Phi node: let result#3: bytes = φ(result#0 <- block@0) in block@0: // L119 +debug: Added result#2 to Phi node: let result#3: bytes = φ(result#0 <- block@0, result#2 <- block@4) in block@4: // for_increment_L123 +debug: Added result#3 to Phi node: let result#1: bytes = φ(result#3 <- block@1) in block@1: // for_header_L123 debug: Replacing trivial Phi node: let result#1: bytes = φ(result#3 <- block@1) (result#1) with result#3 debug: Deleting Phi assignment: let result#1: bytes = φ(result#3 <- block@1) debug: Replaced trivial Phi node: let result#1: bytes = φ(result#3 <- block@1) (result#1) with result#3 in current definition for 0 blocks -debug: Created Phi assignment: let b#2: bytes = undefined while trying to resolve 'b' in block@1: // for_header_L116 -debug: Added b#0 to Phi node: let b#2: bytes = φ(b#0 <- block@0) in block@0: // L112 -debug: Added b#1 to Phi node: let b#2: bytes = φ(b#0 <- block@0, b#1 <- block@4) in block@4: // for_increment_L116 -debug: Added b#2 to Phi node: let b#1: bytes = φ(b#2 <- block@1) in block@1: // for_header_L116 +debug: Created Phi assignment: let b#2: bytes = undefined while trying to resolve 'b' in block@1: // for_header_L123 +debug: Added b#0 to Phi node: let b#2: bytes = φ(b#0 <- block@0) in block@0: // L119 +debug: Added b#1 to Phi node: let b#2: bytes = φ(b#0 <- block@0, b#1 <- block@4) in block@4: // for_increment_L123 +debug: Added b#2 to Phi node: let b#1: bytes = φ(b#2 <- block@1) in block@1: // for_header_L123 debug: Replacing trivial Phi node: let b#1: bytes = φ(b#2 <- block@1) (b#1) with b#2 debug: Deleting Phi assignment: let b#1: bytes = φ(b#2 <- block@1) debug: Replacing trivial Phi node: let b#2: bytes = φ(b#0 <- block@0, b#2 <- block@4) (b#2) with b#0 debug: Deleting Phi assignment: let b#2: bytes = φ(b#0 <- block@0, b#2 <- block@4) debug: Replaced trivial Phi node: let b#1: bytes = φ(b#2 <- block@1) (b#1) with b#2 in current definition for 3 blocks debug: Replaced trivial Phi node: let b#2: bytes = φ(b#0 <- block@0, b#2 <- block@4) (b#2) with b#0 in current definition for 4 blocks -debug: Sealing block@None: // after_for_L116 -debug: Terminated block@5: // after_for_L116 -debug: Sealing block@0: // L142 -debug: Terminated block@0: // L142 -debug: Sealing block@0: // L151 -debug: Terminated block@0: // L151 -debug: Sealing block@0: // L77 -debug: Terminated block@0: // L77 -debug: Sealing block@0: // L71 -debug: Terminated block@0: // L71 -debug: Sealing block@0: // L65 -debug: Terminated block@0: // L65 +debug: Sealing block@None: // after_for_L123 +debug: Terminated block@5: // after_for_L123 +debug: Sealing block@0: // L149 +debug: Terminated block@0: // L149 +debug: Sealing block@0: // L158 +debug: Terminated block@0: // L158 +debug: Sealing block@0: // L84 +debug: Terminated block@0: // L84 +debug: Sealing block@0: // L78 +debug: Terminated block@0: // L78 +debug: Sealing block@0: // L72 +debug: Terminated block@0: // L72 +debug: Sealing block@0: // L66 +debug: Terminated block@0: // L66 debug: Sealing block@0: // L5 debug: Terminated block@0: // L5 debug: Sealing block@0: // L8 @@ -723,8 +725,8 @@ debug: Replacing trivial Phi node: let b#2: uint64 = φ(b#0 <- block@7, b#0 <- b debug: Deleting Phi assignment: let b#2: uint64 = φ(b#0 <- block@7, b#0 <- block@8) debug: Replaced trivial Phi node: let b#2: uint64 = φ(b#0 <- block@7, b#0 <- block@8) (b#2) with b#0 in current definition for 1 blocks debug: Terminated block@9: // after_if_else_L57 -debug: Sealing block@0: // L61 -debug: Terminated block@0: // L61 +debug: Sealing block@0: // L62 +debug: Terminated block@0: // L62 debug: Output IR to tuple_support/out/TupleComparisons.ssa.ir info: Optimizing test_cases.tuple_support.tuple_comparisons.TupleComparisons at level 1 debug: Begin optimization pass 1/100 @@ -1190,18 +1192,18 @@ debug: Optimizer: Remove Unused Variables debug: Optimizer: Inner Txn Field Replacer debug: Optimizer: Simplify Control Ops debug: inlining the default target of a switch/goto nth -debug: simplified terminator of block@5: // for_footer_L124 from goto_nth [block@2, block@3][tuple_index%0#1] else goto block@6 to goto_nth [block@2, block@3][tuple_index%0#1] else return total#4 +debug: simplified terminator of block@5: // for_footer_L131 from goto_nth [block@2, block@3][tuple_index%0#1] else goto block@6 to goto_nth [block@2, block@3][tuple_index%0#1] else return total#4 debug: Optimizer: Remove Linear Jump -debug: Replaced predecessor block@1: // for_header_0_L124 with block@0: // L121 in block@4: // for_body_L124 -debug: Merged linear block@1: // for_header_0_L124 into block@0: // L121 -debug: Replaced predecessor block@5: // for_footer_L124 with block@4: // for_body_L124 in block@2: // for_header_1_L124 -debug: Replaced predecessor block@5: // for_footer_L124 with block@4: // for_body_L124 in block@3: // for_header_2_L124 -debug: Merged linear block@5: // for_footer_L124 into block@4: // for_body_L124 +debug: Replaced predecessor block@1: // for_header_0_L131 with block@0: // L128 in block@4: // for_body_L131 +debug: Merged linear block@1: // for_header_0_L131 into block@0: // L128 +debug: Replaced predecessor block@5: // for_footer_L131 with block@4: // for_body_L131 in block@2: // for_header_1_L131 +debug: Replaced predecessor block@5: // for_footer_L131 with block@4: // for_body_L131 in block@3: // for_header_2_L131 +debug: Merged linear block@5: // for_footer_L131 into block@4: // for_body_L131 debug: Optimizer: Remove Empty Blocks -debug: Not removing empty block block@2: // for_header_1_L124 because it's used by phi nodes -debug: Not removing empty block block@3: // for_header_2_L124 because it's used by phi nodes +debug: Not removing empty block block@2: // for_header_1_L131 because it's used by phi nodes +debug: Not removing empty block block@3: // for_header_2_L131 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks -debug: Removing unreachable blocks: block@6: // after_for_L124 +debug: Removing unreachable blocks: block@6: // after_for_L131 debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.bytes_combine debug: Splitting parallel copies prior to optimization @@ -1270,10 +1272,10 @@ debug: Optimizer: Remove Unused Variables debug: Optimizer: Inner Txn Field Replacer debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump -debug: Replaced predecessor block@3: // for_footer_L116 with block@2: // for_body_L116 in block@4: // for_increment_L116 -debug: Merged linear block@3: // for_footer_L116 into block@2: // for_body_L116 -debug: Replaced predecessor block@4: // for_increment_L116 with block@2: // for_body_L116 in block@1: // for_header_L116 -debug: Merged linear block@4: // for_increment_L116 into block@2: // for_body_L116 +debug: Replaced predecessor block@3: // for_footer_L123 with block@2: // for_body_L123 in block@4: // for_increment_L123 +debug: Merged linear block@3: // for_footer_L123 into block@2: // for_body_L123 +debug: Replaced predecessor block@4: // for_increment_L123 with block@2: // for_body_L123 in block@1: // for_header_L123 +debug: Merged linear block@4: // for_increment_L123 into block@2: // for_body_L123 debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination @@ -1385,6 +1387,20 @@ debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.tuple_support.tuple_support.single_tuple +debug: Splitting parallel copies prior to optimization +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Simplified (== 1u 1u) to 1u +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tup#0 +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__ debug: Splitting parallel copies prior to optimization debug: Optimizer: Constant Replacer @@ -1463,8 +1479,8 @@ debug: Optimizer: Inner Txn Field Replacer debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks -debug: Not removing empty block block@2: // for_header_1_L124 because it's used by phi nodes -debug: Not removing empty block block@3: // for_header_2_L124 because it's used by phi nodes +debug: Not removing empty block block@2: // for_header_1_L131 because it's used by phi nodes +debug: Not removing empty block block@3: // for_header_2_L131 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.bytes_combine @@ -1576,6 +1592,18 @@ debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.tuple_support.tuple_support.single_tuple +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Removing unused variable tmp%0#0 +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation @@ -1638,8 +1666,8 @@ debug: Optimizer: Inner Txn Field Replacer debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks -debug: Not removing empty block block@2: // for_header_1_L124 because it's used by phi nodes -debug: Not removing empty block block@3: // for_header_2_L124 because it's used by phi nodes +debug: Not removing empty block block@2: // for_header_1_L131 because it's used by phi nodes +debug: Not removing empty block block@3: // for_header_2_L131 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.bytes_combine @@ -1732,6 +1760,17 @@ debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.tuple_support.tuple_support.single_tuple +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation @@ -1784,8 +1823,8 @@ debug: Optimizer: Inner Txn Field Replacer debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks -debug: Not removing empty block block@2: // for_header_1_L124 because it's used by phi nodes -debug: Not removing empty block block@3: // for_header_2_L124 because it's used by phi nodes +debug: Not removing empty block block@2: // for_header_1_L131 because it's used by phi nodes +debug: Not removing empty block block@3: // for_header_2_L131 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.bytes_combine @@ -1877,6 +1916,17 @@ debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.tuple_support.tuple_support.single_tuple +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation @@ -1925,8 +1975,8 @@ debug: Optimizer: Inner Txn Field Replacer debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks -debug: Not removing empty block block@2: // for_header_1_L124 because it's used by phi nodes -debug: Not removing empty block block@3: // for_header_2_L124 because it's used by phi nodes +debug: Not removing empty block block@2: // for_header_1_L131 because it's used by phi nodes +debug: Not removing empty block block@3: // for_header_2_L131 because it's used by phi nodes debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.bytes_combine @@ -2017,6 +2067,17 @@ debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks debug: Optimizer: Remove Unreachable Blocks debug: Optimizer: Repeated Expression Elimination +debug: Optimizing subroutine test_cases.tuple_support.tuple_support.single_tuple +debug: Optimizer: Constant Replacer +debug: Optimizer: Copy Propagation +debug: Optimizer: Intrinsic Simplifier +debug: Optimizer: Remove Unused Variables +debug: Optimizer: Inner Txn Field Replacer +debug: Optimizer: Simplify Control Ops +debug: Optimizer: Remove Linear Jump +debug: Optimizer: Remove Empty Blocks +debug: Optimizer: Remove Unreachable Blocks +debug: Optimizer: Repeated Expression Elimination debug: Optimizing subroutine test_cases.tuple_support.tuple_support.TupleSupport.__init__ debug: Optimizer: Constant Replacer debug: Optimizer: Copy Propagation @@ -2050,6 +2111,7 @@ debug: Removing Phis from test_cases.tuple_support.tuple_support.slicing debug: Removing Phis from test_cases.tuple_support.tuple_support.bin_ops debug: Removing Phis from test_cases.tuple_support.tuple_support.non_empty_tuple debug: Removing Phis from test_cases.tuple_support.tuple_support.get_uint_with_side_effect +debug: Removing Phis from test_cases.tuple_support.tuple_support.single_tuple debug: Removing Phis from test_cases.tuple_support.tuple_support.TupleSupport.__init__ debug: Removing Phis from test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program debug: Coalescing local variables in test_cases.tuple_support.tuple_support.TupleSupport.approval_program using strategy RootOperandGrouping @@ -2079,6 +2141,8 @@ debug: Coalescing local variables in test_cases.tuple_support.tuple_support.non_ debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in test_cases.tuple_support.tuple_support.get_uint_with_side_effect using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s +debug: Coalescing local variables in test_cases.tuple_support.tuple_support.single_tuple using strategy RootOperandGrouping +debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in test_cases.tuple_support.tuple_support.TupleSupport.__init__ using strategy RootOperandGrouping debug: Coalescing resulted in 0 replacement/s debug: Coalescing local variables in test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program using strategy RootOperandGrouping @@ -2153,6 +2217,7 @@ debug: Sequentializing parallel copies in test_cases.tuple_support.tuple_support debug: Sequentializing parallel copies in test_cases.tuple_support.tuple_support.bin_ops debug: Sequentializing parallel copies in test_cases.tuple_support.tuple_support.non_empty_tuple debug: Sequentializing parallel copies in test_cases.tuple_support.tuple_support.get_uint_with_side_effect +debug: Sequentializing parallel copies in test_cases.tuple_support.tuple_support.single_tuple debug: Sequentializing parallel copies in test_cases.tuple_support.tuple_support.TupleSupport.__init__ debug: Sequentializing parallel copies in test_cases.tuple_support.tuple_support.TupleSupport.clear_state_program debug: Performing post-SSA optimizations diff --git a/test_cases/tuple_support/tuple_support.py b/test_cases/tuple_support/tuple_support.py index 379c6f9cad..f6ec4a4385 100644 --- a/test_cases/tuple_support/tuple_support.py +++ b/test_cases/tuple_support/tuple_support.py @@ -56,12 +56,19 @@ def approval_program(self) -> UInt64: log("not empty") if (get_uint_with_side_effect(),): # noqa: F634 log("not empty2") + single_tuple() return a + b def clear_state_program(self) -> UInt64: return UInt64(0) +@subroutine +def single_tuple() -> None: + tup = (UInt64(1),) + assert tup[0] == 1 + + @subroutine def get_uint_with_side_effect() -> UInt64: log("get_uint_with_side_effect called")