diff options
author | Alon Zakai <alonzakai@gmail.com> | 2017-05-17 11:29:11 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-17 11:29:11 -0700 |
commit | bb1c44a3f975bf8fb72216b9c04bcd34e31bd815 (patch) | |
tree | 90c6dc049931981ef28bc4728113528b1627595b /test/passes/optimize-instructions.txt | |
parent | 443cfe929d094e34d8d84270965c738743d06585 (diff) | |
download | binaryen-bb1c44a3f975bf8fb72216b9c04bcd34e31bd815.tar.gz binaryen-bb1c44a3f975bf8fb72216b9c04bcd34e31bd815.tar.bz2 binaryen-bb1c44a3f975bf8fb72216b9c04bcd34e31bd815.zip |
optimize if and select in the case their values are identical (#1013)
Diffstat (limited to 'test/passes/optimize-instructions.txt')
-rw-r--r-- | test/passes/optimize-instructions.txt | 82 |
1 files changed, 81 insertions, 1 deletions
diff --git a/test/passes/optimize-instructions.txt b/test/passes/optimize-instructions.txt index 03edc6e4c..2b33bd700 100644 --- a/test/passes/optimize-instructions.txt +++ b/test/passes/optimize-instructions.txt @@ -406,7 +406,7 @@ (if i32 (i32.const 1) (call $ne0) - (call $ne0) + (call $ne1) ) (nop) ) @@ -418,6 +418,9 @@ (nop) ) ) + (func $ne1 (type $2) (result i32) + (unreachable) + ) (func $load-off-2 (type $3) (param $0 i32) (result i32) (i32.store (i32.const 6) @@ -1882,4 +1885,81 @@ ) ) ) + (func $if-parallel (type $4) (param $0 i32) (param $1 i32) + (drop + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (drop + (block i32 + (drop + (tee_local $0 + (get_local $1) + ) + ) + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + ) + (func $select-parallel (type $4) (param $0 i32) (param $1 i32) + (drop + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + (drop + (select + (tee_local $0 + (get_local $1) + ) + (tee_local $0 + (get_local $1) + ) + (get_local $0) + ) + ) + (drop + (block i32 + (drop + (tee_local $0 + (get_local $1) + ) + ) + (i32.add + (get_local $1) + (i32.const 1) + ) + ) + ) + (drop + (select + (tee_local $0 + (get_local $1) + ) + (tee_local $0 + (get_local $1) + ) + (tee_local $0 + (get_local $1) + ) + ) + ) + (drop + (select + (tee_local $0 + (get_local $1) + ) + (tee_local $0 + (get_local $1) + ) + (unreachable) + ) + ) + ) ) |