diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-01-08 09:46:46 -0800 |
---|---|---|
committer | Alon Zakai <alonzakai@gmail.com> | 2016-01-08 09:47:10 -0800 |
commit | f4958962bce2035f9de1ca409672607e68e4b5a3 (patch) | |
tree | 1d4925d04db3ae2d9dcaea33016d575a513c8538 /test | |
parent | 2dc5714c7b80d4d53dbebae2dd851d4b056266ab (diff) | |
download | binaryen-f4958962bce2035f9de1ca409672607e68e4b5a3.tar.gz binaryen-f4958962bce2035f9de1ca409672607e68e4b5a3.tar.bz2 binaryen-f4958962bce2035f9de1ca409672607e68e4b5a3.zip |
optimize if_else in RemoveUnusedBrs
Diffstat (limited to 'test')
-rw-r--r-- | test/passes/remove-unused-brs.txt | 104 | ||||
-rw-r--r-- | test/passes/remove-unused-brs.wast | 49 |
2 files changed, 153 insertions, 0 deletions
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt index af5b9d1ed..8e03d583e 100644 --- a/test/passes/remove-unused-brs.txt +++ b/test/passes/remove-unused-brs.txt @@ -103,6 +103,60 @@ ) ) ) + (func $b12-yes (result i32) + (block $topmost + (if_else + (i32.const 1) + (block $block0 + (i32.const 12) + (br $topmost + (i32.const 1) + ) + ) + (block $block1 + (i32.const 27) + (br $topmost + (i32.const 2) + ) + ) + ) + ) + ) + (func $b13 (result i32) + (block $topmost + (if_else + (i32.const 1) + (block $block0 + (i32.const 12) + (br_if + (i32.const 1) + $topmost + (i32.const 1) + ) + ) + (block $block1 + (i32.const 27) + (br $topmost + (i32.const 2) + ) + ) + ) + (i32.const 3) + ) + ) + (func $b14 (result i32) + (block $topmost + (if_else + (i32.const 1) + (block $block0 + (i32.const 12) + ) + (block $block1 + (i32.const 27) + ) + ) + ) + ) ) (module (memory 16777216 16777216) @@ -203,4 +257,54 @@ ) ) ) + (func $b12-yes (result i32) + (block $topmost + (if_else + (i32.const 1) + (block $block0 + (i32.const 12) + (i32.const 1) + ) + (block $block1 + (i32.const 27) + (i32.const 2) + ) + ) + ) + ) + (func $b13 (result i32) + (block $topmost + (if_else + (i32.const 1) + (block $block0 + (i32.const 12) + (br_if + (i32.const 1) + $topmost + (i32.const 1) + ) + ) + (block $block1 + (i32.const 27) + (br $topmost + (i32.const 2) + ) + ) + ) + (i32.const 3) + ) + ) + (func $b14 (result i32) + (block $topmost + (if_else + (i32.const 1) + (block $block0 + (i32.const 12) + ) + (block $block1 + (i32.const 27) + ) + ) + ) + ) ) diff --git a/test/passes/remove-unused-brs.wast b/test/passes/remove-unused-brs.wast index b4a2cc5fe..8f90c75b0 100644 --- a/test/passes/remove-unused-brs.wast +++ b/test/passes/remove-unused-brs.wast @@ -88,5 +88,54 @@ ) ) ) + (func $b12-yes (result i32) + (block $topmost + (if_else (i32.const 1) + (block + (i32.const 12) + (br $topmost + (i32.const 1) + ) + ) + (block + (i32.const 27) + (br $topmost + (i32.const 2) + ) + ) + ) + ) + ) + (func $b13 (result i32) + (block $topmost + (if_else (i32.const 1) + (block + (i32.const 12) + (br_if (i32.const 1) $topmost + (i32.const 1) + ) + ) + (block + (i32.const 27) + (br $topmost + (i32.const 2) + ) + ) + ) + (i32.const 3) + ) + ) + (func $b14 (result i32) + (block $topmost + (if_else (i32.const 1) + (block + (i32.const 12) + ) + (block + (i32.const 27) + ) + ) + ) + ) ) |