diff options
Diffstat (limited to 'test/passes/asyncify.txt')
-rw-r--r-- | test/passes/asyncify.txt | 1021 |
1 files changed, 385 insertions, 636 deletions
diff --git a/test/passes/asyncify.txt b/test/passes/asyncify.txt index f19b764fa..3c121c029 100644 --- a/test/passes/asyncify.txt +++ b/test/passes/asyncify.txt @@ -12,44 +12,31 @@ (func $do_sleep (; 0 ;) (local $0 i32) (local $1 i32) - (block - (local.set $0 - (global.get $sleeping) + (local.set $0 + (global.get $sleeping) + ) + (local.set $1 + (i32.eqz + (local.get $0) ) - (local.set $1 - (i32.eqz - (local.get $0) + ) + (if + (local.get $1) + (block $block + (global.set $sleeping + (i32.const 1) ) - ) - (if - (local.get $1) - (block - (block $block - (global.set $sleeping - (i32.const 1) - ) - (nop) - (call $asyncify_start_unwind - (i32.const 4) - ) - (nop) - ) - (nop) + (call $asyncify_start_unwind + (i32.const 4) ) - (block - (block $block0 - (global.set $sleeping - (i32.const 0) - ) - (nop) - (call $asyncify_stop_rewind) - (nop) - ) - (nop) + ) + (block $block0 + (global.set $sleeping + (i32.const 0) ) + (call $asyncify_stop_rewind) ) ) - (nop) ) (func $work (; 1 ;) (local $0 i32) @@ -90,63 +77,44 @@ ) ) (block - (block - (if + (if + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (call $stuff) + ) + (if + (if (result i32) (i32.eq (global.get $__asyncify_state) (i32.const 0) ) - (block - (call $stuff) - (nop) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 0) ) ) - (nop) - (if - (if (result i32) + (block + (call $do_sleep) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $1) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $do_sleep) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (block - (nop) - (call $stuff) - (nop) - ) ) - (nop) - (nop) ) (if (i32.eq (global.get $__asyncify_state) (i32.const 0) ) - (nop) + (call $stuff) ) ) ) @@ -214,38 +182,29 @@ ) ) ) - (block - (if - (if (result i32) + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 0) + ) + ) + (block + (call $work) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $1) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $work) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) ) @@ -273,28 +232,16 @@ (nop) ) (func $second_event (; 4 ;) - (block - (call $asyncify_stop_unwind) - (nop) - (call $asyncify_start_rewind - (i32.const 4) - ) - (nop) - (call $work) - (nop) + (call $asyncify_stop_unwind) + (call $asyncify_start_rewind + (i32.const 4) ) - (nop) + (call $work) ) (func $never_sleep (; 5 ;) - (block - (call $stuff) - (nop) - (call $stuff) - (nop) - (call $stuff) - (nop) - ) - (nop) + (call $stuff) + (call $stuff) + (call $stuff) ) (func $asyncify_start_unwind (; 6 ;) (param $0 i32) (global.set $__asyncify_state @@ -420,38 +367,29 @@ ) ) ) - (block - (if - (if (result i32) + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 0) + ) + ) + (block + (call $import) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $1) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $import) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) ) @@ -604,7 +542,6 @@ (local.set $temp (local.get $1) ) - (nop) (local.set $2 (local.get $temp) ) @@ -615,7 +552,6 @@ ) (nop) (nop) - (nop) ) (unreachable) ) @@ -776,14 +712,10 @@ (global.get $__asyncify_state) (i32.const 0) ) - (block - (drop - (local.get $0) - ) - (nop) + (drop + (local.get $0) ) ) - (nop) ) ) (return) @@ -838,7 +770,6 @@ (drop (local.get $0) ) - (nop) ) (func $many-locals (; 7 ;) (param $x i32) (result i32) (local $y i32) @@ -960,49 +891,39 @@ (global.get $__asyncify_state) (i32.const 0) ) - (block - (loop $l - (block - (local.set $2 - (local.get $y) - ) - (local.set $3 - (i32.add - (local.get $2) - (i32.const 1) - ) - ) - (local.set $x - (local.get $3) - ) - (nop) - (local.set $4 - (local.get $x) - ) - (local.set $5 - (i32.div_s - (local.get $4) - (i32.const 3) - ) - ) - (local.set $y - (local.get $5) - ) - (nop) - (local.set $6 - (local.get $y) - ) - (br_if $l - (local.get $6) - ) - (nop) + (loop $l + (local.set $2 + (local.get $y) + ) + (local.set $3 + (i32.add + (local.get $2) + (i32.const 1) ) - (nop) ) - (nop) + (local.set $x + (local.get $3) + ) + (local.set $4 + (local.get $x) + ) + (local.set $5 + (i32.div_s + (local.get $4) + (i32.const 3) + ) + ) + (local.set $y + (local.get $5) + ) + (local.set $6 + (local.get $y) + ) + (br_if $l + (local.get $6) + ) ) ) - (nop) (if (if (result i32) (i32.eq @@ -1034,7 +955,6 @@ (i32.const 0) ) (block - (nop) (local.set $7 (local.get $y) ) @@ -1044,7 +964,6 @@ ) ) (nop) - (nop) ) (unreachable) ) @@ -1194,67 +1113,49 @@ ) ) (block - (block - (if + (if + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (local.set $1 + (local.get $x) + ) + ) + (if + (i32.or + (local.get $1) (i32.eq (global.get $__asyncify_state) - (i32.const 0) - ) - (local.set $1 - (local.get $x) + (i32.const 2) ) ) (if - (i32.or - (local.get $1) + (if (result i32) (i32.eq (global.get $__asyncify_state) - (i32.const 2) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $3) + (i32.const 0) ) ) (block - (if - (if (result i32) - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (i32.const 1) - (i32.eq - (local.get $3) - (i32.const 0) - ) - ) - (block - (call $import) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) - ) + (call $import) (if (i32.eq (global.get $__asyncify_state) + (i32.const 1) + ) + (br $__asyncify_unwind (i32.const 0) ) - (nop) ) ) ) ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) - ) ) ) (return) @@ -1376,127 +1277,100 @@ ) ) (block + (if + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (local.set $1 + (local.get $x) + ) + ) (block (if (i32.eq (global.get $__asyncify_state) (i32.const 0) ) - (local.set $1 - (local.get $x) + (local.set $2 + (local.get $1) ) ) - (block - (if + (if + (i32.or + (local.get $2) (i32.eq (global.get $__asyncify_state) - (i32.const 0) - ) - (local.set $2 - (local.get $1) + (i32.const 2) ) ) (if - (i32.or - (local.get $2) + (if (result i32) (i32.eq (global.get $__asyncify_state) - (i32.const 2) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $4) + (i32.const 0) ) ) (block - (if - (if (result i32) - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (i32.const 1) - (i32.eq - (local.get $4) - (i32.const 0) - ) - ) - (block - (call $import3 - (i32.const 1) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) + (call $import3 + (i32.const 1) ) (if (i32.eq (global.get $__asyncify_state) + (i32.const 1) + ) + (br $__asyncify_unwind (i32.const 0) ) - (nop) ) ) ) + ) + (if + (i32.or + (i32.eqz + (local.get $2) + ) + (i32.eq + (global.get $__asyncify_state) + (i32.const 2) + ) + ) (if - (i32.or - (i32.eqz - (local.get $2) - ) + (if (result i32) (i32.eq (global.get $__asyncify_state) - (i32.const 2) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $4) + (i32.const 1) ) ) (block - (if - (if (result i32) - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (i32.const 1) - (i32.eq - (local.get $4) - (i32.const 1) - ) - ) - (block - (call $import3 - (i32.const 2) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 1) - ) - ) - ) + (call $import3 + (i32.const 2) ) (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) + ) + (br $__asyncify_unwind + (i32.const 1) ) - (nop) ) ) ) ) ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) - ) ) ) (return) @@ -1682,40 +1556,31 @@ (i32.const 2) ) ) - (block - (if - (if (result i32) + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $6) + (i32.const 0) + ) + ) + (block + (call $import3 + (i32.const 2) + ) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $6) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $import3 - (i32.const 2) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) ) @@ -1726,14 +1591,10 @@ (global.get $__asyncify_state) (i32.const 0) ) - (block - (nop) - (return - (i32.const 3) - ) + (return + (i32.const 3) ) ) - (nop) ) (unreachable) ) @@ -1909,41 +1770,32 @@ (i32.const 2) ) ) - (block - (if - (if (result i32) - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $6) + (i32.const 0) + ) + ) + (block + (call $import3 (i32.const 1) - (i32.eq - (local.get $6) - (i32.const 0) - ) ) - (block - (call $import3 + (if + (i32.eq + (global.get $__asyncify_state) (i32.const 1) ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) + (br $__asyncify_unwind + (i32.const 0) ) ) ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) - ) ) ) (if @@ -1973,14 +1825,10 @@ (global.get $__asyncify_state) (i32.const 0) ) - (block - (nop) - (return - (i32.const 3) - ) + (return + (i32.const 3) ) ) - (nop) ) (unreachable) ) @@ -2121,79 +1969,32 @@ ) ) ) - (block - (loop $l + (loop $l + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $5) + (i32.const 0) + ) + ) (block - (if - (if (result i32) - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (i32.const 1) - (i32.eq - (local.get $5) - (i32.const 0) - ) - ) - (block - (call $import3 - (i32.const 1) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) + (call $import3 + (i32.const 1) ) (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (block - (nop) - (local.set $1 - (local.get $x) - ) - (local.set $2 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (local.set $x - (local.get $2) - ) - (nop) - (local.set $3 - (local.get $x) - ) - (br_if $l - (local.get $3) - ) - (nop) + (br $__asyncify_unwind + (i32.const 0) ) ) - (nop) - (nop) - (nop) - (nop) - (nop) - (nop) - (nop) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) (if @@ -2201,8 +2002,31 @@ (global.get $__asyncify_state) (i32.const 0) ) - (nop) + (block + (local.set $1 + (local.get $x) + ) + (local.set $2 + (i32.add + (local.get $1) + (i32.const 1) + ) + ) + (local.set $x + (local.get $2) + ) + (local.set $3 + (local.get $x) + ) + (br_if $l + (local.get $3) + ) + ) ) + (nop) + (nop) + (nop) + (nop) ) ) (return) @@ -2321,58 +2145,45 @@ ) ) ) - (block - (loop $l - (if - (if (result i32) + (loop $l + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $2) + (i32.const 0) + ) + ) + (block + (local.set $3 + (call $import2) + ) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $2) + (br $__asyncify_unwind (i32.const 0) ) - ) - (block - (local.set $3 - (call $import2) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - (local.set $0 - (local.get $3) - ) - ) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (block - (br_if $l - (local.get $0) + (local.set $0 + (local.get $3) ) - (nop) ) ) - (nop) ) (if (i32.eq (global.get $__asyncify_state) (i32.const 0) ) - (nop) + (br_if $l + (local.get $0) + ) ) ) ) @@ -2457,95 +2268,69 @@ ) ) (block - (block - (if + (if + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (call $boring) + ) + (if + (if (result i32) (i32.eq (global.get $__asyncify_state) (i32.const 0) ) - (block - (call $boring) - (nop) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 0) ) ) - (nop) - (if - (if (result i32) + (block + (call $import) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $1) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $import) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) ) - (if + ) + (if + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (call $boring) + ) + (if + (if (result i32) (i32.eq (global.get $__asyncify_state) (i32.const 0) ) - (block - (nop) - (call $boring) - (nop) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 1) ) ) - (nop) - (nop) - (if - (if (result i32) + (block + (call $import) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) - ) - (i32.const 1) - (i32.eq - (local.get $1) (i32.const 1) ) - ) - (block - (call $import) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 1) - ) + (br $__asyncify_unwind + (i32.const 1) ) ) ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) ) @@ -2614,95 +2399,69 @@ ) ) (block - (block - (if + (if + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (call $boring-deep) + ) + (if + (if (result i32) (i32.eq (global.get $__asyncify_state) (i32.const 0) ) - (block - (call $boring-deep) - (nop) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 0) ) ) - (nop) - (if - (if (result i32) + (block + (call $import-deep) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $1) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $import-deep) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) ) - (if + ) + (if + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (call $boring) + ) + (if + (if (result i32) (i32.eq (global.get $__asyncify_state) (i32.const 0) ) - (block - (nop) - (call $boring) - (nop) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 1) ) ) - (nop) - (nop) - (if - (if (result i32) + (block + (call $import) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) - ) - (i32.const 1) - (i32.eq - (local.get $1) (i32.const 1) ) - ) - (block - (call $import) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 1) - ) + (br $__asyncify_unwind + (i32.const 1) ) ) ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) ) @@ -2731,7 +2490,6 @@ ) (func $boring-deep (; 17 ;) (call $boring) - (nop) ) (func $import-deep (; 18 ;) (local $0 i32) @@ -2771,38 +2529,29 @@ ) ) ) - (block - (if - (if (result i32) + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 0) + ) + ) + (block + (call $import) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $1) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $import) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) ) |