summaryrefslogtreecommitdiff
path: root/test/passes/asyncify_pass-arg=asyncify-whitelist@foo,bar.txt
diff options
context:
space:
mode:
authorHeejin Ahn <aheejin@gmail.com>2019-12-12 23:01:56 -0800
committerGitHub <noreply@github.com>2019-12-12 23:01:56 -0800
commitfbce98c6fdeb2a78ef58079ce1c2a385a17357d6 (patch)
treece3bcfcb7b9861fc82cdd545146aa19d143876ec /test/passes/asyncify_pass-arg=asyncify-whitelist@foo,bar.txt
parent16c6b44da64630cd6906433cf35edabcea93cffc (diff)
downloadbinaryen-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-whitelist@foo,bar.txt')
-rw-r--r--test/passes/asyncify_pass-arg=asyncify-whitelist@foo,bar.txt89
1 files changed, 34 insertions, 55 deletions
diff --git a/test/passes/asyncify_pass-arg=asyncify-whitelist@foo,bar.txt b/test/passes/asyncify_pass-arg=asyncify-whitelist@foo,bar.txt
index 27f728dc7..d8512cd7e 100644
--- a/test/passes/asyncify_pass-arg=asyncify-whitelist@foo,bar.txt
+++ b/test/passes/asyncify_pass-arg=asyncify-whitelist@foo,bar.txt
@@ -47,38 +47,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)
)
)
)
@@ -143,38 +134,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)
)
)
)
@@ -203,15 +185,12 @@
)
(func $baz (; 3 ;)
(call $import)
- (nop)
)
(func $other1 (; 4 ;)
(call $foo)
- (nop)
)
(func $other2 (; 5 ;)
(call $baz)
- (nop)
)
(func $asyncify_start_unwind (; 6 ;) (param $0 i32)
(global.set $__asyncify_state