diff options
author | Heejin Ahn <aheejin@gmail.com> | 2019-12-12 23:01:56 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-12 23:01:56 -0800 |
commit | fbce98c6fdeb2a78ef58079ce1c2a385a17357d6 (patch) | |
tree | ce3bcfcb7b9861fc82cdd545146aa19d143876ec /test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt | |
parent | 16c6b44da64630cd6906433cf35edabcea93cffc (diff) | |
download | binaryen-fbce98c6fdeb2a78ef58079ce1c2a385a17357d6.tar.gz binaryen-fbce98c6fdeb2a78ef58079ce1c2a385a17357d6.tar.bz2 binaryen-fbce98c6fdeb2a78ef58079ce1c2a385a17357d6.zip |
Remove redundant instructions in Flatten (#2524)
When the expression type is none, it does not seem to be necessary to
make it a prelude and insert a nop. This also results in unnecessary
blocks that contains an expression with a nop, which can be reduced to
just the expression. This also adds some newlines to improve
readability.
Diffstat (limited to 'test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt')
-rw-r--r-- | test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt | 89 |
1 files changed, 34 insertions, 55 deletions
diff --git a/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt b/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt index f15153c45..538060f41 100644 --- a/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt +++ b/test/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.txt @@ -11,11 +11,9 @@ (export "asyncify_stop_rewind" (func $asyncify_stop_rewind)) (func $foo (; 1 ;) (call $import) - (nop) ) (func $bar (; 2 ;) (call $import) - (nop) ) (func $baz (; 3 ;) (local $0 i32) @@ -55,38 +53,29 @@ ) ) ) - (block - (if - (if (result i32) + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 0) + ) + ) + (block + (call $import) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $1) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $import) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) ) @@ -115,7 +104,6 @@ ) (func $other1 (; 4 ;) (call $foo) - (nop) ) (func $other2 (; 5 ;) (local $0 i32) @@ -155,38 +143,29 @@ ) ) ) - (block - (if - (if (result i32) + (if + (if (result i32) + (i32.eq + (global.get $__asyncify_state) + (i32.const 0) + ) + (i32.const 1) + (i32.eq + (local.get $1) + (i32.const 0) + ) + ) + (block + (call $baz) + (if (i32.eq (global.get $__asyncify_state) - (i32.const 0) + (i32.const 1) ) - (i32.const 1) - (i32.eq - (local.get $1) + (br $__asyncify_unwind (i32.const 0) ) ) - (block - (call $baz) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 1) - ) - (br $__asyncify_unwind - (i32.const 0) - ) - ) - ) - ) - (if - (i32.eq - (global.get $__asyncify_state) - (i32.const 0) - ) - (nop) ) ) ) |