summaryrefslogtreecommitdiff
path: root/test/unit.fromasm.imprecise
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2018-04-10 10:44:07 -0700
committerGitHub <noreply@github.com>2018-04-10 10:44:07 -0700
commitdf19ebde22c48fba43f88c71c4870f53b8974f93 (patch)
treec9e44c9d05045954c082fabd5eaf4f4d465e7aa7 /test/unit.fromasm.imprecise
parent27517701d611ad7de5b467eaee2f0d589180465f (diff)
downloadbinaryen-df19ebde22c48fba43f88c71c4870f53b8974f93.tar.gz
binaryen-df19ebde22c48fba43f88c71c4870f53b8974f93.tar.bz2
binaryen-df19ebde22c48fba43f88c71c4870f53b8974f93.zip
br_table optimizations (#1502)
Inspired by #1501 * remove unneeded appearances of the default switch target (at the front or back of the list of targets) * optimize a switch with 0, 1 or 2 targets into an if or if-chain * optimize a br_if br pair when they have the same target Makes e.g. fastcomp libc++ 2% smaller. Noticeable improvements on other things like box2d etc.
Diffstat (limited to 'test/unit.fromasm.imprecise')
-rw-r--r--test/unit.fromasm.imprecise6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/unit.fromasm.imprecise b/test/unit.fromasm.imprecise
index d3da04937..4fd80da1c 100644
--- a/test/unit.fromasm.imprecise
+++ b/test/unit.fromasm.imprecise
@@ -180,10 +180,10 @@
)
(block $switch-case9
(block $switch-case4
- (br_table $switch-case9 $switch-case9 $switch-case9 $switch-case4 $switch-case9 $switch-case9 $switch-case9 $switch-case9 $switch-case4 $switch-case9 $switch-case4 $switch-case9
- (i32.sub
+ (br_table $switch-case4 $switch-case9 $switch-case9 $switch-case9 $switch-case9 $switch-case4 $switch-case9 $switch-case4 $switch-case9
+ (i32.add
(get_local $0)
- (i32.const 2)
+ (i32.const -5)
)
)
)