diff options
Diffstat (limited to 'test/passes')
-rw-r--r-- | test/passes/coalesce-locals-learning.txt | 868 | ||||
-rw-r--r-- | test/passes/coalesce-locals-learning.wast | 890 | ||||
-rw-r--r-- | test/passes/coalesce-locals.txt | 1270 | ||||
-rw-r--r-- | test/passes/coalesce-locals.wast | 1225 | ||||
-rw-r--r-- | test/passes/code-folding_enable-threads.txt | 206 | ||||
-rw-r--r-- | test/passes/code-folding_enable-threads.wast | 223 | ||||
-rw-r--r-- | test/passes/code-pushing_ignore-implicit-traps.txt | 460 | ||||
-rw-r--r-- | test/passes/code-pushing_ignore-implicit-traps.wast | 249 | ||||
-rw-r--r-- | test/passes/const-hoisting.txt | 629 | ||||
-rw-r--r-- | test/passes/const-hoisting.wast | 201 |
10 files changed, 0 insertions, 6221 deletions
diff --git a/test/passes/coalesce-locals-learning.txt b/test/passes/coalesce-locals-learning.txt deleted file mode 100644 index b1f1f9594..000000000 --- a/test/passes/coalesce-locals-learning.txt +++ /dev/null @@ -1,868 +0,0 @@ -(module - (type $2 (func)) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $3 (func (param i32 f32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $4 (func (param i32))) - (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) - (memory $0 10) - (func $nothing-to-do - (local $0 i32) - (nop) - ) - (func $merge - (local $0 i32) - (nop) - ) - (func $leave-type - (local $0 i32) - (local $1 f32) - (nop) - ) - (func $leave-interfere - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (local.set $1 - (i32.const 0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $almost-interfere - (local $0 i32) - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - ) - (func $redundant-copy - (local $0 i32) - (local.set $0 - (i32.const 0) - ) - (nop) - (drop - (local.get $0) - ) - ) - (func $ineffective-store - (local $0 i32) - (drop - (i32.const 0) - ) - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - ) - (func $block - (local $0 i32) - (block $block0 - (local.set $0 - (i32.const 0) - ) - ) - (drop - (local.get $0) - ) - ) - (func $see-both-sides - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (block $block0 - (local.set $1 - (i32.const 0) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $see-br-and-ignore-dead - (local $0 i32) - (local.set $0 - (i32.const 0) - ) - (block $block - (br $block) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const -1) - ) - ) - (drop - (local.get $0) - ) - ) - (func $see-block-body - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (block $block - (local.set $1 - (i32.const 0) - ) - (drop - (local.get $1) - ) - (br $block) - ) - (drop - (local.get $0) - ) - ) - (func $zero-init - (local $0 i32) - (local $1 i32) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $multi - (local $0 i32) - (local $1 i32) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-else - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - (func $if-else-parallel - (local $0 i32) - (if - (i32.const 0) - (block $block1 - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - ) - (block $block3 - (local.set $0 - (i32.const 1) - ) - (drop - (local.get $0) - ) - ) - ) - ) - (func $if-else-after - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (local.set $0 - (i32.const 0) - ) - (local.set $1 - (i32.const 1) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-else-through - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (local.set $1 - (i32.const 1) - ) - (if - (i32.const 0) - (drop - (i32.const 1) - ) - (drop - (i32.const 2) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-through - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (local.set $1 - (i32.const 1) - ) - (if - (i32.const 0) - (drop - (i32.const 1) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-through2 - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (if - (i32.const 0) - (local.set $1 - (i32.const 1) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-through3 - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (if - (i32.const 0) - (block $block1 - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - (func $if2 - (local $0 i32) - (local $1 i32) - (if - (local.tee $0 - (i32.const 0) - ) - (block $block1 - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - (func $if3 - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (block $block1 - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - ) - ) - (drop - (local.get $1) - ) - ) - (func $if4 - (local $0 i32) - (if - (i32.const 0) - (block $block1 - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - (local.set $0 - (i32.const 1) - ) - ) - ) - (drop - (local.get $0) - ) - ) - (func $if5 - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (block $block1 - (drop - (local.get $0) - ) - (local.set $1 - (i32.const 1) - ) - ) - ) - (drop - (local.get $1) - ) - ) - (func $loop - (local $0 i32) - (local $1 i32) - (block $out - (loop $in - (drop - (local.get $0) - ) - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $1) - ) - (br $in) - ) - ) - ) - (func $interfere-in-dead - (local $0 i32) - (block $block - (br $block) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - ) - (func $interfere-in-dead2 - (local $0 i32) - (block $block - (unreachable) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - ) - (func $interfere-in-dead3 - (local $0 i32) - (block $block - (return) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - ) - (func $params (param $0 i32) (param $1 f32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (drop - (local.get $2) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - ) - (func $interfere-in-dead4 - (local $0 i32) - (local $1 i32) - (block $block - (br_if $block - (i32.const 0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - (func $switch - (local $0 i32) - (local $1 i32) - (local $2 i32) - (block $switch$def - (block $switch-case$1 - (block $switch-case$2 - (br_table $switch-case$1 $switch-case$2 $switch-case$1 $switch-case$1 $switch$def - (i32.const 100) - ) - (drop - (i32.const 0) - ) - ) - (drop - (local.get $0) - ) - ) - (drop - (local.get $1) - ) - ) - (drop - (local.get $2) - ) - ) - (func $greedy-can-be-happy - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (if - (i32.const 1) - (if - (i32.const 2) - (block $block3 - (local.set $0 - (i32.const 100) - ) - (local.set $1 - (i32.const 101) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block5 - (local.set $0 - (i32.const 102) - ) - (local.set $1 - (i32.const 103) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - (if - (i32.const 3) - (block $block8 - (local.set $0 - (i32.const 104) - ) - (local.set $1 - (i32.const 105) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block10 - (local.set $0 - (i32.const 106) - ) - (local.set $1 - (i32.const 107) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - (if - (i32.const 4) - (block $block13 - (local.set $0 - (i32.const 108) - ) - (local.set $1 - (i32.const 109) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block15 - (local.set $0 - (i32.const 110) - ) - (local.set $1 - (i32.const 111) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - ) - (func $greedy-can-be-sad - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (if - (i32.const 1) - (if - (i32.const 2) - (block $block3 - (local.set $0 - (i32.const 100) - ) - (local.set $1 - (i32.const 101) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block5 - (local.set $0 - (i32.const 102) - ) - (local.set $1 - (i32.const 103) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - (if - (i32.const 3) - (block $block8 - (local.set $0 - (i32.const 104) - ) - (local.set $1 - (i32.const 105) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block10 - (local.set $0 - (i32.const 106) - ) - (local.set $1 - (i32.const 107) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - (if - (i32.const 4) - (block $block13 - (local.set $0 - (i32.const 108) - ) - (local.set $1 - (i32.const 109) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block15 - (local.set $0 - (i32.const 110) - ) - (local.set $1 - (i32.const 111) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - ) - (func $_memcpy (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (if - (i32.ge_s - (local.get $2) - (i32.const 4096) - ) - (drop - (local.get $0) - ) - ) - (local.set $3 - (local.get $0) - ) - (if - (i32.eq - (i32.and - (local.get $0) - (i32.const 3) - ) - (i32.and - (local.get $1) - (i32.const 3) - ) - ) - (block $block2 - (block $while-out$0 - (loop $while-in$1 - (if - (i32.eqz - (i32.and - (local.get $0) - (i32.const 3) - ) - ) - (br $while-out$0) - ) - (block $block4 - (if - (i32.eqz - (local.get $2) - ) - (return - (local.get $3) - ) - ) - (i32.store8 - (local.get $0) - (i32.load8_s - (local.get $1) - ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 1) - ) - ) - ) - (br $while-in$1) - ) - ) - (block $while-out$2 - (loop $while-in$3 - (if - (i32.eqz - (i32.ge_s - (local.get $2) - (i32.const 4) - ) - ) - (br $while-out$2) - ) - (block $block7 - (i32.store - (local.get $0) - (i32.load - (local.get $1) - ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 4) - ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 4) - ) - ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 4) - ) - ) - ) - (br $while-in$3) - ) - ) - ) - ) - (block $while-out$4 - (loop $while-in$5 - (if - (i32.eqz - (i32.gt_s - (local.get $2) - (i32.const 0) - ) - ) - (br $while-out$4) - ) - (block $block9 - (i32.store8 - (local.get $0) - (i32.load8_s - (local.get $1) - ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 1) - ) - ) - ) - (br $while-in$5) - ) - ) - (return - (local.get $3) - ) - ) - (func $this-is-effective-i-tell-you (param $0 i32) - (if - (i32.const -1) - (block $block1 - (if - (i32.const 0) - (nop) - ) - (local.set $0 - (i32.const 1) - ) - ) - (nop) - ) - (drop - (local.get $0) - ) - ) -) diff --git a/test/passes/coalesce-locals-learning.wast b/test/passes/coalesce-locals-learning.wast deleted file mode 100644 index e6f7f4bc7..000000000 --- a/test/passes/coalesce-locals-learning.wast +++ /dev/null @@ -1,890 +0,0 @@ -(module - (memory 10) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $2 (func)) - (type $3 (func (param i32 f32))) - (type $4 (func (param i32))) - (import $_emscripten_autodebug_i32 "env" "_emscripten_autodebug_i32" (param i32 i32) (result i32)) - (func $nothing-to-do (type $2) - (local $x i32) - (nop) - ) - (func $merge (type $2) - (local $x i32) - (local $y i32) - (nop) - ) - (func $leave-type (type $2) - (local $x i32) - (local $y f32) - (nop) - ) - (func $leave-interfere (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (i32.const 0) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $almost-interfere (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - (local.set $y - (i32.const 0) - ) - (drop - (local.get $y) - ) - ) - (func $redundant-copy (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $ineffective-store (type $2) - (local $x i32) - (local.set $x - (i32.const 0) - ) - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - ) - (func $block (type $2) - (local $x i32) - (block $block0 - (local.set $x - (i32.const 0) - ) - ) - (drop - (local.get $x) - ) - ) - (func $see-both-sides (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (block $block0 - (local.set $y - (i32.const 0) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $see-br-and-ignore-dead (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (block $block - (br $block) - (local.set $y - (i32.const 0) - ) - (drop - (local.get $y) - ) - (local.set $x - (i32.const -1) - ) - ) - (drop - (local.get $x) - ) - ) - (func $see-block-body (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (block $block - (local.set $y - (i32.const 0) - ) - (drop - (local.get $y) - ) - (br $block) - ) - (drop - (local.get $x) - ) - ) - (func $zero-init (type $2) - (local $x i32) - (local $y i32) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $multi (type $2) - (local $x i32) - (local $y i32) - (local $z i32) - (drop - (local.get $y) - ) - (drop - (local.get $z) - ) - ) - (func $if-else (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $if-else-parallel (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - ) - (block $block3 - (local.set $y - (i32.const 1) - ) - (drop - (local.get $y) - ) - ) - ) - ) - (func $if-else-after (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (local.set $x - (i32.const 0) - ) - (local.set $y - (i32.const 1) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $if-else-through (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (i32.const 1) - ) - (if - (i32.const 0) - (drop - (i32.const 1) - ) - (drop - (i32.const 2) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $if-through (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (i32.const 1) - ) - (if - (i32.const 0) - (drop - (i32.const 1) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $if-through2 (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (if - (i32.const 0) - (local.set $y - (i32.const 1) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $if-through3 (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (if - (i32.const 0) - (block $block1 - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - ) - (func $if2 (type $2) - (local $x i32) - (local $y i32) - (if - (local.tee $x - (i32.const 0) - ) - (block $block1 - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - ) - (func $if3 (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - ) - ) - (drop - (local.get $y) - ) - ) - (func $if4 (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - (local.set $y - (i32.const 1) - ) - ) - ) - (drop - (local.get $y) - ) - ) - (func $if5 (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (block $block1 - (drop - (local.get $x) - ) - (local.set $y - (i32.const 1) - ) - ) - ) - (drop - (local.get $y) - ) - ) - (func $loop (type $2) - (local $x i32) - (local $y i32) - (block $out - (loop $in - (drop - (local.get $x) - ) - (local.set $x - (i32.const 0) - ) - (drop - (local.get $y) - ) - (br $in) - ) - ) - ) - (func $interfere-in-dead (type $2) - (local $x i32) - (local $y i32) - (block $block - (br $block) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $interfere-in-dead2 (type $2) - (local $x i32) - (local $y i32) - (block $block - (unreachable) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $interfere-in-dead3 (type $2) - (local $x i32) - (local $y i32) - (block $block - (return) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $params (type $3) (param $p i32) (param $q f32) - (local $x i32) - (local $y i32) - (local $z i32) - (local $w i32) - (drop - (local.get $y) - ) - (drop - (local.get $z) - ) - (drop - (local.get $w) - ) - ) - (func $interfere-in-dead4 (type $2) - (local $x i32) - (local $y i32) - (block $block - (br_if $block - (i32.const 0) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $switch (type $2) - (local $x i32) - (local $y i32) - (local $z i32) - (local $w i32) - (block $switch$def - (block $switch-case$1 - (block $switch-case$2 - (br_table $switch-case$1 $switch-case$2 $switch-case$1 $switch-case$1 $switch$def - (i32.const 100) - ) - (drop - (local.get $x) - ) - ) - (drop - (local.get $y) - ) - ) - (drop - (local.get $z) - ) - ) - (drop - (local.get $w) - ) - ) - (func $greedy-can-be-happy (type $2) - (local $x1 i32) - (local $x2 i32) - (local $x3 i32) - (local $y1 i32) - (local $y2 i32) - (local $y3 i32) - (if - (i32.const 0) - (if - (i32.const 1) - (if - (i32.const 2) - (block $block3 - (local.set $x1 - (i32.const 100) - ) - (local.set $y2 - (i32.const 101) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y2) - ) - ) - (block $block5 - (local.set $x1 - (i32.const 102) - ) - (local.set $y3 - (i32.const 103) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y3) - ) - ) - ) - (if - (i32.const 3) - (block $block8 - (local.set $x2 - (i32.const 104) - ) - (local.set $y1 - (i32.const 105) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y1) - ) - ) - (block $block10 - (local.set $x2 - (i32.const 106) - ) - (local.set $y3 - (i32.const 107) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y3) - ) - ) - ) - ) - (if - (i32.const 4) - (block $block13 - (local.set $x3 - (i32.const 108) - ) - (local.set $y1 - (i32.const 109) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y1) - ) - ) - (block $block15 - (local.set $x3 - (i32.const 110) - ) - (local.set $y2 - (i32.const 111) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y2) - ) - ) - ) - ) - ) - (func $greedy-can-be-sad (type $2) - (local $x1 i32) - (local $y1 i32) - (local $x2 i32) - (local $y2 i32) - (local $x3 i32) - (local $y3 i32) - (if - (i32.const 0) - (if - (i32.const 1) - (if - (i32.const 2) - (block $block3 - (local.set $x1 - (i32.const 100) - ) - (local.set $y2 - (i32.const 101) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y2) - ) - ) - (block $block5 - (local.set $x1 - (i32.const 102) - ) - (local.set $y3 - (i32.const 103) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y3) - ) - ) - ) - (if - (i32.const 3) - (block $block8 - (local.set $x2 - (i32.const 104) - ) - (local.set $y1 - (i32.const 105) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y1) - ) - ) - (block $block10 - (local.set $x2 - (i32.const 106) - ) - (local.set $y3 - (i32.const 107) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y3) - ) - ) - ) - ) - (if - (i32.const 4) - (block $block13 - (local.set $x3 - (i32.const 108) - ) - (local.set $y1 - (i32.const 109) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y1) - ) - ) - (block $block15 - (local.set $x3 - (i32.const 110) - ) - (local.set $y2 - (i32.const 111) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y2) - ) - ) - ) - ) - ) - (func $_memcpy (type $FUNCSIG$iiii) (param $i1 i32) (param $i2 i32) (param $i3 i32) (result i32) - (local $i4 i32) - (if - (i32.ge_s - (local.get $i3) - (i32.const 4096) - ) - (drop - (local.get $i1) - ) - ) - (local.set $i4 - (local.get $i1) - ) - (if - (i32.eq - (i32.and - (local.get $i1) - (i32.const 3) - ) - (i32.and - (local.get $i2) - (i32.const 3) - ) - ) - (block $block2 - (block $while-out$0 - (loop $while-in$1 - (if - (i32.eqz - (i32.and - (local.get $i1) - (i32.const 3) - ) - ) - (br $while-out$0) - ) - (block $block4 - (if - (i32.eqz - (local.get $i3) - ) - (return - (local.get $i4) - ) - ) - (i32.store8 - (local.get $i1) - (i32.load8_s - (local.get $i2) - ) - ) - (local.set $i1 - (i32.add - (local.get $i1) - (i32.const 1) - ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 1) - ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 1) - ) - ) - ) - (br $while-in$1) - ) - ) - (block $while-out$2 - (loop $while-in$3 - (if - (i32.eqz - (i32.ge_s - (local.get $i3) - (i32.const 4) - ) - ) - (br $while-out$2) - ) - (block $block7 - (i32.store - (local.get $i1) - (i32.load - (local.get $i2) - ) - ) - (local.set $i1 - (i32.add - (local.get $i1) - (i32.const 4) - ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 4) - ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 4) - ) - ) - ) - (br $while-in$3) - ) - ) - ) - ) - (block $while-out$4 - (loop $while-in$5 - (if - (i32.eqz - (i32.gt_s - (local.get $i3) - (i32.const 0) - ) - ) - (br $while-out$4) - ) - (block $block9 - (i32.store8 - (local.get $i1) - (i32.load8_s - (local.get $i2) - ) - ) - (local.set $i1 - (i32.add - (local.get $i1) - (i32.const 1) - ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 1) - ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 1) - ) - ) - ) - (br $while-in$5) - ) - ) - (return - (local.get $i4) - ) - ) - (func $this-is-effective-i-tell-you (type $4) (param $x i32) - (if - (i32.const -1) - (block $block1 - (if - (i32.const 0) - (nop) - ) - (local.set $x - (i32.const 1) - ) - ) - (nop) - ) - (drop - (local.get $x) - ) - ) -) diff --git a/test/passes/coalesce-locals.txt b/test/passes/coalesce-locals.txt deleted file mode 100644 index 16cb03f66..000000000 --- a/test/passes/coalesce-locals.txt +++ /dev/null @@ -1,1270 +0,0 @@ -(module - (type $2 (func)) - (type $4 (func (param i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $f64_i32_=>_i64 (func (param f64 i32) (result i64))) - (type $none_=>_i32 (func (result i32))) - (type $3 (func (param i32 f32))) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $i32_=>_i32 (func (param i32) (result i32))) - (type $i32_i32_=>_none (func (param i32 i32))) - (type $none_=>_f64 (func (result f64))) - (import "env" "_emscripten_autodebug_i32" (func $_emscripten_autodebug_i32 (param i32 i32) (result i32))) - (import "env" "get" (func $get (result i32))) - (import "env" "set" (func $set (param i32))) - (memory $0 10) - (func $nothing-to-do - (local $0 i32) - (nop) - ) - (func $merge - (local $0 i32) - (nop) - ) - (func $leave-type - (local $0 i32) - (local $1 f32) - (nop) - ) - (func $leave-interfere - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (local.set $1 - (i32.const 0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $almost-interfere - (local $0 i32) - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - ) - (func $redundant-copy - (local $0 i32) - (local.set $0 - (i32.const 0) - ) - (nop) - (drop - (local.get $0) - ) - ) - (func $ineffective-store - (local $0 i32) - (drop - (i32.const 0) - ) - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - ) - (func $block - (local $0 i32) - (block $block0 - (local.set $0 - (i32.const 0) - ) - ) - (drop - (local.get $0) - ) - ) - (func $see-both-sides - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (block $block0 - (local.set $1 - (i32.const 0) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $see-br-and-ignore-dead - (local $0 i32) - (local.set $0 - (i32.const 0) - ) - (block $block - (br $block) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const -1) - ) - ) - (drop - (local.get $0) - ) - ) - (func $see-block-body - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (block $block - (local.set $1 - (i32.const 0) - ) - (drop - (local.get $1) - ) - (br $block) - ) - (drop - (local.get $0) - ) - ) - (func $zero-init - (local $0 i32) - (local $1 i32) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $multi - (local $0 i32) - (local $1 i32) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-else - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - (func $if-else-parallel - (local $0 i32) - (if - (i32.const 0) - (block $block1 - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - ) - (block $block3 - (local.set $0 - (i32.const 1) - ) - (drop - (local.get $0) - ) - ) - ) - ) - (func $if-else-after - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (local.set $0 - (i32.const 0) - ) - (local.set $1 - (i32.const 1) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-else-through - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (local.set $1 - (i32.const 1) - ) - (if - (i32.const 0) - (drop - (i32.const 1) - ) - (drop - (i32.const 2) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-through - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (local.set $1 - (i32.const 1) - ) - (if - (i32.const 0) - (drop - (i32.const 1) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-through2 - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (if - (i32.const 0) - (local.set $1 - (i32.const 1) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $if-through3 - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (if - (i32.const 0) - (block $block1 - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - (func $if2 - (local $0 i32) - (local $1 i32) - (if - (local.tee $0 - (i32.const 0) - ) - (block $block1 - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - (func $if3 - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (block $block1 - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - ) - ) - (drop - (local.get $1) - ) - ) - (func $if4 - (local $0 i32) - (if - (i32.const 0) - (block $block1 - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $0) - ) - (local.set $0 - (i32.const 1) - ) - ) - ) - (drop - (local.get $0) - ) - ) - (func $if5 - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (block $block1 - (drop - (local.get $0) - ) - (local.set $1 - (i32.const 1) - ) - ) - ) - (drop - (local.get $1) - ) - ) - (func $loop - (local $0 i32) - (local $1 i32) - (loop $in - (drop - (local.get $0) - ) - (local.set $0 - (i32.const 0) - ) - (drop - (local.get $1) - ) - (br $in) - ) - ) - (func $interfere-in-dead - (local $0 i32) - (block $block - (br $block) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - ) - (func $interfere-in-dead2 - (local $0 i32) - (block $block - (unreachable) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - ) - (func $interfere-in-dead3 - (local $0 i32) - (block $block - (return) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - ) - (func $params (param $0 i32) (param $1 f32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (drop - (local.get $2) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - ) - (func $interfere-in-dead4 - (local $0 i32) - (local $1 i32) - (block $block - (br_if $block - (i32.const 0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - (func $switch - (local $0 i32) - (local $1 i32) - (local $2 i32) - (block $switch$def - (block $switch-case$1 - (block $switch-case$2 - (br_table $switch-case$1 $switch-case$2 $switch-case$1 $switch-case$1 $switch$def - (i32.const 100) - ) - (drop - (i32.const 0) - ) - ) - (drop - (local.get $0) - ) - ) - (drop - (local.get $1) - ) - ) - (drop - (local.get $2) - ) - ) - (func $greedy-can-be-happy - (local $0 i32) - (local $1 i32) - (if - (i32.const 0) - (if - (i32.const 1) - (if - (i32.const 2) - (block $block3 - (local.set $0 - (i32.const 100) - ) - (local.set $1 - (i32.const 101) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block5 - (local.set $0 - (i32.const 102) - ) - (local.set $1 - (i32.const 103) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - (if - (i32.const 3) - (block $block8 - (local.set $0 - (i32.const 104) - ) - (local.set $1 - (i32.const 105) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block10 - (local.set $0 - (i32.const 106) - ) - (local.set $1 - (i32.const 107) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - (if - (i32.const 4) - (block $block13 - (local.set $0 - (i32.const 108) - ) - (local.set $1 - (i32.const 109) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block15 - (local.set $0 - (i32.const 110) - ) - (local.set $1 - (i32.const 111) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - ) - ) - (func $greedy-can-be-sad - (local $0 i32) - (local $1 i32) - (local $2 i32) - (if - (i32.const 0) - (if - (i32.const 1) - (if - (i32.const 2) - (block $block3 - (local.set $0 - (i32.const 100) - ) - (local.set $1 - (i32.const 101) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (block $block5 - (local.set $0 - (i32.const 102) - ) - (local.set $2 - (i32.const 103) - ) - (drop - (local.get $0) - ) - (drop - (local.get $2) - ) - ) - ) - (if - (i32.const 3) - (block $block8 - (local.set $1 - (i32.const 104) - ) - (local.set $0 - (i32.const 105) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - ) - (block $block10 - (local.set $1 - (i32.const 106) - ) - (local.set $2 - (i32.const 107) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - ) - ) - ) - (if - (i32.const 4) - (block $block13 - (local.set $2 - (i32.const 108) - ) - (local.set $0 - (i32.const 109) - ) - (drop - (local.get $2) - ) - (drop - (local.get $0) - ) - ) - (block $block15 - (local.set $2 - (i32.const 110) - ) - (local.set $1 - (i32.const 111) - ) - (drop - (local.get $2) - ) - (drop - (local.get $1) - ) - ) - ) - ) - ) - (func $_memcpy (param $0 i32) (param $1 i32) (param $2 i32) (result i32) - (local $3 i32) - (if - (i32.ge_s - (local.get $2) - (i32.const 4096) - ) - (drop - (local.get $0) - ) - ) - (local.set $3 - (local.get $0) - ) - (if - (i32.eq - (i32.and - (local.get $0) - (i32.const 3) - ) - (i32.and - (local.get $1) - (i32.const 3) - ) - ) - (block $block2 - (block $while-out$0 - (loop $while-in$1 - (if - (i32.eqz - (i32.and - (local.get $0) - (i32.const 3) - ) - ) - (br $while-out$0) - ) - (block $block4 - (if - (i32.eqz - (local.get $2) - ) - (return - (local.get $3) - ) - ) - (i32.store8 - (local.get $0) - (i32.load8_s - (local.get $1) - ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 1) - ) - ) - ) - (br $while-in$1) - ) - ) - (block $while-out$2 - (loop $while-in$3 - (if - (i32.eqz - (i32.ge_s - (local.get $2) - (i32.const 4) - ) - ) - (br $while-out$2) - ) - (block $block7 - (i32.store - (local.get $0) - (i32.load - (local.get $1) - ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 4) - ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 4) - ) - ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 4) - ) - ) - ) - (br $while-in$3) - ) - ) - ) - ) - (block $while-out$4 - (loop $while-in$5 - (if - (i32.eqz - (i32.gt_s - (local.get $2) - (i32.const 0) - ) - ) - (br $while-out$4) - ) - (block $block9 - (i32.store8 - (local.get $0) - (i32.load8_s - (local.get $1) - ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 1) - ) - ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 1) - ) - ) - ) - (br $while-in$5) - ) - ) - (return - (local.get $3) - ) - ) - (func $this-is-effective-i-tell-you (param $0 i32) - (if - (i32.const -1) - (block $block1 - (if - (i32.const 0) - (nop) - ) - (local.set $0 - (i32.const 1) - ) - ) - (nop) - ) - (drop - (local.get $0) - ) - ) - (func $prefer-remove-copies1 - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (nop) - (local.set $1 - (i32.const 1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - (func $prefer-remove-copies2 - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 0) - ) - (nop) - (local.set $1 - (i32.const 1) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - ) - (func $in-unreachable - (local $0 i32) - (block $x - (return) - (drop - (i32.const 1) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - (block $y - (unreachable) - (drop - (i32.const 1) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - (block $z - (br $z) - (drop - (i32.const 1) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - (block $z14 - (br_table $z14 $z14 - (i32.const 100) - ) - (drop - (i32.const 1) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 0) - ) - ) - ) - (func $nop-in-unreachable - (local $0 i32) - (block $block - (unreachable) - (i32.store - (i32.const 0) - (i32.const 0) - ) - ) - ) - (func $loop-backedge - (local $0 i32) - (local $1 i32) - (local.set $0 - (i32.const 2) - ) - (block $out - (loop $while-in7 - (local.set $1 - (i32.const 0) - ) - (call $set - (local.get $1) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (if - (call $get) - (local.set $1 - (local.get $0) - ) - ) - (br_if $out - (local.get $1) - ) - (local.set $0 - (i32.const 100) - ) - (nop) - (br $while-in7) - ) - ) - ) - (func $if-copy1 - (local $0 i32) - (local $1 i32) - (loop $top - (local.set $0 - (if (result i32) - (i32.const 1) - (local.get $0) - (local.get $1) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (br $top) - ) - ) - (func $if-copy2 - (local $0 i32) - (local $1 i32) - (loop $top - (local.set $1 - (if (result i32) - (i32.const 1) - (local.get $0) - (local.get $1) - ) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (br $top) - ) - ) - (func $if-copy3 - (local $0 i32) - (local $1 i32) - (loop $top - (local.set $0 - (if (result i32) - (i32.const 1) - (unreachable) - (local.get $0) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (br $top) - ) - ) - (func $if-copy4 - (local $0 i32) - (local $1 i32) - (loop $top - (local.set $1 - (if (result i32) - (i32.const 1) - (unreachable) - (local.get $0) - ) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (br $top) - ) - ) - (func $if-copy-tee - (local $0 i32) - (local $1 i32) - (loop $top - (drop - (local.tee $0 - (if (result i32) - (i32.const 1) - (local.get $0) - (i32.const 2) - ) - ) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (br $top) - ) - ) - (func $tee_br (param $0 i32) (result i32) - (block $b - (return - (br $b) - ) - ) - (i32.const 1) - ) - (func $unused-tee-with-child-if-no-else (param $0 i32) - (loop $label$0 - (drop - (if - (br $label$0) - (nop) - ) - ) - ) - ) - (func $tee_if_with_unreachable_else (param $0 f64) (param $1 i32) (result i64) - (call $tee_if_with_unreachable_else - (local.tee $0 - (if (result f64) - (local.get $1) - (local.get $0) - (unreachable) - ) - ) - (f64.lt - (f64.const -128) - (local.get $0) - ) - ) - ) - (func $tee_if_with_unreachable_true (param $0 f64) (param $1 i32) (result i64) - (call $tee_if_with_unreachable_else - (local.tee $0 - (if (result f64) - (local.get $1) - (unreachable) - (local.get $0) - ) - ) - (f64.lt - (f64.const -128) - (local.get $0) - ) - ) - ) - (func $pick - (local $0 i32) - (nop) - (if - (i32.const 1) - (drop - (i32.const 1) - ) - ) - (nop) - (nop) - ) - (func $pick-2 - (local $0 i32) - (nop) - (if - (i32.const 1) - (drop - (i32.const 1) - ) - ) - (nop) - (nop) - ) - (func $many - (local $0 i32) - (nop) - (nop) - (nop) - (nop) - (if - (i32.const 1) - (drop - (i32.const 1) - ) - ) - (nop) - (if - (i32.const 1) - (drop - (i32.const 1) - ) - ) - (nop) - (nop) - (nop) - (local.set $0 - (i32.const 2) - ) - (nop) - (if - (i32.const 1) - (drop - (i32.const 1) - ) - ) - (nop) - (nop) - (nop) - (drop - (i32.const 2) - ) - (nop) - ) - (func $loop-copies (param $0 i32) (param $1 i32) - (loop $loop - (local.set $0 - (local.get $1) - ) - (local.set $1 - (local.get $0) - ) - (br_if $loop - (local.get $0) - ) - ) - ) - (func $proper-type (result f64) - (local $0 f64) - (local $1 i32) - (drop - (select - (i32.const 0) - (i32.const 1) - (local.get $1) - ) - ) - (local.get $0) - ) - (func $reuse-param (param $0 i32) (param $1 i32) (result i32) - (i32.add - (local.tee $0 - (i32.xor - (i32.shr_s - (i32.shl - (local.get $0) - (i32.const 16) - ) - (i32.const 16) - ) - (i32.shr_s - (i32.shl - (local.get $1) - (i32.const 16) - ) - (i32.const 16) - ) - ) - ) - (local.get $0) - ) - ) -) diff --git a/test/passes/coalesce-locals.wast b/test/passes/coalesce-locals.wast deleted file mode 100644 index ad62d1c7a..000000000 --- a/test/passes/coalesce-locals.wast +++ /dev/null @@ -1,1225 +0,0 @@ -(module - (memory 10) - (type $FUNCSIG$iiii (func (param i32 i32 i32) (result i32))) - (type $FUNCSIG$iii (func (param i32 i32) (result i32))) - (type $2 (func)) - (type $3 (func (param i32 f32))) - (type $4 (func (param i32))) - (import $_emscripten_autodebug_i32 "env" "_emscripten_autodebug_i32" (param i32 i32) (result i32)) - (import $get "env" "get" (result i32)) - (import $set "env" "set" (param i32)) - (func $nothing-to-do (type $2) - (local $x i32) - (nop) - ) - (func $merge (type $2) - (local $x i32) - (local $y i32) - (nop) - ) - (func $leave-type (type $2) - (local $x i32) - (local $y f32) - (nop) - ) - (func $leave-interfere (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (i32.const 0) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $almost-interfere (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - (local.set $y - (i32.const 0) - ) - (drop - (local.get $y) - ) - ) - (func $redundant-copy (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $ineffective-store (type $2) - (local $x i32) - (local.set $x - (i32.const 0) - ) - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - ) - (func $block (type $2) - (local $x i32) - (block $block0 - (local.set $x - (i32.const 0) - ) - ) - (drop - (local.get $x) - ) - ) - (func $see-both-sides (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (block $block0 - (local.set $y - (i32.const 0) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $see-br-and-ignore-dead (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (block $block - (br $block) - (local.set $y - (i32.const 0) - ) - (drop - (local.get $y) - ) - (local.set $x - (i32.const -1) - ) - ) - (drop - (local.get $x) - ) - ) - (func $see-block-body (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (block $block - (local.set $y - (i32.const 0) - ) - (drop - (local.get $y) - ) - (br $block) - ) - (drop - (local.get $x) - ) - ) - (func $zero-init (type $2) - (local $x i32) - (local $y i32) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $multi (type $2) - (local $x i32) - (local $y i32) - (local $z i32) - (drop - (local.get $y) - ) - (drop - (local.get $z) - ) - ) - (func $if-else (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $if-else-parallel (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - ) - (block $block3 - (local.set $y - (i32.const 1) - ) - (drop - (local.get $y) - ) - ) - ) - ) - (func $if-else-after (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (local.set $x - (i32.const 0) - ) - (local.set $y - (i32.const 1) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $if-else-through (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (i32.const 1) - ) - (if - (i32.const 0) - (drop - (i32.const 1) - ) - (drop - (i32.const 2) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $if-through (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (i32.const 1) - ) - (if - (i32.const 0) - (drop - (i32.const 1) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $if-through2 (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (if - (i32.const 0) - (local.set $y - (i32.const 1) - ) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (func $if-through3 (type $2) - (local $x i32) - (local $y i32) - (local.set $x - (i32.const 0) - ) - (if - (i32.const 0) - (block $block1 - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - ) - (func $if2 (type $2) - (local $x i32) - (local $y i32) - (if - (local.tee $x - (i32.const 0) - ) - (block $block1 - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - ) - (func $if3 (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - ) - ) - (drop - (local.get $y) - ) - ) - (func $if4 (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - (local.set $y - (i32.const 1) - ) - ) - ) - (drop - (local.get $y) - ) - ) - (func $if5 (type $2) - (local $x i32) - (local $y i32) - (if - (i32.const 0) - (block $block1 - (drop - (local.get $x) - ) - (local.set $y - (i32.const 1) - ) - ) - ) - (drop - (local.get $y) - ) - ) - (func $loop (type $2) - (local $x i32) - (local $y i32) - (loop $in - (drop - (local.get $x) - ) - (local.set $x - (i32.const 0) - ) - (drop - (local.get $y) - ) - (br $in) - ) - ) - (func $interfere-in-dead (type $2) - (local $x i32) - (local $y i32) - (block $block - (br $block) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $interfere-in-dead2 (type $2) - (local $x i32) - (local $y i32) - (block $block - (unreachable) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $interfere-in-dead3 (type $2) - (local $x i32) - (local $y i32) - (block $block - (return) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $params (type $3) (param $p i32) (param $q f32) - (local $x i32) - (local $y i32) - (local $z i32) - (local $w i32) - (drop - (local.get $y) - ) - (drop - (local.get $z) - ) - (drop - (local.get $w) - ) - ) - (func $interfere-in-dead4 (type $2) - (local $x i32) - (local $y i32) - (block $block - (br_if $block - (i32.const 0) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $switch (type $2) - (local $x i32) - (local $y i32) - (local $z i32) - (local $w i32) - (block $switch$def - (block $switch-case$1 - (block $switch-case$2 - (br_table $switch-case$1 $switch-case$2 $switch-case$1 $switch-case$1 $switch$def - (i32.const 100) - ) - (drop - (local.get $x) - ) - ) - (drop - (local.get $y) - ) - ) - (drop - (local.get $z) - ) - ) - (drop - (local.get $w) - ) - ) - (func $greedy-can-be-happy (type $2) - (local $x1 i32) - (local $x2 i32) - (local $x3 i32) - (local $y1 i32) - (local $y2 i32) - (local $y3 i32) - (if - (i32.const 0) - (if - (i32.const 1) - (if - (i32.const 2) - (block $block3 - (local.set $x1 - (i32.const 100) - ) - (local.set $y2 - (i32.const 101) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y2) - ) - ) - (block $block5 - (local.set $x1 - (i32.const 102) - ) - (local.set $y3 - (i32.const 103) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y3) - ) - ) - ) - (if - (i32.const 3) - (block $block8 - (local.set $x2 - (i32.const 104) - ) - (local.set $y1 - (i32.const 105) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y1) - ) - ) - (block $block10 - (local.set $x2 - (i32.const 106) - ) - (local.set $y3 - (i32.const 107) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y3) - ) - ) - ) - ) - (if - (i32.const 4) - (block $block13 - (local.set $x3 - (i32.const 108) - ) - (local.set $y1 - (i32.const 109) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y1) - ) - ) - (block $block15 - (local.set $x3 - (i32.const 110) - ) - (local.set $y2 - (i32.const 111) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y2) - ) - ) - ) - ) - ) - (func $greedy-can-be-sad (type $2) - (local $x1 i32) - (local $y1 i32) - (local $x2 i32) - (local $y2 i32) - (local $x3 i32) - (local $y3 i32) - (if - (i32.const 0) - (if - (i32.const 1) - (if - (i32.const 2) - (block $block3 - (local.set $x1 - (i32.const 100) - ) - (local.set $y2 - (i32.const 101) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y2) - ) - ) - (block $block5 - (local.set $x1 - (i32.const 102) - ) - (local.set $y3 - (i32.const 103) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y3) - ) - ) - ) - (if - (i32.const 3) - (block $block8 - (local.set $x2 - (i32.const 104) - ) - (local.set $y1 - (i32.const 105) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y1) - ) - ) - (block $block10 - (local.set $x2 - (i32.const 106) - ) - (local.set $y3 - (i32.const 107) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y3) - ) - ) - ) - ) - (if - (i32.const 4) - (block $block13 - (local.set $x3 - (i32.const 108) - ) - (local.set $y1 - (i32.const 109) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y1) - ) - ) - (block $block15 - (local.set $x3 - (i32.const 110) - ) - (local.set $y2 - (i32.const 111) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y2) - ) - ) - ) - ) - ) - (func $_memcpy (type $FUNCSIG$iiii) (param $i1 i32) (param $i2 i32) (param $i3 i32) (result i32) - (local $i4 i32) - (if - (i32.ge_s - (local.get $i3) - (i32.const 4096) - ) - (drop - (local.get $i1) - ) - ) - (local.set $i4 - (local.get $i1) - ) - (if - (i32.eq - (i32.and - (local.get $i1) - (i32.const 3) - ) - (i32.and - (local.get $i2) - (i32.const 3) - ) - ) - (block $block2 - (block $while-out$0 - (loop $while-in$1 - (if - (i32.eqz - (i32.and - (local.get $i1) - (i32.const 3) - ) - ) - (br $while-out$0) - ) - (block $block4 - (if - (i32.eqz - (local.get $i3) - ) - (return - (local.get $i4) - ) - ) - (i32.store8 - (local.get $i1) - (i32.load8_s - (local.get $i2) - ) - ) - (local.set $i1 - (i32.add - (local.get $i1) - (i32.const 1) - ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 1) - ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 1) - ) - ) - ) - (br $while-in$1) - ) - ) - (block $while-out$2 - (loop $while-in$3 - (if - (i32.eqz - (i32.ge_s - (local.get $i3) - (i32.const 4) - ) - ) - (br $while-out$2) - ) - (block $block7 - (i32.store - (local.get $i1) - (i32.load - (local.get $i2) - ) - ) - (local.set $i1 - (i32.add - (local.get $i1) - (i32.const 4) - ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 4) - ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 4) - ) - ) - ) - (br $while-in$3) - ) - ) - ) - ) - (block $while-out$4 - (loop $while-in$5 - (if - (i32.eqz - (i32.gt_s - (local.get $i3) - (i32.const 0) - ) - ) - (br $while-out$4) - ) - (block $block9 - (i32.store8 - (local.get $i1) - (i32.load8_s - (local.get $i2) - ) - ) - (local.set $i1 - (i32.add - (local.get $i1) - (i32.const 1) - ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 1) - ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 1) - ) - ) - ) - (br $while-in$5) - ) - ) - (return - (local.get $i4) - ) - ) - (func $this-is-effective-i-tell-you (type $4) (param $x i32) - (if - (i32.const -1) - (block $block1 - (if - (i32.const 0) - (nop) - ) - (local.set $x - (i32.const 1) - ) - ) - (nop) - ) - (drop - (local.get $x) - ) - ) - (func $prefer-remove-copies1 (type $2) - (local $y i32) - (local $z i32) - (local $x i32) - (local.set $x - (i32.const 0) - ) - (local.set $y - (local.get $x) - ) - (local.set $z - (i32.const 1) - ) - (drop - (local.get $y) - ) - (drop - (local.get $z) - ) - ) - (func $prefer-remove-copies2 (type $2) - (local $y i32) - (local $z i32) - (local $x i32) - (local.set $x - (i32.const 0) - ) - (local.set $z - (local.get $x) - ) - (local.set $y - (i32.const 1) - ) - (drop - (local.get $y) - ) - (drop - (local.get $z) - ) - ) - (func $in-unreachable - (local $a i32) - (block $x - (return) - (local.set $a (i32.const 1)) - (drop (local.get $a)) - (local.set $a (local.get $a)) - ) - (block $y - (unreachable) - (local.set $a (i32.const 1)) - (drop (local.get $a)) - (local.set $a (local.get $a)) - ) - (block $z - (br $z) - (local.set $a (i32.const 1)) - (drop (local.get $a)) - (local.set $a (local.get $a)) - ) - (block $z - (br_table $z $z - (i32.const 100) - ) - (local.set $a (i32.const 1)) - (drop (local.get $a)) - (local.set $a (local.get $a)) - ) - ) - (func $nop-in-unreachable - (local $x i32) - (block - (unreachable) - (i32.store - (local.get $x) - (local.tee $x (i32.const 0)) - ) - ) - ) - (func $loop-backedge - (local $0 i32) ;; loop phi - (local $1 i32) ;; value for next loop iteration - (local $2 i32) ;; a local that might be merged with with $1, perhaps making us prefer it to removing a backedge copy - (local.set $0 - (i32.const 2) - ) - (block $out - (loop $while-in7 - (local.set $2 (i32.const 0)) ;; 2 interferes with 0 - (call $set (local.get $2)) - (local.set $1 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (if (call $get) - (local.set $2 (local.get $1)) ;; copy for 1/2 - ) - (br_if $out (local.get $2)) - (local.set $1 (i32.const 100)) - (local.set $0 (local.get $1)) ;; copy for 1/0, with extra weight should win the tie - (br $while-in7) - ) - ) - ) - (func $if-copy1 - (local $x i32) - (local $y i32) - (loop $top - (local.set $x - (if (result i32) - (i32.const 1) - (local.get $x) - (local.get $y) - ) - ) - (drop (local.get $x)) - (drop (local.get $y)) - (br $top) - ) - ) - (func $if-copy2 - (local $x i32) - (local $y i32) - (loop $top - (local.set $x - (if (result i32) - (i32.const 1) - (local.get $y) - (local.get $x) - ) - ) - (drop (local.get $x)) - (drop (local.get $y)) - (br $top) - ) - ) - (func $if-copy3 - (local $x i32) - (local $y i32) - (loop $top - (local.set $x - (if (result i32) - (i32.const 1) - (unreachable) - (local.get $x) - ) - ) - (drop (local.get $x)) - (drop (local.get $y)) - (br $top) - ) - ) - (func $if-copy4 - (local $x i32) - (local $y i32) - (loop $top - (local.set $x - (if (result i32) - (i32.const 1) - (unreachable) - (local.get $y) - ) - ) - (drop (local.get $x)) - (drop (local.get $y)) - (br $top) - ) - ) - (func $if-copy-tee - (local $x i32) - (local $y i32) - (loop $top - (drop - (local.tee $x - (if (result i32) - (i32.const 1) - (local.get $x) - (i32.const 2) - ) - ) - ) - (drop (local.get $x)) - (drop (local.get $y)) - (br $top) - ) - ) - (func $tee_br (param $x i32) (result i32) - (block $b - (return - (local.tee $x - (br $b) - ) - ) - ) - (i32.const 1) - ) - (func $unused-tee-with-child-if-no-else (param $0 i32) - (loop $label$0 - (drop - (local.tee $0 - (if - (br $label$0) - (nop) - ) - ) - ) - ) - ) - (func $tee_if_with_unreachable_else (param $0 f64) (param $1 i32) (result i64) - (call $tee_if_with_unreachable_else - (local.tee $0 - (if (result f64) - (local.get $1) - (local.get $0) - (unreachable) - ) - ) - (f64.lt - (f64.const -128) - (local.get $0) - ) - ) - ) - (func $tee_if_with_unreachable_true (param $0 f64) (param $1 i32) (result i64) - (call $tee_if_with_unreachable_else - (local.tee $0 - (if (result f64) - (local.get $1) - (unreachable) - (local.get $0) - ) - ) - (f64.lt - (f64.const -128) - (local.get $0) - ) - ) - ) - (func $pick - (local $x i32) - (local $y i32) - (local.set $x (local.get $y)) - (if (i32.const 1) - (local.set $x (i32.const 1)) - ) - (local.set $x (local.get $y)) - (local.set $x (local.get $y)) - ) - (func $pick-2 - (local $x i32) - (local $y i32) - (local.set $y (local.get $x)) - (if (i32.const 1) - (local.set $y (i32.const 1)) - ) - (local.set $y (local.get $x)) - (local.set $y (local.get $x)) - ) - (func $many - (local $x i32) - (local $y i32) - (local $z i32) - (local $w i32) - (local.set $y (local.get $x)) - (local.set $z (local.get $y)) - (local.set $w (local.get $z)) - (local.set $x (local.get $z)) - (if (i32.const 1) - (local.set $y (i32.const 1)) - ) - (local.set $x (local.get $z)) - (if (i32.const 1) - (local.set $y (i32.const 1)) - ) - (local.set $y (local.get $x)) - (local.set $z (local.get $y)) - (local.set $w (local.get $z)) - (local.set $z (i32.const 2)) - (local.set $x (local.get $z)) - (if (i32.const 1) - (local.set $y (i32.const 1)) - ) - (local.set $y (local.get $x)) - (local.set $z (local.get $y)) - (local.set $w (local.get $z)) - (local.set $z (i32.const 2)) - (local.set $x (local.get $w)) - ) - (func $loop-copies (param $x i32) (param $y i32) - (loop $loop - (local.set $x (local.get $y)) - (local.set $y (local.get $x)) - (br_if $loop (local.get $x)) - ) - ) - (func $proper-type (result f64) - (local $var$0 i32) - (local $var$2 f64) - (local.set $var$0 - (select - (i32.const 0) - (i32.const 1) - (local.get $var$0) - ) - ) - (local.tee $var$2 ;; the locals will be reordered, this should be the f64 - (local.get $var$2) - ) - ) - (func $reuse-param (param $x i32) (param $y i32) (result i32) - (local $temp i32) - (i32.add - (local.tee $temp - (i32.xor - (i32.shr_s - (i32.shl - (local.get $x) ;; $x and $temp do not interfere - (i32.const 16) - ) - (i32.const 16) - ) - (i32.shr_s - (i32.shl - (local.get $y) - (i32.const 16) - ) - (i32.const 16) - ) - ) - ) - (local.get $temp) - ) - ) -) diff --git a/test/passes/code-folding_enable-threads.txt b/test/passes/code-folding_enable-threads.txt deleted file mode 100644 index 8b1ac66fd..000000000 --- a/test/passes/code-folding_enable-threads.txt +++ /dev/null @@ -1,206 +0,0 @@ -(module - (type $none_=>_none (func)) - (type $none_=>_f32 (func (result f32))) - (type $13 (func (param f32))) - (memory $0 1 1) - (table $0 282 282 funcref) - (func $0 - (block $label$1 - (if - (i32.const 1) - (block - (block $label$3 - (call_indirect (type $13) - (block $label$4 - (br $label$3) - ) - (i32.const 105) - ) - ) - (nop) - ) - ) - ) - ) - (func $negative-zero (result f32) - (if (result f32) - (i32.const 0) - (block $label$0 (result f32) - (f32.const 0) - ) - (block $label$1 (result f32) - (f32.const -0) - ) - ) - ) - (func $negative-zero-b (result f32) - (drop - (i32.const 0) - ) - (block $label$0 (result f32) - (f32.const -0) - ) - ) - (func $negative-zero-c (result f32) - (drop - (i32.const 0) - ) - (block $label$0 (result f32) - (f32.const 0) - ) - ) - (func $break-target-outside-of-return-merged-code - (block $label$A - (if - (unreachable) - (block $block - (block $block0 - (block $label$B - (if - (unreachable) - (br_table $label$A $label$B - (unreachable) - ) - ) - ) - (return) - ) - ) - (block $block2 - (block $label$C - (if - (unreachable) - (br_table $label$A $label$C - (unreachable) - ) - ) - ) - (return) - ) - ) - ) - ) - (func $break-target-inside-all-good - (block $folding-inner0 - (block $label$A - (if - (unreachable) - (block $block - (block $block4 - (br $folding-inner0) - ) - ) - (block $block6 - (br $folding-inner0) - ) - ) - ) - ) - (block $label$B - (if - (unreachable) - (br_table $label$B $label$B - (unreachable) - ) - ) - ) - (return) - ) - (func $leave-inner-block-type - (block $label$1 - (drop - (block $label$2 - (block - (unreachable) - (unreachable) - ) - (br $label$1) - ) - ) - ) - (drop - (i32.const 1) - ) - ) -) -(module - (type $none_=>_i32 (func (result i32))) - (memory $0 (shared 1 1)) - (export "func_2224" (func $0)) - (func $0 (result i32) - (local $var$0 i32) - (if (result i32) - (i32.const 0) - (i32.load offset=22 - (local.get $var$0) - ) - (i32.atomic.load offset=22 - (local.get $var$0) - ) - ) - ) -) -(module - (type $0 (func)) - (type $i32_=>_none (func (param i32))) - (global $global$0 (mut i32) (i32.const 10)) - (func $determinism - (block $folding-inner0 - (block - (block $label$1 - (br_if $label$1 - (i32.const 1) - ) - (br $folding-inner0) - ) - (block $label$2 - (br_if $label$2 - (i32.const 0) - ) - (if - (global.get $global$0) - (block $block - (br $folding-inner0) - ) - ) - (unreachable) - ) - (if - (global.get $global$0) - (block $block1 - (br $folding-inner0) - ) - ) - (unreachable) - ) - ) - (global.set $global$0 - (i32.sub - (global.get $global$0) - (i32.const 1) - ) - ) - (unreachable) - ) - (func $careful-of-the-switch (param $0 i32) - (block $label$1 - (block $label$3 - (block $label$5 - (block $label$7 - (br_table $label$3 $label$7 - (i32.const 0) - ) - ) - (br $label$1) - ) - (block $label$8 - (br_table $label$3 $label$8 - (i32.const 0) - ) - ) - (br $label$1) - ) - (unreachable) - ) - ) -) diff --git a/test/passes/code-folding_enable-threads.wast b/test/passes/code-folding_enable-threads.wast deleted file mode 100644 index d9c1cc950..000000000 --- a/test/passes/code-folding_enable-threads.wast +++ /dev/null @@ -1,223 +0,0 @@ -(module - (type $13 (func (param f32))) - (table 282 282 funcref) - (memory $0 1 1) - (func $0 - (block $label$1 - (if - (i32.const 1) - (block $label$3 - (call_indirect (type $13) - (block $label$4 (result f32) ;; but this type may change dangerously - (nop) ;; fold this - (br $label$3) - ) - (i32.const 105) - ) - (nop) ;; with this - ) - ) - ) - ) - (func $negative-zero (result f32) - (if (result f32) - (i32.const 0) - (block $label$0 (result f32) - (f32.const 0) - ) - (block $label$1 (result f32) - (f32.const -0) - ) - ) - ) - (func $negative-zero-b (result f32) - (if (result f32) - (i32.const 0) - (block $label$0 (result f32) - (f32.const -0) - ) - (block $label$1 (result f32) - (f32.const -0) - ) - ) - ) - (func $negative-zero-c (result f32) - (if (result f32) - (i32.const 0) - (block $label$0 (result f32) - (f32.const 0) - ) - (block $label$1 (result f32) - (f32.const 0) - ) - ) - ) - (func $break-target-outside-of-return-merged-code - (block $label$A - (if - (unreachable) - (block - (block - (block $label$B - (if - (unreachable) - (br_table $label$A $label$B - (unreachable) - ) - ) - ) - (return) - ) - ) - (block - (block $label$C - (if - (unreachable) - (br_table $label$A $label$C ;; this all looks mergeable, but $label$A is outside - (unreachable) - ) - ) - ) - (return) - ) - ) - ) - ) - (func $break-target-inside-all-good - (block $label$A - (if - (unreachable) - (block - (block - (block $label$B - (if - (unreachable) - (br_table $label$B $label$B - (unreachable) - ) - ) - ) - (return) - ) - ) - (block - (block $label$C - (if - (unreachable) - (br_table $label$C $label$C ;; this all looks mergeable, and is, B ~~ C - (unreachable) - ) - ) - ) - (return) - ) - ) - ) - ) - (func $leave-inner-block-type - (block $label$1 - (drop - (block $label$2 (result i32) ;; leave this alone (otherwise, if we make it unreachable, we need to do more updating) - (br_if $label$2 - (unreachable) - (unreachable) - ) - (drop - (i32.const 1) - ) - (br $label$1) - ) - ) - (drop - (i32.const 1) - ) - ) - ) -) -(module - (memory $0 (shared 1 1)) - (export "func_2224" (func $0)) - (func $0 (result i32) - (local $var$0 i32) - (if (result i32) - (i32.const 0) - (i32.load offset=22 - (local.get $var$0) - ) - (i32.atomic.load offset=22 - (local.get $var$0) - ) - ) - ) -) -(module - (type $0 (func)) - (global $global$0 (mut i32) (i32.const 10)) - (func $determinism (; 0 ;) (type $0) - (block $label$1 - (br_if $label$1 - (i32.const 1) - ) - (global.set $global$0 - (i32.sub - (global.get $global$0) - (i32.const 1) - ) - ) - (unreachable) - ) - (block $label$2 - (br_if $label$2 - (i32.const 0) - ) - (if - (global.get $global$0) - (block - (global.set $global$0 - (i32.sub - (global.get $global$0) - (i32.const 1) - ) - ) - (unreachable) - ) - ) - (unreachable) - ) - (if - (global.get $global$0) - (block - (global.set $global$0 - (i32.sub - (global.get $global$0) - (i32.const 1) - ) - ) - (unreachable) - ) - ) - (unreachable) - ) - (func $careful-of-the-switch (param $0 i32) - (block $label$1 - (block $label$3 - (block $label$5 - (block $label$7 ;; this is block is equal to $label$8 when accounting for the internal 7/8 difference - (br_table $label$3 $label$7 ;; the reference to $label$3 must remain valid, cannot hoist out of it! - (i32.const 0) - ) - ) - (br $label$1) - ) - (block $label$8 - (br_table $label$3 $label$8 - (i32.const 0) - ) - ) - (br $label$1) - ) - (unreachable) - ) - ) -) - diff --git a/test/passes/code-pushing_ignore-implicit-traps.txt b/test/passes/code-pushing_ignore-implicit-traps.txt deleted file mode 100644 index 2d818d29a..000000000 --- a/test/passes/code-pushing_ignore-implicit-traps.txt +++ /dev/null @@ -1,460 +0,0 @@ -(module - (type $none_=>_none (func)) - (type $none_=>_i32 (func (result i32))) - (memory $0 1) - (func $push1 - (local $x i32) - (block $out - (br_if $out - (i32.const 2) - ) - (local.set $x - (i32.const 1) - ) - (drop - (local.get $x) - ) - ) - ) - (func $push2 - (local $x i32) - (local $y i32) - (block $out - (br_if $out - (i32.const 2) - ) - (local.set $x - (i32.const 1) - ) - (local.set $y - (i32.const 3) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $push1-twice - (local $x i32) - (block $out - (br_if $out - (i32.const 2) - ) - (br_if $out - (i32.const 3) - ) - (local.set $x - (i32.const 1) - ) - (drop - (local.get $x) - ) - ) - ) - (func $push1-twiceb - (local $x i32) - (block $out - (br_if $out - (i32.const 2) - ) - (nop) - (br_if $out - (i32.const 3) - ) - (local.set $x - (i32.const 1) - ) - (drop - (local.get $x) - ) - ) - ) - (func $push2-twice - (local $x i32) - (local $y i32) - (block $out - (br_if $out - (i32.const 2) - ) - (br_if $out - (i32.const 2) - ) - (local.set $x - (i32.const 1) - ) - (local.set $y - (i32.const 3) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $ignore-last - (local $x i32) - (block $out - (local.set $x - (i32.const 1) - ) - (br_if $out - (i32.const 2) - ) - ) - ) - (func $ignore-last2 - (local $x i32) - (block $out - (local.set $x - (i32.const 1) - ) - (nop) - (nop) - (br_if $out - (i32.const 2) - ) - ) - ) - (func $push-if - (local $x i32) - (block $out - (if - (i32.const 2) - (nop) - ) - (local.set $x - (i32.const 1) - ) - (drop - (local.get $x) - ) - ) - ) - (func $push-dropped (result i32) - (local $x i32) - (block $out (result i32) - (drop - (br_if $out - (i32.const 2) - (i32.const 3) - ) - ) - (local.set $x - (i32.const 1) - ) - (drop - (local.get $x) - ) - (i32.const 4) - ) - ) - (func $push-past-stuff - (local $x i32) - (block $out - (call $push-past-stuff) - (drop - (i32.const 1) - ) - (br_if $out - (i32.const 2) - ) - (local.set $x - (i32.const 1) - ) - (drop - (local.get $x) - ) - ) - ) - (func $fail-then-push - (local $x i32) - (local $y i32) - (block $out - (local.set $x - (i32.const 1) - ) - (drop - (local.get $x) - ) - (br_if $out - (i32.const 2) - ) - (br_if $out - (i32.const 3) - ) - (local.set $y - (i32.const 1) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $used - (local $x i32) - (block $out - (local.set $x - (i32.const 1) - ) - (br_if $out - (local.get $x) - ) - (drop - (local.get $x) - ) - ) - ) - (func $not-sfa - (local $x i32) - (local.set $x - (i32.const 1) - ) - (block $out - (local.set $x - (i32.const 1) - ) - (br_if $out - (i32.const 2) - ) - (drop - (local.get $x) - ) - ) - ) - (func $not-sfa2 - (local $x i32) - (drop - (local.get $x) - ) - (block $out - (local.set $x - (i32.const 1) - ) - (br_if $out - (i32.const 2) - ) - (drop - (local.get $x) - ) - ) - ) - (func $used-out - (local $x i32) - (block $out - (local.set $x - (i32.const 1) - ) - (br_if $out - (i32.const 2) - ) - (drop - (local.get $x) - ) - ) - (drop - (local.get $x) - ) - ) - (func $value-might-interfere - (local $x i32) - (block $out - (br_if $out - (i32.const 2) - ) - (local.set $x - (i32.load - (i32.const 0) - ) - ) - (drop - (local.get $x) - ) - ) - ) - (func $value-interferes - (local $x i32) - (block $out - (local.set $x - (i32.load - (i32.const 0) - ) - ) - (i32.store - (i32.const 1) - (i32.const 3) - ) - (br_if $out - (i32.const 2) - ) - (drop - (local.get $x) - ) - ) - ) - (func $value-interferes-accumulation - (local $x i32) - (block $out - (local.set $x - (i32.load - (i32.const 0) - ) - ) - (nop) - (i32.store - (i32.const 1) - (i32.const 3) - ) - (nop) - (br_if $out - (i32.const 2) - ) - (drop - (local.get $x) - ) - ) - ) - (func $value-interferes-in-pushpoint - (local $x i32) - (block $out - (local.set $x - (i32.load - (i32.const 0) - ) - ) - (if - (i32.const 1) - (call $value-interferes) - ) - (drop - (local.get $x) - ) - ) - ) - (func $values-might-interfere - (local $x i32) - (local $y i32) - (block $out - (local.set $x - (call $push-dropped) - ) - (local.set $y - (call $push-dropped) - ) - (br_if $out - (i32.const 2) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $unpushed-interferes - (local $x i32) - (local $y i32) - (block $out - (local.set $x - (call $push-dropped) - ) - (local.set $y - (call $push-dropped) - ) - (br_if $out - (i32.const 2) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (drop - (local.get $y) - ) - ) - (func $unpushed-ignorable - (local $x i32) - (local $y i32) - (block $out - (local.set $x - (i32.const 1) - ) - (br_if $out - (i32.const 2) - ) - (local.set $y - (i32.const 3) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - (drop - (local.get $x) - ) - ) - (func $unpushed-ignorable-side-effect - (local $x i32) - (local $y i32) - (block $out - (local.set $x - (call $push-dropped) - ) - (br_if $out - (i32.const 2) - ) - (local.set $y - (i32.const 3) - ) - (drop - (local.get $x) - ) - (drop - (local.get $y) - ) - ) - ) - (func $unpushed-side-effect-into-drop - (local $x i32) - (block $out - (local.set $x - (call $push-dropped) - ) - (br_if $out - (i32.const 1) - ) - (drop - (local.get $x) - ) - ) - ) - (func $unpushed-side-effect-into-if - (local $x i32) - (block $out - (local.set $x - (call $push-dropped) - ) - (br_if $out - (i32.const 1) - ) - (if - (local.get $x) - (nop) - ) - ) - ) -) diff --git a/test/passes/code-pushing_ignore-implicit-traps.wast b/test/passes/code-pushing_ignore-implicit-traps.wast deleted file mode 100644 index 3f70c24a6..000000000 --- a/test/passes/code-pushing_ignore-implicit-traps.wast +++ /dev/null @@ -1,249 +0,0 @@ -(module - (memory 1) - (func $push1 - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - ) - ) - (func $push2 - (local $x i32) - (local $y i32) - (block $out - (local.set $x (i32.const 1)) - (local.set $y (i32.const 3)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - (drop (local.get $y)) - ) - ) - (func $push1-twice - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (br_if $out (i32.const 2)) - (br_if $out (i32.const 3)) - (drop (local.get $x)) - ) - ) - (func $push1-twiceb - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (br_if $out (i32.const 2)) - (nop) - (br_if $out (i32.const 3)) - (drop (local.get $x)) - ) - ) - (func $push2-twice - (local $x i32) - (local $y i32) - (block $out - (local.set $x (i32.const 1)) - (local.set $y (i32.const 3)) - (br_if $out (i32.const 2)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - (drop (local.get $y)) - ) - ) - (func $ignore-last - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (br_if $out (i32.const 2)) - ) - ) - (func $ignore-last2 - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (nop) - (nop) - (br_if $out (i32.const 2)) - ) - ) - (func $push-if - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (if (i32.const 2) (nop)) - (drop (local.get $x)) - ) - ) - (func $push-dropped (result i32) - (local $x i32) - (block $out (result i32) - (local.set $x (i32.const 1)) - (drop (br_if $out (i32.const 2) (i32.const 3))) - (drop (local.get $x)) - (i32.const 4) - ) - ) - (func $push-past-stuff - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (call $push-past-stuff) - (drop (i32.const 1)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - ) - ) - (func $fail-then-push - (local $x i32) - (local $y i32) - (block $out - (local.set $x (i32.const 1)) - (drop (local.get $x)) - (br_if $out (i32.const 2)) - (local.set $y (i32.const 1)) - (br_if $out (i32.const 3)) - (drop (local.get $x)) - (drop (local.get $y)) - ) - ) - ;; and now for stuff that should *not* be pushed - (func $used - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (br_if $out (local.get $x)) - (drop (local.get $x)) - ) - ) - (func $not-sfa - (local $x i32) - (local.set $x (i32.const 1)) - (block $out - (local.set $x (i32.const 1)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - ) - ) - (func $not-sfa2 - (local $x i32) - (drop (local.get $x)) - (block $out - (local.set $x (i32.const 1)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - ) - ) - (func $used-out - (local $x i32) - (block $out - (local.set $x (i32.const 1)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - ) - (drop (local.get $x)) - ) - (func $value-might-interfere ;; but doesn't - (local $x i32) - (block $out - (local.set $x (i32.load (i32.const 0))) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - ) - ) - (func $value-interferes - (local $x i32) - (block $out - (local.set $x (i32.load (i32.const 0))) - (i32.store (i32.const 1) (i32.const 3)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - ) - ) - (func $value-interferes-accumulation - (local $x i32) - (block $out - (local.set $x (i32.load (i32.const 0))) - (nop) - (i32.store (i32.const 1) (i32.const 3)) - (nop) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - ) - ) - (func $value-interferes-in-pushpoint - (local $x i32) - (block $out - (local.set $x (i32.load (i32.const 0))) - (if (i32.const 1) - (call $value-interferes) - ) - (drop (local.get $x)) - ) - ) - (func $values-might-interfere ;; they don't, as we keep the order - but here their side effects prevent pushing - (local $x i32) - (local $y i32) - (block $out - (local.set $x (call $push-dropped)) - (local.set $y (call $push-dropped)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - (drop (local.get $y)) - ) - ) - (func $unpushed-interferes - (local $x i32) - (local $y i32) - (block $out - (local.set $x (call $push-dropped)) - (local.set $y (call $push-dropped)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - (drop (local.get $y)) - ) - (drop (local.get $y)) ;; $y can't be pushed, so x can't be - ) - (func $unpushed-ignorable - (local $x i32) - (local $y i32) - (block $out - (local.set $x (i32.const 1)) - (local.set $y (i32.const 3)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - (drop (local.get $y)) - ) - (drop (local.get $x)) ;; $x can't be pushed, but y doesn't care - ) - (func $unpushed-ignorable-side-effect - (local $x i32) - (local $y i32) - (block $out - (local.set $x (call $push-dropped)) ;; $x can't be pushed, but y doesn't care - (local.set $y (i32.const 3)) - (br_if $out (i32.const 2)) - (drop (local.get $x)) - (drop (local.get $y)) - ) - ) - (func $unpushed-side-effect-into-drop - (local $x i32) - (block $out - (local.set $x (call $push-dropped)) - (br_if $out (i32.const 1)) - (drop (local.get $x)) - ) - ) - (func $unpushed-side-effect-into-if - (local $x i32) - (block $out - (local.set $x (call $push-dropped)) - (br_if $out (i32.const 1)) - (if - (local.get $x) - (nop) - ) - ) - ) -) - diff --git a/test/passes/const-hoisting.txt b/test/passes/const-hoisting.txt deleted file mode 100644 index b1ee70655..000000000 --- a/test/passes/const-hoisting.txt +++ /dev/null @@ -1,629 +0,0 @@ -(module - (type $none_=>_none (func)) - (func $10-of-each - (local $0 i32) - (local $1 i32) - (local $2 i32) - (local $3 i32) - (local $4 i32) - (local $5 i32) - (block - (local.set $0 - (i32.const 8192) - ) - (local.set $1 - (i32.const 1048575) - ) - (local.set $2 - (i32.const 1048576) - ) - (local.set $3 - (i32.const -8193) - ) - (local.set $4 - (i32.const -1048576) - ) - (local.set $5 - (i32.const -1048577) - ) - ) - (block - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - (drop - (i32.const 0) - ) - (drop - (i32.const 63) - ) - (drop - (i32.const 64) - ) - (drop - (i32.const 8191) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $2) - ) - (drop - (i32.const -64) - ) - (drop - (i32.const -65) - ) - (drop - (i32.const -8192) - ) - (drop - (local.get $3) - ) - (drop - (local.get $4) - ) - (drop - (local.get $5) - ) - ) - ) - (func $floats-10-times - (local $0 f32) - (local $1 f64) - (block - (local.set $0 - (f32.const 0) - ) - (local.set $1 - (f64.const 0) - ) - ) - (block - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - (drop - (local.get $0) - ) - (drop - (local.get $1) - ) - ) - ) - (func $too-few - (drop - (i32.const 8192) - ) - (drop - (i32.const 8192) - ) - (drop - (i32.const 8192) - ) - (drop - (i32.const 8192) - ) - (drop - (i32.const 8192) - ) - ) - (func $just-enough - (local $0 i32) - (block - (local.set $0 - (i32.const 8192) - ) - ) - (block - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - ) - ) - (func $too-few-b - (drop - (i32.const 1048576) - ) - (drop - (i32.const 1048576) - ) - (drop - (i32.const 1048576) - ) - ) - (func $enough-b - (local $0 i32) - (block - (local.set $0 - (i32.const 1048576) - ) - ) - (block - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - ) - ) - (func $too-few-c - (drop - (f32.const 0) - ) - (drop - (f32.const 0) - ) - (drop - (f32.const 0) - ) - ) - (func $enough-c - (local $0 f32) - (block - (local.set $0 - (f32.const 0) - ) - ) - (block - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - ) - ) - (func $too-few-d - (drop - (f64.const 0) - ) - ) - (func $enough-d - (local $0 f64) - (block - (local.set $0 - (f64.const 0) - ) - ) - (block - (drop - (local.get $0) - ) - (drop - (local.get $0) - ) - ) - ) -) diff --git a/test/passes/const-hoisting.wast b/test/passes/const-hoisting.wast deleted file mode 100644 index 66f79bc14..000000000 --- a/test/passes/const-hoisting.wast +++ /dev/null @@ -1,201 +0,0 @@ -(module - (func $10-of-each - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - (drop (i32.const 0)) ;; 1 byte - (drop (i32.const 63)) ;; 1 byte - (drop (i32.const 64)) ;; 2 bytes - (drop (i32.const 8191)) ;; 2 bytes - (drop (i32.const 8192)) ;; 3 bytes - (drop (i32.const 1048575)) ;; 3 bytes - (drop (i32.const 1048576)) ;; 4 bytes - (drop (i32.const -64)) ;; 1 byte - (drop (i32.const -65)) ;; 2 bytes - (drop (i32.const -8192)) ;; 2 bytes - (drop (i32.const -8193)) ;; 3 bytes - (drop (i32.const -1048576)) ;; 3 bytes - (drop (i32.const -1048577)) ;; 4 bytes - ) - (func $floats-10-times - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - (drop (f32.const 0)) ;; 4 bytes - (drop (f64.const 0)) ;; 8 bytes - ) - (func $too-few - (drop (i32.const 8192)) ;; 3 bytes, need 6 appearances - (drop (i32.const 8192)) - (drop (i32.const 8192)) - (drop (i32.const 8192)) - (drop (i32.const 8192)) - ) - (func $just-enough - (drop (i32.const 8192)) ;; 3 bytes, need 6 appearances - (drop (i32.const 8192)) - (drop (i32.const 8192)) - (drop (i32.const 8192)) - (drop (i32.const 8192)) - (drop (i32.const 8192)) - ) - (func $too-few-b - (drop (i32.const 1048576)) ;; 4 bytes, need 4 appearances - (drop (i32.const 1048576)) - (drop (i32.const 1048576)) - ) - (func $enough-b - (drop (i32.const 1048576)) ;; 4 bytes, need 4 appearances - (drop (i32.const 1048576)) - (drop (i32.const 1048576)) - (drop (i32.const 1048576)) - ) - (func $too-few-c - (drop (f32.const 0)) ;; 4 bytes, need 4 appearances - (drop (f32.const 0)) - (drop (f32.const 0)) - ) - (func $enough-c - (drop (f32.const 0)) ;; 4 bytes, need 4 appearances - (drop (f32.const 0)) - (drop (f32.const 0)) - (drop (f32.const 0)) - ) - (func $too-few-d - (drop (f64.const 0)) ;; 8 bytes, need 2 appearances - ) - (func $enough-d - (drop (f64.const 0)) ;; 4 bytes, need 4 appearances - (drop (f64.const 0)) - ) -) - |