diff --git a/examples/sizes.txt b/examples/sizes.txt index ed3fa68122..42e4ee83d7 100644 --- a/examples/sizes.txt +++ b/examples/sizes.txt @@ -69,7 +69,7 @@ state_totals 46 34 12 34 0 string_ops 157 152 5 152 0 stubs/BigUInt 172 112 60 112 0 - stubs/Bytes 1769 258 1511 258 0 + stubs/Bytes 1769 253 1516 253 0 stubs/String 777 141 636 141 0 stubs/Uint64 371 8 363 8 0 template_variables/TemplateVariables 168 155 13 155 0 diff --git a/src/puya/ir/optimize/intrinsic_simplification.py b/src/puya/ir/optimize/intrinsic_simplification.py index 83b7336af3..f7a44781f2 100644 --- a/src/puya/ir/optimize/intrinsic_simplification.py +++ b/src/puya/ir/optimize/intrinsic_simplification.py @@ -201,6 +201,9 @@ def _try_fold_intrinsic( selector_const = _get_int_constant(selector) if selector_const is not None: return true if selector_const else false + maybe_simplified_select_cond = _try_simplify_bool_condition(subroutine, selector) + if maybe_simplified_select_cond is not None: + return attrs.evolve(intrinsic, args=[false, true, maybe_simplified_select_cond]) elif intrinsic.op is AVMOp.getbit: match intrinsic.args: case [ diff --git a/test_cases/stubs/out/BytesContract.approval.mir b/test_cases/stubs/out/BytesContract.approval.mir index ff238b1c6a..41b15e2d46 100644 --- a/test_cases/stubs/out/BytesContract.approval.mir +++ b/test_cases/stubs/out/BytesContract.approval.mir @@ -102,13 +102,9 @@ check_slicing_with_uint64_block@0: // virtual: store tmp%73#0 to l-stack (no copy) (𝕡) abc#0 | tmp%1#0,tmp%73#0 one_to_seven()[one:-1] == b"23456" stubs/bytes.py:84 // virtual: load tmp%73#0 from l-stack (no copy) (𝕡) abc#0 | tmp%1#0,tmp%73#0 assert one_to_seven()[one:-1] == b"23456" stubs/bytes.py:84 assert // (𝕡) abc#0 | tmp%1#0 assert one_to_seven()[one:-1] == b"23456" stubs/bytes.py:84 - int 0 // (𝕡) abc#0 | tmp%1#0,0 0 stubs/bytes.py:85 - dig 1 // load tmp%1#0 from l-stack (copy) (𝕡) abc#0 | tmp%1#0,0,tmp%1#0 abc[UInt64(0) : ten] stubs/bytes.py:85 - < // (𝕡) abc#0 | tmp%1#0,{<} abc[UInt64(0) : ten] stubs/bytes.py:85 - swap // store tmp%78#0 to l-stack (no copy) (𝕡) abc#0 | tmp%78#0,tmp%1#0 abc[UInt64(0) : ten] stubs/bytes.py:85 - dup // load tmp%1#0 from l-stack (copy) (𝕡) abc#0 | tmp%78#0,tmp%1#0,tmp%1#0 abc[UInt64(0) : ten] stubs/bytes.py:85 - int 0 // (𝕡) abc#0 | tmp%78#0,tmp%1#0,tmp%1#0,0 0 stubs/bytes.py:85 - uncover 3 // load tmp%78#0 from l-stack (no copy) (𝕡) abc#0 | tmp%1#0,tmp%1#0,0,tmp%78#0 abc[UInt64(0) : ten] stubs/bytes.py:85 + dup // load tmp%1#0 from l-stack (copy) (𝕡) abc#0 | tmp%1#0,tmp%1#0 abc[UInt64(0) : ten] stubs/bytes.py:85 + int 0 // (𝕡) abc#0 | tmp%1#0,tmp%1#0,0 0 stubs/bytes.py:85 + dig 2 // load tmp%1#0 from l-stack (copy) (𝕡) abc#0 | tmp%1#0,tmp%1#0,0,tmp%1#0 abc[UInt64(0) : ten] stubs/bytes.py:85 select // (𝕡) abc#0 | tmp%1#0,{select} abc[UInt64(0) : ten] stubs/bytes.py:85 swap // store tmp%79#0 to l-stack (no copy) (𝕡) abc#0 | tmp%79#0,tmp%1#0 abc[UInt64(0) : ten] stubs/bytes.py:85 int 10 // (𝕡) abc#0 | tmp%79#0,tmp%1#0,10 10 stubs/bytes.py:80 diff --git a/test_cases/stubs/out/BytesContract.approval.teal b/test_cases/stubs/out/BytesContract.approval.teal index 574d4d7938..ceb4165d40 100644 --- a/test_cases/stubs/out/BytesContract.approval.teal +++ b/test_cases/stubs/out/BytesContract.approval.teal @@ -105,13 +105,9 @@ check_slicing_with_uint64: assert // stubs/bytes.py:85 // assert abc[UInt64(0) : ten] == b"abc" - int 0 - dig 1 - < - swap dup int 0 - uncover 3 + dig 2 select swap // stubs/bytes.py:80 diff --git a/test_cases/stubs/out/BytesContract.destructured.ir b/test_cases/stubs/out/BytesContract.destructured.ir index a2e775b1e3..7b93a9f17e 100644 --- a/test_cases/stubs/out/BytesContract.destructured.ir +++ b/test_cases/stubs/out/BytesContract.destructured.ir @@ -30,8 +30,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_1.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_1.ir index 0430a988ce..f4ef321547 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_1.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_1.ir @@ -327,8 +327,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_2.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_2.ir index de6cc72ff6..5b0313bc45 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_2.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_2.ir @@ -172,8 +172,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_3.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_3.ir index 11f3e90014..e7648789b3 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_3.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_3.ir @@ -112,8 +112,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_4.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_4.ir index d6e8ef1979..6bb051826d 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_4.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_4.ir @@ -76,8 +76,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_5.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_5.ir index cf7c0101cd..c6e5381df4 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_5.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_5.ir @@ -59,8 +59,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_6.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_6.ir index e1a000f6d4..864fbcddbc 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_6.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_6.ir @@ -49,8 +49,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_7.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_7.ir index effde36887..991a5e8acb 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_7.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_7.ir @@ -41,8 +41,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_8.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_8.ir index d6b923f024..160dc19c64 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_8.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_8.ir @@ -36,8 +36,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/BytesContract.ssa.opt_pass_9.ir b/test_cases/stubs/out/BytesContract.ssa.opt_pass_9.ir index a2e775b1e3..7b93a9f17e 100644 --- a/test_cases/stubs/out/BytesContract.ssa.opt_pass_9.ir +++ b/test_cases/stubs/out/BytesContract.ssa.opt_pass_9.ir @@ -30,8 +30,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/out/bytes.O1.log b/test_cases/stubs/out/bytes.O1.log index fb9bd07f83..17e250965a 100644 --- a/test_cases/stubs/out/bytes.O1.log +++ b/test_cases/stubs/out/bytes.O1.log @@ -36,11 +36,11 @@ PC Teal Stack 72 == "abc", 3, 1 73 assert "abc", 3 74 callsub one_to_seven "abc", 3 -142 proto 0 1 "abc", 3 -145 byte "one_to_seven called" "abc", 3, "one_to_seven called" -166 log "abc", 3 -167 byte "1234567" "abc", 3, "1234567" -176 retsub "abc", 3, "1234567" +137 proto 0 1 "abc", 3 +140 byte "one_to_seven called" "abc", 3, "one_to_seven called" +161 log "abc", 3 +162 byte "1234567" "abc", 3, "1234567" +171 retsub "abc", 3, "1234567" 77 dup "abc", 3, "1234567", "1234567" 78 len "abc", 3, "1234567", 7 79 int 1 "abc", 3, "1234567", 7, 1 @@ -63,92 +63,88 @@ PC Teal Stack 100 byte "23456" "abc", 3, "23456", "23456" 107 == "abc", 3, 1 108 assert "abc", 3 -109 int 0 "abc", 3, 0 -110 dig 1 "abc", 3, 0, 3 -112 < "abc", 3, 1 -113 swap "abc", 1, 3 -114 dup "abc", 1, 3, 3 -115 int 0 "abc", 1, 3, 3, 0 -116 uncover 3 "abc", 3, 3, 0, 1 -118 select "abc", 3, 0 -119 swap "abc", 0, 3 -120 int 10 "abc", 0, 3, 10 -121 dig 1 "abc", 0, 3, 10, 3 -123 < "abc", 0, 3, 0 -124 int 10 "abc", 0, 3, 0, 10 -125 swap "abc", 0, 3, 10, 0 -126 select "abc", 0, 3 -127 dup2 "abc", 0, 3, 0, 3 -128 > "abc", 0, 3, 0 -129 dig 2 "abc", 0, 3, 0, 0 -131 swap "abc", 0, 3, 0, 0 -132 select "abc", 0, 3 -133 frame_dig -1 "abc", 0, 3, "abc" -135 cover 2 "abc", "abc", 0, 3 -137 substring3 "abc", "abc" -138 byte "abc" "abc", "abc", "abc" -139 == "abc", 1 -140 assert "abc" -141 retsub +109 dup "abc", 3, 3 +110 int 0 "abc", 3, 3, 0 +111 dig 2 "abc", 3, 3, 0, 3 +113 select "abc", 3, 0 +114 swap "abc", 0, 3 +115 int 10 "abc", 0, 3, 10 +116 dig 1 "abc", 0, 3, 10, 3 +118 < "abc", 0, 3, 0 +119 int 10 "abc", 0, 3, 0, 10 +120 swap "abc", 0, 3, 10, 0 +121 select "abc", 0, 3 +122 dup2 "abc", 0, 3, 0, 3 +123 > "abc", 0, 3, 0 +124 dig 2 "abc", 0, 3, 0, 0 +126 swap "abc", 0, 3, 0, 0 +127 select "abc", 0, 3 +128 frame_dig -1 "abc", 0, 3, "abc" +130 cover 2 "abc", "abc", 0, 3 +132 substring3 "abc", "abc" +133 byte "abc" "abc", "abc", "abc" +134 == "abc", 1 +135 assert "abc" +136 retsub 18 byte "abc" "abc" 19 callsub check_end_before_start_slicing "abc" -177 proto 1 0 "abc" -180 frame_dig -1 "abc", "abc" -182 len "abc", 3 -183 int 10 "abc", 3, 10 -184 dig 1 "abc", 3, 10, 3 -186 < "abc", 3, 0 -187 swap "abc", 0, 3 -188 dup "abc", 0, 3, 3 -189 int 10 "abc", 0, 3, 3, 10 -190 uncover 3 "abc", 3, 3, 10, 0 -192 select "abc", 3, 3 -193 swap "abc", 3, 3 -194 int 1 "abc", 3, 3, 1 -195 dig 1 "abc", 3, 3, 1, 3 -197 < "abc", 3, 3, 1 -198 swap "abc", 3, 1, 3 -199 dup "abc", 3, 1, 3, 3 -200 int 1 "abc", 3, 1, 3, 3, 1 -201 uncover 3 "abc", 3, 3, 3, 1, 1 -203 select "abc", 3, 3, 1 -204 dig 2 "abc", 3, 3, 1, 3 -206 dig 1 "abc", 3, 3, 1, 3, 1 -208 > "abc", 3, 3, 1, 1 -209 dig 3 "abc", 3, 3, 1, 1, 3 -211 swap "abc", 3, 3, 1, 3, 1 -212 select "abc", 3, 3, 3 -213 frame_dig -1 "abc", 3, 3, 3, "abc" -215 dig 3 "abc", 3, 3, 3, "abc", 3 -217 uncover 2 "abc", 3, 3, "abc", 3, 3 -219 substring3 "abc", 3, 3, 0x -220 byte "" "abc", 3, 3, 0x, 0x -221 == "abc", 3, 3, 1 -222 assert "abc", 3, 3 -223 dup "abc", 3, 3, 3 -224 uncover 2 "abc", 3, 3, 3 -226 - "abc", 3, 0 -227 swap "abc", 0, 3 -228 int 12 "abc", 0, 3, 12 -229 dig 1 "abc", 0, 3, 12, 3 -231 < "abc", 0, 3, 0 -232 swap "abc", 0, 0, 3 -233 dup "abc", 0, 0, 3, 3 -234 int 12 "abc", 0, 0, 3, 3, 12 -235 uncover 3 "abc", 0, 3, 3, 12, 0 -237 select "abc", 0, 3, 3 -238 - "abc", 0, 0 -239 dup2 "abc", 0, 0, 0, 0 -240 > "abc", 0, 0, 0 -241 dig 2 "abc", 0, 0, 0, 0 -243 swap "abc", 0, 0, 0, 0 -244 select "abc", 0, 0 -245 frame_dig -1 "abc", 0, 0, "abc" -247 cover 2 "abc", "abc", 0, 0 -249 substring3 "abc", 0x -250 byte "" "abc", 0x, 0x -251 == "abc", 1 -252 assert "abc" -253 retsub +172 proto 1 0 "abc" +175 frame_dig -1 "abc", "abc" +177 len "abc", 3 +178 int 10 "abc", 3, 10 +179 dig 1 "abc", 3, 10, 3 +181 < "abc", 3, 0 +182 swap "abc", 0, 3 +183 dup "abc", 0, 3, 3 +184 int 10 "abc", 0, 3, 3, 10 +185 uncover 3 "abc", 3, 3, 10, 0 +187 select "abc", 3, 3 +188 swap "abc", 3, 3 +189 int 1 "abc", 3, 3, 1 +190 dig 1 "abc", 3, 3, 1, 3 +192 < "abc", 3, 3, 1 +193 swap "abc", 3, 1, 3 +194 dup "abc", 3, 1, 3, 3 +195 int 1 "abc", 3, 1, 3, 3, 1 +196 uncover 3 "abc", 3, 3, 3, 1, 1 +198 select "abc", 3, 3, 1 +199 dig 2 "abc", 3, 3, 1, 3 +201 dig 1 "abc", 3, 3, 1, 3, 1 +203 > "abc", 3, 3, 1, 1 +204 dig 3 "abc", 3, 3, 1, 1, 3 +206 swap "abc", 3, 3, 1, 3, 1 +207 select "abc", 3, 3, 3 +208 frame_dig -1 "abc", 3, 3, 3, "abc" +210 dig 3 "abc", 3, 3, 3, "abc", 3 +212 uncover 2 "abc", 3, 3, "abc", 3, 3 +214 substring3 "abc", 3, 3, 0x +215 byte "" "abc", 3, 3, 0x, 0x +216 == "abc", 3, 3, 1 +217 assert "abc", 3, 3 +218 dup "abc", 3, 3, 3 +219 uncover 2 "abc", 3, 3, 3 +221 - "abc", 3, 0 +222 swap "abc", 0, 3 +223 int 12 "abc", 0, 3, 12 +224 dig 1 "abc", 0, 3, 12, 3 +226 < "abc", 0, 3, 0 +227 swap "abc", 0, 0, 3 +228 dup "abc", 0, 0, 3, 3 +229 int 12 "abc", 0, 0, 3, 3, 12 +230 uncover 3 "abc", 0, 3, 3, 12, 0 +232 select "abc", 0, 3, 3 +233 - "abc", 0, 0 +234 dup2 "abc", 0, 0, 0, 0 +235 > "abc", 0, 0, 0 +236 dig 2 "abc", 0, 0, 0, 0 +238 swap "abc", 0, 0, 0, 0 +239 select "abc", 0, 0 +240 frame_dig -1 "abc", 0, 0, "abc" +242 cover 2 "abc", "abc", 0, 0 +244 substring3 "abc", 0x +245 byte "" "abc", 0x, 0x +246 == "abc", 1 +247 assert "abc" +248 retsub 22 int 1 1 23 return 1 \ No newline at end of file diff --git a/test_cases/stubs/out/bytes.O2.log b/test_cases/stubs/out/bytes.O2.log index fb9bd07f83..17e250965a 100644 --- a/test_cases/stubs/out/bytes.O2.log +++ b/test_cases/stubs/out/bytes.O2.log @@ -36,11 +36,11 @@ PC Teal Stack 72 == "abc", 3, 1 73 assert "abc", 3 74 callsub one_to_seven "abc", 3 -142 proto 0 1 "abc", 3 -145 byte "one_to_seven called" "abc", 3, "one_to_seven called" -166 log "abc", 3 -167 byte "1234567" "abc", 3, "1234567" -176 retsub "abc", 3, "1234567" +137 proto 0 1 "abc", 3 +140 byte "one_to_seven called" "abc", 3, "one_to_seven called" +161 log "abc", 3 +162 byte "1234567" "abc", 3, "1234567" +171 retsub "abc", 3, "1234567" 77 dup "abc", 3, "1234567", "1234567" 78 len "abc", 3, "1234567", 7 79 int 1 "abc", 3, "1234567", 7, 1 @@ -63,92 +63,88 @@ PC Teal Stack 100 byte "23456" "abc", 3, "23456", "23456" 107 == "abc", 3, 1 108 assert "abc", 3 -109 int 0 "abc", 3, 0 -110 dig 1 "abc", 3, 0, 3 -112 < "abc", 3, 1 -113 swap "abc", 1, 3 -114 dup "abc", 1, 3, 3 -115 int 0 "abc", 1, 3, 3, 0 -116 uncover 3 "abc", 3, 3, 0, 1 -118 select "abc", 3, 0 -119 swap "abc", 0, 3 -120 int 10 "abc", 0, 3, 10 -121 dig 1 "abc", 0, 3, 10, 3 -123 < "abc", 0, 3, 0 -124 int 10 "abc", 0, 3, 0, 10 -125 swap "abc", 0, 3, 10, 0 -126 select "abc", 0, 3 -127 dup2 "abc", 0, 3, 0, 3 -128 > "abc", 0, 3, 0 -129 dig 2 "abc", 0, 3, 0, 0 -131 swap "abc", 0, 3, 0, 0 -132 select "abc", 0, 3 -133 frame_dig -1 "abc", 0, 3, "abc" -135 cover 2 "abc", "abc", 0, 3 -137 substring3 "abc", "abc" -138 byte "abc" "abc", "abc", "abc" -139 == "abc", 1 -140 assert "abc" -141 retsub +109 dup "abc", 3, 3 +110 int 0 "abc", 3, 3, 0 +111 dig 2 "abc", 3, 3, 0, 3 +113 select "abc", 3, 0 +114 swap "abc", 0, 3 +115 int 10 "abc", 0, 3, 10 +116 dig 1 "abc", 0, 3, 10, 3 +118 < "abc", 0, 3, 0 +119 int 10 "abc", 0, 3, 0, 10 +120 swap "abc", 0, 3, 10, 0 +121 select "abc", 0, 3 +122 dup2 "abc", 0, 3, 0, 3 +123 > "abc", 0, 3, 0 +124 dig 2 "abc", 0, 3, 0, 0 +126 swap "abc", 0, 3, 0, 0 +127 select "abc", 0, 3 +128 frame_dig -1 "abc", 0, 3, "abc" +130 cover 2 "abc", "abc", 0, 3 +132 substring3 "abc", "abc" +133 byte "abc" "abc", "abc", "abc" +134 == "abc", 1 +135 assert "abc" +136 retsub 18 byte "abc" "abc" 19 callsub check_end_before_start_slicing "abc" -177 proto 1 0 "abc" -180 frame_dig -1 "abc", "abc" -182 len "abc", 3 -183 int 10 "abc", 3, 10 -184 dig 1 "abc", 3, 10, 3 -186 < "abc", 3, 0 -187 swap "abc", 0, 3 -188 dup "abc", 0, 3, 3 -189 int 10 "abc", 0, 3, 3, 10 -190 uncover 3 "abc", 3, 3, 10, 0 -192 select "abc", 3, 3 -193 swap "abc", 3, 3 -194 int 1 "abc", 3, 3, 1 -195 dig 1 "abc", 3, 3, 1, 3 -197 < "abc", 3, 3, 1 -198 swap "abc", 3, 1, 3 -199 dup "abc", 3, 1, 3, 3 -200 int 1 "abc", 3, 1, 3, 3, 1 -201 uncover 3 "abc", 3, 3, 3, 1, 1 -203 select "abc", 3, 3, 1 -204 dig 2 "abc", 3, 3, 1, 3 -206 dig 1 "abc", 3, 3, 1, 3, 1 -208 > "abc", 3, 3, 1, 1 -209 dig 3 "abc", 3, 3, 1, 1, 3 -211 swap "abc", 3, 3, 1, 3, 1 -212 select "abc", 3, 3, 3 -213 frame_dig -1 "abc", 3, 3, 3, "abc" -215 dig 3 "abc", 3, 3, 3, "abc", 3 -217 uncover 2 "abc", 3, 3, "abc", 3, 3 -219 substring3 "abc", 3, 3, 0x -220 byte "" "abc", 3, 3, 0x, 0x -221 == "abc", 3, 3, 1 -222 assert "abc", 3, 3 -223 dup "abc", 3, 3, 3 -224 uncover 2 "abc", 3, 3, 3 -226 - "abc", 3, 0 -227 swap "abc", 0, 3 -228 int 12 "abc", 0, 3, 12 -229 dig 1 "abc", 0, 3, 12, 3 -231 < "abc", 0, 3, 0 -232 swap "abc", 0, 0, 3 -233 dup "abc", 0, 0, 3, 3 -234 int 12 "abc", 0, 0, 3, 3, 12 -235 uncover 3 "abc", 0, 3, 3, 12, 0 -237 select "abc", 0, 3, 3 -238 - "abc", 0, 0 -239 dup2 "abc", 0, 0, 0, 0 -240 > "abc", 0, 0, 0 -241 dig 2 "abc", 0, 0, 0, 0 -243 swap "abc", 0, 0, 0, 0 -244 select "abc", 0, 0 -245 frame_dig -1 "abc", 0, 0, "abc" -247 cover 2 "abc", "abc", 0, 0 -249 substring3 "abc", 0x -250 byte "" "abc", 0x, 0x -251 == "abc", 1 -252 assert "abc" -253 retsub +172 proto 1 0 "abc" +175 frame_dig -1 "abc", "abc" +177 len "abc", 3 +178 int 10 "abc", 3, 10 +179 dig 1 "abc", 3, 10, 3 +181 < "abc", 3, 0 +182 swap "abc", 0, 3 +183 dup "abc", 0, 3, 3 +184 int 10 "abc", 0, 3, 3, 10 +185 uncover 3 "abc", 3, 3, 10, 0 +187 select "abc", 3, 3 +188 swap "abc", 3, 3 +189 int 1 "abc", 3, 3, 1 +190 dig 1 "abc", 3, 3, 1, 3 +192 < "abc", 3, 3, 1 +193 swap "abc", 3, 1, 3 +194 dup "abc", 3, 1, 3, 3 +195 int 1 "abc", 3, 1, 3, 3, 1 +196 uncover 3 "abc", 3, 3, 3, 1, 1 +198 select "abc", 3, 3, 1 +199 dig 2 "abc", 3, 3, 1, 3 +201 dig 1 "abc", 3, 3, 1, 3, 1 +203 > "abc", 3, 3, 1, 1 +204 dig 3 "abc", 3, 3, 1, 1, 3 +206 swap "abc", 3, 3, 1, 3, 1 +207 select "abc", 3, 3, 3 +208 frame_dig -1 "abc", 3, 3, 3, "abc" +210 dig 3 "abc", 3, 3, 3, "abc", 3 +212 uncover 2 "abc", 3, 3, "abc", 3, 3 +214 substring3 "abc", 3, 3, 0x +215 byte "" "abc", 3, 3, 0x, 0x +216 == "abc", 3, 3, 1 +217 assert "abc", 3, 3 +218 dup "abc", 3, 3, 3 +219 uncover 2 "abc", 3, 3, 3 +221 - "abc", 3, 0 +222 swap "abc", 0, 3 +223 int 12 "abc", 0, 3, 12 +224 dig 1 "abc", 0, 3, 12, 3 +226 < "abc", 0, 3, 0 +227 swap "abc", 0, 0, 3 +228 dup "abc", 0, 0, 3, 3 +229 int 12 "abc", 0, 0, 3, 3, 12 +230 uncover 3 "abc", 0, 3, 3, 12, 0 +232 select "abc", 0, 3, 3 +233 - "abc", 0, 0 +234 dup2 "abc", 0, 0, 0, 0 +235 > "abc", 0, 0, 0 +236 dig 2 "abc", 0, 0, 0, 0 +238 swap "abc", 0, 0, 0, 0 +239 select "abc", 0, 0 +240 frame_dig -1 "abc", 0, 0, "abc" +242 cover 2 "abc", "abc", 0, 0 +244 substring3 "abc", 0x +245 byte "" "abc", 0x, 0x +246 == "abc", 1 +247 assert "abc" +248 retsub 22 int 1 1 23 return 1 \ No newline at end of file diff --git a/test_cases/stubs/out_O2/BytesContract.approval.teal b/test_cases/stubs/out_O2/BytesContract.approval.teal index d705f8d4a4..adc232ac5c 100644 --- a/test_cases/stubs/out_O2/BytesContract.approval.teal +++ b/test_cases/stubs/out_O2/BytesContract.approval.teal @@ -66,13 +66,9 @@ check_slicing_with_uint64: byte "23456" == assert - int 0 - dig 1 - < - swap dup int 0 - uncover 3 + dig 2 select swap int 10 diff --git a/test_cases/stubs/out_O2/BytesContract.destructured.ir b/test_cases/stubs/out_O2/BytesContract.destructured.ir index a2e775b1e3..7b93a9f17e 100644 --- a/test_cases/stubs/out_O2/BytesContract.destructured.ir +++ b/test_cases/stubs/out_O2/BytesContract.destructured.ir @@ -30,8 +30,7 @@ contract test_cases.stubs.bytes.BytesContract: let tmp%72#0: bytes = (substring3 awst_tmp%44#0 tmp%49#0 tmp%71#0) let tmp%73#0: uint64 = (== tmp%72#0 "23456") (assert tmp%73#0) - let tmp%78#0: uint64 = (< 0u tmp%1#0) - let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%78#0) + let tmp%79#0: uint64 = (select tmp%1#0 0u tmp%1#0) let tmp%83#0: uint64 = (< 10u tmp%1#0) let tmp%84#0: uint64 = (select tmp%1#0 10u tmp%83#0) let tmp%97#0: uint64 = (> tmp%79#0 tmp%84#0) diff --git a/test_cases/stubs/puya.log b/test_cases/stubs/puya.log index 3d28600b3a..204ac77452 100644 --- a/test_cases/stubs/puya.log +++ b/test_cases/stubs/puya.log @@ -1418,6 +1418,9 @@ debug: Optimizer: Copy Propagation debug: Found equivalence set: abc#0, awst_tmp%0#0, awst_tmp%9#0, awst_tmp%36#0, awst_tmp%74#0 debug: Replacing {awst_tmp%0#0, awst_tmp%9#0, awst_tmp%36#0, awst_tmp%74#0} with abc#0 made 29 modifications debug: Optimizer: Intrinsic Simplifier +debug: Simplified (select tmp%75#0 0u tmp%78#0) to (select tmp%75#0 0u tmp%77#0) +debug: Simplified (select tmp%85#0 0u tmp%87#0) to (select tmp%85#0 0u tmp%86#0) +debug: Simplified (select tmp%89#0 0u tmp%91#0) to (select tmp%89#0 0u tmp%90#0) debug: Optimizer: Remove Unused Variables debug: Removing unused variable one#0 debug: Removing unused variable ten#0 @@ -1427,7 +1430,10 @@ debug: Removing unused variable awst_tmp%16#0 debug: Removing unused variable awst_tmp%38#0 debug: Removing unused variable awst_tmp%46#0 debug: Removing unused variable awst_tmp%76#0 +debug: Removing unused variable tmp%78#0 debug: Removing unused variable awst_tmp%81#0 +debug: Removing unused variable tmp%87#0 +debug: Removing unused variable tmp%91#0 debug: Optimizer: Simplify Control Ops debug: Optimizer: Remove Linear Jump debug: Optimizer: Remove Empty Blocks @@ -1482,15 +1488,15 @@ debug: Replacing redundant declaration let tmp%53#0: uint64 = (< 1u tmp%45#0) wi debug: Replacing redundant declaration let tmp%58#0: uint64 = (< 1u tmp%45#0) with copy of existing registers [Register(atype=uint64, name='tmp%48', version=0, source_location=stubs/bytes.py:84:11-33)] debug: Replacing redundant declaration let tmp%62#0: uint64 = (< 1u tmp%45#0) with copy of existing registers [Register(atype=uint64, name='tmp%48', version=0, source_location=stubs/bytes.py:84:11-33)] debug: Replacing redundant declaration let tmp%67#0: uint64 = (< 1u tmp%45#0) with copy of existing registers [Register(atype=uint64, name='tmp%48', version=0, source_location=stubs/bytes.py:84:11-33)] -debug: Replacing redundant declaration let tmp%87#0: uint64 = (< 0u tmp%1#0) with copy of existing registers [Register(atype=uint64, name='tmp%78', version=0, source_location=stubs/bytes.py:85:11-31)] -debug: Replacing redundant declaration let tmp%91#0: uint64 = (< 0u tmp%1#0) with copy of existing registers [Register(atype=uint64, name='tmp%78', version=0, source_location=stubs/bytes.py:85:11-31)] +debug: Replacing redundant declaration let tmp%88#0: uint64 = (select tmp%1#0 0u tmp%1#0) with copy of existing registers [Register(atype=uint64, name='tmp%79', version=0, source_location=stubs/bytes.py:85:11-31)] +debug: Replacing redundant declaration let tmp%92#0: uint64 = (select tmp%1#0 0u tmp%1#0) with copy of existing registers [Register(atype=uint64, name='tmp%79', version=0, source_location=stubs/bytes.py:85:11-31)] debug: Replacing redundant declaration let tmp%95#0: uint64 = (< 10u tmp%1#0) with copy of existing registers [Register(atype=uint64, name='tmp%83', version=0, source_location=stubs/bytes.py:85:11-31)] debug: Found equivalence set: tmp%4#0, tmp%13#0, tmp%18#0, tmp%22#0, tmp%26#0, tmp%30#0, tmp%40#0 debug: Replacing {tmp%13#0, tmp%18#0, tmp%22#0, tmp%26#0, tmp%30#0, tmp%40#0} with tmp%4#0 made 6 modifications debug: Found equivalence set: tmp%48#0, tmp%53#0, tmp%58#0, tmp%62#0, tmp%67#0 debug: Replacing {tmp%53#0, tmp%58#0, tmp%62#0, tmp%67#0} with tmp%48#0 made 4 modifications -debug: Found equivalence set: tmp%78#0, tmp%87#0, tmp%91#0 -debug: Replacing {tmp%87#0, tmp%91#0} with tmp%78#0 made 2 modifications +debug: Found equivalence set: tmp%79#0, tmp%88#0, tmp%92#0 +debug: Replacing {tmp%88#0, tmp%92#0} with tmp%79#0 made 2 modifications debug: Found equivalence set: tmp%83#0, tmp%95#0 debug: Replacing {tmp%95#0} with tmp%83#0 made 1 modifications debug: Replacing redundant declaration let tmp%14#0: uint64 = (select tmp%1#0 1u tmp%4#0) with copy of existing registers [Register(atype=uint64, name='tmp%5', version=0, source_location=stubs/bytes.py:81:11-20)] @@ -1503,15 +1509,11 @@ debug: Replacing redundant declaration let tmp%54#0: uint64 = (select tmp%45#0 1 debug: Replacing redundant declaration let tmp%59#0: uint64 = (select tmp%45#0 1u tmp%48#0) with copy of existing registers [Register(atype=uint64, name='tmp%49', version=0, source_location=stubs/bytes.py:84:11-33)] debug: Replacing redundant declaration let tmp%63#0: uint64 = (select tmp%45#0 1u tmp%48#0) with copy of existing registers [Register(atype=uint64, name='tmp%49', version=0, source_location=stubs/bytes.py:84:11-33)] debug: Replacing redundant declaration let tmp%68#0: uint64 = (select tmp%45#0 1u tmp%48#0) with copy of existing registers [Register(atype=uint64, name='tmp%49', version=0, source_location=stubs/bytes.py:84:11-33)] -debug: Replacing redundant declaration let tmp%88#0: uint64 = (select tmp%1#0 0u tmp%78#0) with copy of existing registers [Register(atype=uint64, name='tmp%79', version=0, source_location=stubs/bytes.py:85:11-31)] -debug: Replacing redundant declaration let tmp%92#0: uint64 = (select tmp%1#0 0u tmp%78#0) with copy of existing registers [Register(atype=uint64, name='tmp%79', version=0, source_location=stubs/bytes.py:85:11-31)] debug: Replacing redundant declaration let tmp%96#0: uint64 = (select tmp%1#0 10u tmp%83#0) with copy of existing registers [Register(atype=uint64, name='tmp%84', version=0, source_location=stubs/bytes.py:85:11-31)] debug: Found equivalence set: tmp%5#0, tmp%14#0, tmp%19#0, tmp%23#0, tmp%27#0, tmp%31#0, tmp%41#0 debug: Replacing {tmp%14#0, tmp%19#0, tmp%23#0, tmp%27#0, tmp%31#0, tmp%41#0} with tmp%5#0 made 6 modifications debug: Found equivalence set: tmp%49#0, tmp%54#0, tmp%59#0, tmp%63#0, tmp%68#0 debug: Replacing {tmp%54#0, tmp%59#0, tmp%63#0, tmp%68#0} with tmp%49#0 made 4 modifications -debug: Found equivalence set: tmp%79#0, tmp%88#0, tmp%92#0 -debug: Replacing {tmp%88#0, tmp%92#0} with tmp%79#0 made 2 modifications debug: Found equivalence set: tmp%84#0, tmp%96#0 debug: Replacing {tmp%96#0} with tmp%84#0 made 1 modifications debug: Replacing redundant declaration let tmp%69#0: uint64 = (- tmp%45#0 tmp%49#0) with copy of existing registers [Register(atype=uint64, name='tmp%55', version=0, source_location=stubs/bytes.py:84:11-33)] @@ -2539,10 +2541,10 @@ debug: Inserted check_slicing_with_uint64_block@0.ops[84]: 'store tmp%72#0 to l- debug: Replaced check_slicing_with_uint64_block@0.ops[86]: 'load tmp%72#0' with 'load tmp%72#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[89]: 'store tmp%73#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[91]: 'load tmp%73#0' with 'load tmp%73#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[124]: 'store tmp%99#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[126]: 'load tmp%99#0' with 'load tmp%99#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[129]: 'store tmp%100#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[131]: 'load tmp%100#0' with 'load tmp%100#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[120]: 'store tmp%99#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[122]: 'load tmp%99#0' with 'load tmp%99#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[125]: 'store tmp%100#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[127]: 'load tmp%100#0' with 'load tmp%100#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[2]: 'store tmp%1#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[5]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[12]: 'store tmp%5#0 to l-stack (copy)' @@ -2553,8 +2555,10 @@ debug: Inserted check_slicing_with_uint64_block@0.ops[69]: 'store tmp%49#0 to l- debug: Replaced check_slicing_with_uint64_block@0.ops[72]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[74]: 'store tmp%55#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[77]: 'load tmp%55#0' with 'load tmp%55#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[115]: 'store tmp%84#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[118]: 'load tmp%84#0' with 'load tmp%84#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[99]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[101]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[112]: 'store tmp%84#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[115]: 'load tmp%84#0' with 'load tmp%84#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[6]: 'store tmp%1#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[9]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[8]: 'store tmp%4#0 to l-stack (copy)' @@ -2571,36 +2575,32 @@ debug: Inserted check_slicing_with_uint64_block@0.ops[85]: 'store tmp%70#0 to l- debug: Replaced check_slicing_with_uint64_block@0.ops[89]: 'load tmp%70#0' with 'load tmp%70#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[91]: 'store tmp%71#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[95]: 'load tmp%71#0' with 'load tmp%71#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[108]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[111]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[110]: 'store tmp%78#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[114]: 'load tmp%78#0' with 'load tmp%78#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[119]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[122]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[121]: 'store tmp%83#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[125]: 'load tmp%83#0' with 'load tmp%83#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[131]: 'store tmp%84#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[134]: 'load tmp%84#0' with 'load tmp%84#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[133]: 'store tmp%97#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[137]: 'load tmp%97#0' with 'load tmp%97#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[139]: 'store tmp%98#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[143]: 'load tmp%98#0' with 'load tmp%98#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[114]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[117]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[116]: 'store tmp%83#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[120]: 'load tmp%83#0' with 'load tmp%83#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[126]: 'store tmp%84#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[129]: 'load tmp%84#0' with 'load tmp%84#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[128]: 'store tmp%97#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[132]: 'load tmp%97#0' with 'load tmp%97#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[134]: 'store tmp%98#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[138]: 'load tmp%98#0' with 'load tmp%98#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[110]: 'store tmp%1#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[114]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[70]: 'store tmp%45#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[76]: 'load tmp%45#0' with 'load tmp%45#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[83]: 'store tmp%49#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[90]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[91]: 'store tmp%49#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[97]: 'load tmp%49#0' with 'load tmp%49#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[133]: 'store tmp%79#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[140]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[141]: 'store tmp%79#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[147]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[116]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[122]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[129]: 'store tmp%79#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[136]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[137]: 'store tmp%79#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[143]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[11]: 'store tmp%1#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[19]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' -debug: Inserted check_slicing_with_uint64_block@0.ops[121]: 'store tmp%79#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[135]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' +debug: Inserted check_slicing_with_uint64_block@0.ops[116]: 'store tmp%79#0 to l-stack (copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[130]: 'load tmp%79#0' with 'load tmp%79#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[19]: 'store tmp%5#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[32]: 'load tmp%5#0' with 'load tmp%5#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[35]: 'store tmp%5#0 to l-stack (copy)' @@ -2608,7 +2608,7 @@ debug: Replaced check_slicing_with_uint64_block@0.ops[48]: 'load tmp%5#0' with ' debug: Inserted check_slicing_with_uint64_block@0.ops[63]: 'store awst_tmp%44#0 to l-stack (copy)' debug: Replaced check_slicing_with_uint64_block@0.ops[100]: 'load awst_tmp%44#0' with 'load awst_tmp%44#0 from l-stack (no copy)' debug: Inserted check_slicing_with_uint64_block@0.ops[21]: 'store tmp%1#0 to l-stack (copy)' -debug: Replaced check_slicing_with_uint64_block@0.ops[115]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' +debug: Replaced check_slicing_with_uint64_block@0.ops[114]: 'load tmp%1#0' with 'load tmp%1#0 from l-stack (no copy)' debug: Inserted check_end_before_start_slicing_block@0.ops[34]: 'store tmp%23#0 to l-stack (copy)' debug: Replaced check_end_before_start_slicing_block@0.ops[36]: 'load tmp%23#0' with 'load tmp%23#0 from l-stack (no copy)' debug: Inserted check_end_before_start_slicing_block@0.ops[39]: 'store tmp%24#0 to l-stack (copy)'