diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-07 16:22:46 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-07 16:23:14 -0800 |
commit | d0863fa49acc642353c99aa9c46a1aacc4be57d0 (patch) | |
tree | 6ec2dbeff39f1a2293d794233ce4107721255ac0 /test | |
parent | 5110e2adc9351c7df283419041c154bf79eaddc7 (diff) | |
download | binaryen-d0863fa49acc642353c99aa9c46a1aacc4be57d0.tar.gz binaryen-d0863fa49acc642353c99aa9c46a1aacc4be57d0.tar.bz2 binaryen-d0863fa49acc642353c99aa9c46a1aacc4be57d0.zip |
optimize RemoveUnusedBrs some more - handle values #84
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/remove-unused-brs.txt | 122 | ||||
-rw-r--r-- | test/passes/remove-unused-brs.wast | 44 |
2 files changed, 162 insertions, 4 deletions
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt index b42347fc3..af5b9d1ed 100644 --- a/test/passes/remove-unused-brs.txt +++ b/test/passes/remove-unused-brs.txt @@ -44,6 +44,65 @@ ) ) ) + (func $b6 (param $i1 i32) + (block $topmost + (br_if + (i32.const 1) + $topmost + ) + ) + ) + (func $b7 (param $i1 i32) + (block $topmost + (br_if + (i32.const 1) + $topmost + (i32.const 0) + ) + ) + ) + (func $b8 (param $i1 i32) + (block $topmost + (block $inner + (br_if + (i32.const 1) + $topmost + ) + ) + ) + ) + (func $b9 (param $i1 i32) + (block $topmost + (block $inner + (br_if + (i32.const 1) + $inner + ) + ) + ) + ) + (func $b10 (param $i1 i32) + (block $topmost + (block $inner + (br_if + (i32.const 1) + $topmost + (i32.const 0) + ) + ) + ) + ) + (func $b11 (param $i1 i32) + (block $topmost + (block $inner + (br_if + (i32.const 1) + $inner + (i32.const 0) + ) + ) + ) + ) ) (module (memory 16777216 16777216) @@ -53,9 +112,7 @@ ) (func $b1 (param $i1 i32) (block $topmost - (br $topmost - (i32.const 0) - ) + (i32.const 0) ) ) (func $b2 (param $i1 i32) @@ -83,7 +140,64 @@ (func $b5 (param $i1 i32) (block $topmost (block $inner - (br $inner + (i32.const 0) + ) + ) + ) + (func $b6 (param $i1 i32) + (block $topmost + (br_if + (i32.const 1) + $topmost + ) + ) + ) + (func $b7 (param $i1 i32) + (block $topmost + (br_if + (i32.const 1) + $topmost + (i32.const 0) + ) + ) + ) + (func $b8 (param $i1 i32) + (block $topmost + (block $inner + (br_if + (i32.const 1) + $topmost + ) + ) + ) + ) + (func $b9 (param $i1 i32) + (block $topmost + (block $inner + (br_if + (i32.const 1) + $inner + ) + ) + ) + ) + (func $b10 (param $i1 i32) + (block $topmost + (block $inner + (br_if + (i32.const 1) + $topmost + (i32.const 0) + ) + ) + ) + ) + (func $b11 (param $i1 i32) + (block $topmost + (block $inner + (br_if + (i32.const 1) + $inner (i32.const 0) ) ) diff --git a/test/passes/remove-unused-brs.wast b/test/passes/remove-unused-brs.wast index e03ba8847..b4a2cc5fe 100644 --- a/test/passes/remove-unused-brs.wast +++ b/test/passes/remove-unused-brs.wast @@ -44,5 +44,49 @@ ) ) ) + (func $b6 (param $i1 i32) + (block $topmost + (br_if (i32.const 1) $topmost) + ) + ) + (func $b7 (param $i1 i32) + (block $topmost + (br_if (i32.const 1) $topmost + (i32.const 0) + ) + ) + ) + (func $b8 (param $i1 i32) + (block $topmost + (block $inner + (br_if (i32.const 1) $topmost) + ) + ) + ) + (func $b9 (param $i1 i32) + (block $topmost + (block $inner + (br_if (i32.const 1) $inner) + ) + ) + ) + (func $b10 (param $i1 i32) + (block $topmost + (block $inner + (br_if (i32.const 1) $topmost + (i32.const 0) + ) + ) + ) + ) + (func $b11 (param $i1 i32) + (block $topmost + (block $inner + (br_if (i32.const 1) $inner + (i32.const 0) + ) + ) + ) + ) ) |