summaryrefslogtreecommitdiff
path: root/test/passes
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-05-19 19:57:14 -0700
committerAlon Zakai <alonzakai@gmail.com>2016-05-19 19:57:14 -0700
commit244da920eedafec42da4e91b83c09d0021a36a7f (patch)
treecb3afcad11617e0fc7100c85ecb083f24c88fdde /test/passes
parent373cfe3a4364d657b04ea9c35e84324e9edec097 (diff)
downloadbinaryen-244da920eedafec42da4e91b83c09d0021a36a7f.tar.gz
binaryen-244da920eedafec42da4e91b83c09d0021a36a7f.tar.bz2
binaryen-244da920eedafec42da4e91b83c09d0021a36a7f.zip
notice only branches out in EffectAnalyzer, internal control flow can be ignored (#530)
Diffstat (limited to 'test/passes')
-rw-r--r--test/passes/simplify-locals.txt188
-rw-r--r--test/passes/vacuum.txt22
2 files changed, 95 insertions, 115 deletions
diff --git a/test/passes/simplify-locals.txt b/test/passes/simplify-locals.txt
index d97e8fc33..2310366de 100644
--- a/test/passes/simplify-locals.txt
+++ b/test/passes/simplify-locals.txt
@@ -276,106 +276,63 @@
(set_local $$rem
(get_local $__stackBase__)
)
- (set_local $$1$0
- (i32.or
- (i32.shr_s
- (get_local $$a$1)
- (i32.const 31)
- )
- (i32.shl
- (if
- (i32.lt_s
- (get_local $$a$1)
- (i32.const 0)
- )
- (i32.const -1)
- (i32.const 0)
- )
- (i32.const 1)
- )
- )
- )
- (set_local $$1$1
- (i32.or
- (i32.shr_s
- (if
- (i32.lt_s
- (get_local $$a$1)
- (i32.const 0)
- )
- (i32.const -1)
- (i32.const 0)
- )
- (i32.const 31)
- )
- (i32.shl
- (if
- (i32.lt_s
- (get_local $$a$1)
- (i32.const 0)
- )
- (i32.const -1)
- (i32.const 0)
- )
- (i32.const 1)
- )
- )
- )
- (set_local $$2$0
- (i32.or
- (i32.shr_s
- (get_local $$b$1)
- (i32.const 31)
- )
- (i32.shl
- (if
- (i32.lt_s
- (get_local $$b$1)
- (i32.const 0)
- )
- (i32.const -1)
- (i32.const 0)
- )
- (i32.const 1)
- )
- )
- )
- (set_local $$2$1
- (i32.or
- (i32.shr_s
- (if
- (i32.lt_s
- (get_local $$b$1)
- (i32.const 0)
- )
- (i32.const -1)
- (i32.const 0)
- )
- (i32.const 31)
- )
- (i32.shl
- (if
- (i32.lt_s
- (get_local $$b$1)
- (i32.const 0)
- )
- (i32.const -1)
- (i32.const 0)
- )
- (i32.const 1)
- )
- )
- )
+ (nop)
+ (nop)
+ (nop)
+ (nop)
(nop)
(nop)
(call_import $___udivmoddi4
(call_import $_i64Subtract
(i32.xor
- (get_local $$1$0)
+ (set_local $$1$0
+ (i32.or
+ (i32.shr_s
+ (get_local $$a$1)
+ (i32.const 31)
+ )
+ (i32.shl
+ (if
+ (i32.lt_s
+ (get_local $$a$1)
+ (i32.const 0)
+ )
+ (i32.const -1)
+ (i32.const 0)
+ )
+ (i32.const 1)
+ )
+ )
+ )
(get_local $$a$0)
)
(i32.xor
- (get_local $$1$1)
+ (set_local $$1$1
+ (i32.or
+ (i32.shr_s
+ (if
+ (i32.lt_s
+ (get_local $$a$1)
+ (i32.const 0)
+ )
+ (i32.const -1)
+ (i32.const 0)
+ )
+ (i32.const 31)
+ )
+ (i32.shl
+ (if
+ (i32.lt_s
+ (get_local $$a$1)
+ (i32.const 0)
+ )
+ (i32.const -1)
+ (i32.const 0)
+ )
+ (i32.const 1)
+ )
+ )
+ )
(get_local $$a$1)
)
(get_local $$1$0)
@@ -386,11 +343,54 @@
)
(call_import $_i64Subtract
(i32.xor
- (get_local $$2$0)
+ (set_local $$2$0
+ (i32.or
+ (i32.shr_s
+ (get_local $$b$1)
+ (i32.const 31)
+ )
+ (i32.shl
+ (if
+ (i32.lt_s
+ (get_local $$b$1)
+ (i32.const 0)
+ )
+ (i32.const -1)
+ (i32.const 0)
+ )
+ (i32.const 1)
+ )
+ )
+ )
(get_local $$b$0)
)
(i32.xor
- (get_local $$2$1)
+ (set_local $$2$1
+ (i32.or
+ (i32.shr_s
+ (if
+ (i32.lt_s
+ (get_local $$b$1)
+ (i32.const 0)
+ )
+ (i32.const -1)
+ (i32.const 0)
+ )
+ (i32.const 31)
+ )
+ (i32.shl
+ (if
+ (i32.lt_s
+ (get_local $$b$1)
+ (i32.const 0)
+ )
+ (i32.const -1)
+ (i32.const 0)
+ )
+ (i32.const 1)
+ )
+ )
+ )
(get_local $$b$1)
)
(get_local $$2$0)
diff --git a/test/passes/vacuum.txt b/test/passes/vacuum.txt
index fb3731dba..75737713b 100644
--- a/test/passes/vacuum.txt
+++ b/test/passes/vacuum.txt
@@ -1,27 +1,7 @@
(module
(memory 256 256)
(func $b
- (block $waka1
- (br $waka1)
- )
- (block $waka2
- (br $waka2)
- )
- (block $waka3
- (br_table $waka3 $waka3 $waka3
- (i32.const 57)
- )
- )
- (if
- (i32.eqz
- (i32.const 100)
- )
- (i32.const 101)
- )
- (if
- (i32.const 102)
- (i32.const 103)
- )
+ (nop)
)
(func $l
(local $x i32)