summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-02-08 11:32:33 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-02-08 11:40:55 -0800
commit32ead1ba35e0ad6575e9d27370aba80160f11f7c (patch)
treef2edc4599e760e191c4236456d88899c9ce5c10e
parent7dc054d36488bdea267dfb394758fc56a28e397e (diff)
downloadbinaryen-32ead1ba35e0ad6575e9d27370aba80160f11f7c.tar.gz
binaryen-32ead1ba35e0ad6575e9d27370aba80160f11f7c.tar.bz2
binaryen-32ead1ba35e0ad6575e9d27370aba80160f11f7c.zip
update test outputs
-rw-r--r--test/dot_s/basics.wast9
-rw-r--r--test/dot_s/bcp-1.wast51
-rw-r--r--test/dot_s/memops.wast9
-rw-r--r--test/emcc_O2_hello_world.fromasm36
-rw-r--r--test/emcc_hello_world.fromasm36
-rw-r--r--test/llvm_autogenerated/cfg-stackify.wast165
-rw-r--r--test/llvm_autogenerated/dead-vreg.wast12
-rw-r--r--test/llvm_autogenerated/func.wast3
-rw-r--r--test/llvm_autogenerated/mem-intrinsics.wast6
-rw-r--r--test/llvm_autogenerated/phi.wast6
-rw-r--r--test/llvm_autogenerated/reg-stackify.wast9
-rw-r--r--test/llvm_autogenerated/store-results.wast6
-rw-r--r--test/llvm_autogenerated/switch.wast6
-rw-r--r--test/passes/remove-unused-brs.txt35
-rw-r--r--test/passes/remove-unused-brs.wast18
15 files changed, 142 insertions, 265 deletions
diff --git a/test/dot_s/basics.wast b/test/dot_s/basics.wast
index b21d1a2e7..23d2fcd81 100644
--- a/test/dot_s/basics.wast
+++ b/test/dot_s/basics.wast
@@ -14,7 +14,7 @@
)
(block $label$0
(block $label$1
- (br_if
+ (br_if $label$1
(i32.ne
(i32.sub
(get_local $$0)
@@ -34,7 +34,6 @@
)
(i32.const 1)
)
- $label$1
)
(loop $label$3 $label$2
(set_local $$0
@@ -47,7 +46,7 @@
)
)
(block $label$4
- (br_if
+ (br_if $label$4
(i32.ne
(i32.rem_s
(get_local $$0)
@@ -55,7 +54,6 @@
)
(i32.const 3)
)
- $label$4
)
(set_local $$0
(i32.add
@@ -67,7 +65,7 @@
)
)
)
- (br_if
+ (br_if $label$1
(i32.eq
(i32.rem_s
(get_local $$0)
@@ -75,7 +73,6 @@
)
(i32.const 0)
)
- $label$1
)
(br $label$2)
)
diff --git a/test/dot_s/bcp-1.wast b/test/dot_s/bcp-1.wast
index 224bd9cf7..52a744a79 100644
--- a/test/dot_s/bcp-1.wast
+++ b/test/dot_s/bcp-1.wast
@@ -126,53 +126,47 @@
(i32.const 0)
)
(block $label$0
- (br_if
+ (br_if $label$0
(call_indirect $FUNCSIG_i
(i32.load offset=16 align=4
(get_local $$0)
)
)
- $label$0
)
- (br_if
+ (br_if $label$0
(call_indirect $FUNCSIG_i
(i32.load offset=20 align=4
(get_local $$0)
)
)
- $label$0
)
- (br_if
+ (br_if $label$0
(call_indirect $FUNCSIG_i
(i32.load offset=24 align=4
(get_local $$0)
)
)
- $label$0
)
- (br_if
+ (br_if $label$0
(call_indirect $FUNCSIG_i
(i32.load offset=28 align=4
(get_local $$0)
)
)
- $label$0
)
- (br_if
+ (br_if $label$0
(call_indirect $FUNCSIG_i
(i32.load offset=32 align=4
(get_local $$0)
)
)
- $label$0
)
- (br_if
+ (br_if $label$0
(call_indirect $FUNCSIG_i
(i32.load offset=36 align=4
(get_local $$0)
)
)
- $label$0
)
(set_local $$1
(i32.load offset=40 align=4
@@ -183,30 +177,27 @@
(i32.const 1)
)
(block $label$1
- (br_if
+ (br_if $label$1
(call_indirect $FUNCSIG_ii
(get_local $$1)
(get_local $$2)
)
- $label$1
)
- (br_if
+ (br_if $label$1
(call_indirect $FUNCSIG_ii
(i32.load offset=44 align=4
(get_local $$0)
)
(get_local $$2)
)
- $label$1
)
- (br_if
+ (br_if $label$1
(call_indirect $FUNCSIG_ii
(i32.load offset=48 align=4
(get_local $$0)
)
(get_local $$2)
)
- $label$1
)
(set_local $$1
(i32.load offset=52 align=4
@@ -217,24 +208,22 @@
(i32.const 96)
)
(block $label$2
- (br_if
+ (br_if $label$2
(call_indirect $FUNCSIG_ii
(get_local $$1)
(get_local $$2)
)
- $label$2
)
- (br_if
+ (br_if $label$2
(call_indirect $FUNCSIG_ii
(i32.load offset=56 align=4
(get_local $$0)
)
(get_local $$2)
)
- $label$2
)
(block $label$3
- (br_if
+ (br_if $label$3
(i32.eq
(call_indirect $FUNCSIG_i
(i32.load offset=60 align=4
@@ -243,9 +232,8 @@
)
(i32.const 0)
)
- $label$3
)
- (br_if
+ (br_if $label$3
(i32.eq
(call_indirect $FUNCSIG_i
(i32.load offset=64 align=4
@@ -254,9 +242,8 @@
)
(i32.const 0)
)
- $label$3
)
- (br_if
+ (br_if $label$3
(i32.eq
(call_indirect $FUNCSIG_i
(i32.load offset=68 align=4
@@ -265,10 +252,9 @@
)
(i32.const 0)
)
- $label$3
)
(block $label$4
- (br_if
+ (br_if $label$4
(i32.eq
(call_indirect $FUNCSIG_i
(i32.load offset=72 align=4
@@ -277,9 +263,8 @@
)
(i32.const 0)
)
- $label$4
)
- (br_if
+ (br_if $label$4
(i32.eq
(call_indirect $FUNCSIG_i
(i32.load offset=76 align=4
@@ -288,9 +273,8 @@
)
(i32.const 0)
)
- $label$4
)
- (br_if
+ (br_if $label$4
(i32.eq
(call_indirect $FUNCSIG_i
(i32.load offset=80 align=4
@@ -299,7 +283,6 @@
)
(i32.const 0)
)
- $label$4
)
(call_import $exit
(get_local $$0)
diff --git a/test/dot_s/memops.wast b/test/dot_s/memops.wast
index 647abbc48..54b5c0be5 100644
--- a/test/dot_s/memops.wast
+++ b/test/dot_s/memops.wast
@@ -104,12 +104,11 @@
(set_local $$5
(get_local $$1)
)
- (br_if
+ (br_if $label$2
(i32.ne
(get_local $$4)
(get_local $$3)
)
- $label$2
)
)
(loop $label$5 $label$4
@@ -142,12 +141,11 @@
(get_local $$2)
)
)
- (br_if
+ (br_if $label$4
(i32.ne
(get_local $$5)
(get_local $$3)
)
- $label$4
)
)
(set_local $$6
@@ -174,12 +172,11 @@
(get_local $$2)
)
)
- (br_if
+ (br_if $label$0
(i32.ne
(get_local $$0)
(i32.const 100)
)
- $label$0
)
)
(call $_Z6reporti
diff --git a/test/emcc_O2_hello_world.fromasm b/test/emcc_O2_hello_world.fromasm
index 8e390d359..6803f5aa3 100644
--- a/test/emcc_O2_hello_world.fromasm
+++ b/test/emcc_O2_hello_world.fromasm
@@ -1255,12 +1255,11 @@
(get_local $i24)
)
)
- (br_if
+ (br_if $do-once$8
(i32.eq
(get_local $i24)
(i32.const 0)
)
- $do-once$8
)
)
)
@@ -2523,12 +2522,11 @@
(get_local $i45)
)
)
- (br_if
+ (br_if $do-once$17
(i32.eq
(get_local $i45)
(i32.const 0)
)
- $do-once$17
)
)
)
@@ -3762,7 +3760,7 @@
(i32.const 616)
)
)
- (br_if
+ (br_if $do-once$25
(if_else
(i32.ne
(get_local $i45)
@@ -3780,7 +3778,6 @@
)
(i32.const 0)
)
- $do-once$25
)
(set_local $i45
(call_import $_sbrk
@@ -4112,12 +4109,11 @@
(get_local $i63)
)
)
- (br_if
+ (br_if $do-in$29
(i32.ne
(get_local $i63)
(i32.const 0)
)
- $do-in$29
)
)
(if
@@ -4710,12 +4706,11 @@
)
)
)
- (br_if
+ (br_if $label$break$L331
(i32.eq
(get_local $i54)
(i32.const 0)
)
- $label$break$L331
)
(set_local $i55
(i32.load offset=28 align=4
@@ -4771,12 +4766,11 @@
(get_local $i72)
)
)
- (br_if
+ (br_if $label$break$L331
(i32.eq
(get_local $i72)
(i32.const 0)
)
- $label$break$L331
)
)
(block
@@ -4784,9 +4778,8 @@
(get_local $i5)
(get_local $i72)
)
- (br_if
+ (br_if $do-once$36
(get_local $i72)
- $do-once$36
)
(i32.store align=4
(i32.const 180)
@@ -4862,12 +4855,11 @@
(get_local $i5)
)
)
- (br_if
+ (br_if $label$break$L331
(i32.eq
(get_local $i45)
(i32.const 0)
)
- $label$break$L331
)
(if_else
(i32.lt_u
@@ -4927,14 +4919,13 @@
)
(call_import $_abort)
)
- (br_if
+ (br_if $do-once$38
(i32.eq
(i32.load offset=12 align=4
(get_local $i45)
)
(get_local $i43)
)
- $do-once$38
)
(call_import $_abort)
)
@@ -5841,7 +5832,7 @@
(get_local $i63)
(i32.const 7)
)
- (br_if
+ (br_if $do-in$47
(i32.lt_u
(i32.add
(get_local $i63)
@@ -5849,7 +5840,6 @@
)
(get_local $i86)
)
- $do-in$47
)
)
(if
@@ -6436,12 +6426,11 @@
(i32.const 1)
)
)
- (br_if
+ (br_if $do-in$51
(i32.ne
(get_local $i5)
(i32.const 32)
)
- $do-in$51
)
)
(set_local $i5
@@ -7826,12 +7815,11 @@
(get_local $i23)
)
)
- (br_if
+ (br_if $do-once$5
(i32.eq
(get_local $i23)
(i32.const 0)
)
- $do-once$5
)
)
)
diff --git a/test/emcc_hello_world.fromasm b/test/emcc_hello_world.fromasm
index 0cc794358..af4e375e2 100644
--- a/test/emcc_hello_world.fromasm
+++ b/test/emcc_hello_world.fromasm
@@ -2349,12 +2349,11 @@
(i32.const 4)
)
)
- (br_if
+ (br_if $do-in$1
(i32.lt_s
(get_local $dest)
(get_local $stop)
)
- $do-in$1
)
)
(set_local $$vacopy_currentptr
@@ -12342,12 +12341,11 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $do-once$95
(i32.eq
(get_local $$tobool$i$449$i)
(i32.const 0)
)
- $do-once$95
)
(call $___fwritex
(i32.const 4143)
@@ -12908,12 +12906,11 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $do-once$89
(i32.eq
(get_local $$tobool$i$i)
(i32.const 0)
)
- $do-once$89
)
(set_local $$sub$ptr$rhs$cast812$i
(get_local $$estr$2$i)
@@ -19075,9 +19072,8 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $do-once$8
(get_local $$cmp126$i)
- $do-once$8
)
)
)
@@ -20911,9 +20907,8 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $do-once$17
(get_local $$cmp217$i)
- $do-once$17
)
)
)
@@ -22763,9 +22758,8 @@
(get_local $$cmp66$i$190)
)
)
- (br_if
+ (br_if $do-once$25
(get_local $$or$cond2$i)
- $do-once$25
)
)
)
@@ -24149,9 +24143,8 @@
(get_local $$add$ptr16$i$i)
)
)
- (br_if
+ (br_if $do-once$35
(get_local $$cmp44$i$i)
- $do-once$35
)
(call_import $_abort)
)
@@ -24552,9 +24545,8 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $label$break$L331
(get_local $$cmp120$i$53$i)
- $label$break$L331
)
(set_local $$index$i$54$i
(i32.add
@@ -24601,12 +24593,11 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $do-once$40
(i32.eq
(get_local $$cond2$i$i)
(i32.const 0)
)
- $do-once$40
)
(set_local $$shl131$i$i
(i32.shl
@@ -24695,9 +24686,8 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $label$break$L331
(get_local $$cmp156$i$i)
- $label$break$L331
)
)
)
@@ -24804,9 +24794,8 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $label$break$L331
(get_local $$cmp185$i$i)
- $label$break$L331
)
(set_local $$171
(i32.load align=4
@@ -29192,9 +29181,8 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $do-once$5
(get_local $$cmp432)
- $do-once$5
)
)
)
diff --git a/test/llvm_autogenerated/cfg-stackify.wast b/test/llvm_autogenerated/cfg-stackify.wast
index 791b31a24..d801f87c7 100644
--- a/test/llvm_autogenerated/cfg-stackify.wast
+++ b/test/llvm_autogenerated/cfg-stackify.wast
@@ -41,12 +41,11 @@
(i32.const 1)
)
)
- (br_if
+ (br_if $label$1
(i32.ge_s
(get_local $$1)
(get_local $$0)
)
- $label$1
)
(call_import $something)
(br $label$0)
@@ -65,12 +64,11 @@
(i32.const 1)
)
)
- (br_if
+ (br_if $label$1
(i32.ge_s
(get_local $$1)
(get_local $$0)
)
- $label$1
)
(call_import $something)
(br $label$0)
@@ -79,12 +77,11 @@
)
(func $test2 (param $$0 i32) (param $$1 i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.lt_s
(get_local $$1)
(i32.const 1)
)
- $label$0
)
(loop $label$2 $label$1
(set_local $$1
@@ -108,9 +105,8 @@
(i32.const 8)
)
)
- (br_if
+ (br_if $label$1
(get_local $$1)
- $label$1
)
)
)
@@ -123,9 +119,8 @@
(get_local $$2)
(i32.const 0)
)
- (br_if
+ (br_if $label$1
(get_local $$0)
- $label$1
)
(i32.store align=4
(get_local $$2)
@@ -138,9 +133,8 @@
(get_local $$2)
(i32.const 2)
)
- (br_if
+ (br_if $label$2
(get_local $$1)
- $label$2
)
(i32.store align=4
(get_local $$2)
@@ -170,9 +164,8 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $label$0
(get_local $$1)
- $label$0
)
(i32.store align=4
(get_local $$0)
@@ -194,9 +187,8 @@
(get_local $$0)
(i32.const 0)
)
- (br_if
+ (br_if $label$1
(get_local $$1)
- $label$1
)
(i32.store align=4
(get_local $$0)
@@ -248,12 +240,11 @@
(get_local $$0)
(i32.const 1)
)
- (br_if
+ (br_if $label$0
(i32.eq
(get_local $$1)
(i32.const 0)
)
- $label$0
)
)
(i32.store align=4
@@ -273,18 +264,16 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $label$0
(get_local $$0)
- $label$0
)
(block $label$1
(i32.store align=4
(get_local $$2)
(i32.const 2)
)
- (br_if
+ (br_if $label$1
(get_local $$1)
- $label$1
)
(i32.store align=4
(get_local $$2)
@@ -311,9 +300,8 @@
(get_local $$2)
(i32.const 0)
)
- (br_if
+ (br_if $label$1
(get_local $$0)
- $label$1
)
(i32.store align=4
(get_local $$2)
@@ -325,9 +313,8 @@
(get_local $$2)
(i32.const 2)
)
- (br_if
+ (br_if $label$0
(get_local $$1)
- $label$0
)
(i32.store align=4
(get_local $$2)
@@ -350,9 +337,8 @@
(get_local $$2)
(i32.const 0)
)
- (br_if
+ (br_if $label$3
(get_local $$0)
- $label$3
)
(i32.store align=4
(get_local $$2)
@@ -365,9 +351,8 @@
(get_local $$2)
(i32.const 2)
)
- (br_if
+ (br_if $label$4
(get_local $$1)
- $label$4
)
(i32.store align=4
(get_local $$2)
@@ -389,22 +374,19 @@
)
(func $test3 (param $$0 i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.const 0)
- $label$0
)
(loop $label$2 $label$1
- (br_if
+ (br_if $label$2
(get_local $$0)
- $label$2
)
(loop $label$4 $label$3
- (br_if
+ (br_if $label$3
(i32.ne
(get_local $$0)
(get_local $$0)
)
- $label$3
)
)
(call_import $bar)
@@ -418,44 +400,39 @@
(block $label$0
(block $label$1
(block $label$2
- (br_if
+ (br_if $label$2
(i32.gt_s
(get_local $$0)
(i32.const 3)
)
- $label$2
)
(block $label$3
- (br_if
+ (br_if $label$3
(i32.eq
(get_local $$0)
(i32.const 0)
)
- $label$3
)
- (br_if
+ (br_if $label$1
(i32.ne
(get_local $$0)
(i32.const 2)
)
- $label$1
)
)
(return)
)
- (br_if
+ (br_if $label$0
(i32.eq
(get_local $$0)
(i32.const 4)
)
- $label$0
)
- (br_if
+ (br_if $label$1
(i32.ne
(get_local $$0)
(i32.const 622)
)
- $label$1
)
(return)
)
@@ -485,20 +462,18 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $label$0
(i32.eq
(get_local $$0)
(i32.const 0)
)
- $label$0
)
(i32.store align=4
(get_local $$1)
(i32.const 1)
)
- (br_if
+ (br_if $label$1
(get_local $$2)
- $label$1
)
)
(i32.store align=4
@@ -532,14 +507,13 @@
(i32.const 0)
)
)
- (br_if
+ (br_if $label$0
(i32.eq
(get_local $$2)
(i32.const 0)
)
- $label$0
)
- (br_if
+ (br_if $label$1
(i32.eq
(set_local $$3
(i32.and
@@ -554,15 +528,13 @@
)
(i32.const 0)
)
- $label$1
)
(i32.store align=4
(get_local $$0)
(get_local $$4)
)
- (br_if
+ (br_if $label$2
(get_local $$3)
- $label$2
)
)
(i32.store align=4
@@ -605,20 +577,18 @@
(i32.const 1)
)
)
- (br_if
+ (br_if $label$2
(get_local $$3)
- $label$2
)
(i32.store align=4
(get_local $$2)
(i32.const 2)
)
- (br_if
+ (br_if $label$0
(i32.and
(get_local $$1)
(get_local $$0)
)
- $label$0
)
(i32.store align=4
(i32.const 0)
@@ -630,12 +600,11 @@
(get_local $$2)
(i32.const 3)
)
- (br_if
+ (br_if $label$0
(i32.and
(get_local $$1)
(get_local $$0)
)
- $label$0
)
)
(i32.store align=4
@@ -647,25 +616,22 @@
(func $test8 (result i32)
(loop $label$1 $label$0
(block $label$2
- (br_if
+ (br_if $label$2
(i32.eq
(i32.const 0)
(i32.const 0)
)
- $label$2
)
- (br_if
+ (br_if $label$0
(i32.eq
(i32.const 0)
(i32.const 0)
)
- $label$0
)
)
(loop $label$4 $label$3
- (br_if
+ (br_if $label$3
(i32.const 0)
- $label$3
)
(br $label$0)
)
@@ -681,7 +647,7 @@
)
)
(loop $label$1 $label$0
- (br_if
+ (br_if $label$1
(i32.eq
(i32.and
(set_local $$1
@@ -694,7 +660,6 @@
)
(i32.const 0)
)
- $label$1
)
(loop $label$3 $label$2
(block $label$4
@@ -702,7 +667,7 @@
(get_local $$0)
(i32.const 2)
)
- (br_if
+ (br_if $label$4
(i32.eq
(i32.and
(call_import $a)
@@ -710,18 +675,16 @@
)
(i32.const 0)
)
- $label$4
)
(i32.store align=4
(get_local $$0)
(i32.const 3)
)
- (br_if
+ (br_if $label$2
(i32.and
(call_import $a)
(get_local $$1)
)
- $label$2
)
(br $label$0)
)
@@ -729,12 +692,11 @@
(get_local $$0)
(i32.const 4)
)
- (br_if
+ (br_if $label$2
(i32.and
(call_import $a)
(get_local $$1)
)
- $label$2
)
(br $label$0)
)
@@ -770,9 +732,8 @@
(set_local $$2
(i32.const 4)
)
- (br_if
+ (br_if $label$0
(get_local $$4)
- $label$0
)
(block $label$2
(loop $label$4 $label$3
@@ -786,12 +747,11 @@
(set_local $$2
(get_local $$4)
)
- (br_if
+ (br_if $label$0
(i32.gt_u
(get_local $$2)
(i32.const 4)
)
- $label$0
)
(set_local $$4
(get_local $$3)
@@ -816,31 +776,28 @@
(block $label$1
(block $label$2
(block $label$3
- (br_if
+ (br_if $label$3
(set_local $$0
(i32.store align=4
(i32.const 0)
(i32.const 0)
)
)
- $label$3
)
(block $label$4
(i32.store align=4
(get_local $$0)
(i32.const 1)
)
- (br_if
+ (br_if $label$4
(get_local $$0)
- $label$4
)
(i32.store align=4
(i32.const 0)
(i32.const 2)
)
- (br_if
+ (br_if $label$2
(i32.const 0)
- $label$2
)
)
(i32.store align=4
@@ -853,20 +810,18 @@
(get_local $$0)
(i32.const 4)
)
- (br_if
+ (br_if $label$0
(get_local $$0)
- $label$0
)
(i32.store align=4
(i32.const 0)
(i32.const 5)
)
- (br_if
+ (br_if $label$1
(i32.eq
(i32.const 0)
(i32.const 0)
)
- $label$1
)
)
(i32.store align=4
@@ -893,7 +848,7 @@
(block $label$2
(block $label$3
(block $label$4
- (br_if
+ (br_if $label$4
(i32.gt_s
(set_local $$1
(i32.load8_u align=1
@@ -902,37 +857,32 @@
)
(i32.const 103)
)
- $label$4
)
- (br_if
+ (br_if $label$2
(i32.eq
(get_local $$1)
(i32.const 42)
)
- $label$2
)
- (br_if
+ (br_if $label$2
(i32.eq
(get_local $$1)
(i32.const 76)
)
- $label$2
)
(br $label$3)
)
- (br_if
+ (br_if $label$2
(i32.eq
(get_local $$1)
(i32.const 108)
)
- $label$2
)
- (br_if
+ (br_if $label$2
(i32.eq
(get_local $$1)
(i32.const 104)
)
- $label$2
)
)
(return)
@@ -949,12 +899,11 @@
(func $test13
(local $$0 i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.eq
(i32.const 0)
(i32.const 0)
)
- $label$0
)
(return)
)
@@ -962,16 +911,15 @@
(i32.const 0)
)
(block $label$1
- (br_if
+ (br_if $label$1
(get_local $$0)
- $label$1
)
(set_local $$0
(i32.const 0)
)
)
(block $label$2
- (br_if
+ (br_if $label$2
(i32.eq
(i32.and
(get_local $$0)
@@ -979,23 +927,20 @@
)
(i32.const 0)
)
- $label$2
)
)
(unreachable)
)
(func $test14
(loop $label$1 $label$0
- (br_if
+ (br_if $label$0
(i32.const 0)
- $label$0
)
)
(loop $label$3 $label$2
(i32.const 0)
- (br_if
+ (br_if $label$2
(i32.const 0)
- $label$2
)
)
(return)
diff --git a/test/llvm_autogenerated/dead-vreg.wast b/test/llvm_autogenerated/dead-vreg.wast
index e0b4ae6f4..2dba22223 100644
--- a/test/llvm_autogenerated/dead-vreg.wast
+++ b/test/llvm_autogenerated/dead-vreg.wast
@@ -9,12 +9,11 @@
(local $$7 i32)
(local $$8 i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.lt_s
(get_local $$2)
(i32.const 1)
)
- $label$0
)
(set_local $$3
(i32.shl
@@ -42,9 +41,8 @@
(get_local $$1)
)
(block $label$3
- (br_if
+ (br_if $label$3
(get_local $$4)
- $label$3
)
(loop $label$5 $label$4
(i32.store align=4
@@ -69,9 +67,8 @@
(get_local $$5)
)
)
- (br_if
+ (br_if $label$4
(get_local $$8)
- $label$4
)
)
)
@@ -87,12 +84,11 @@
(get_local $$3)
)
)
- (br_if
+ (br_if $label$1
(i32.ne
(get_local $$5)
(get_local $$2)
)
- $label$1
)
)
)
diff --git a/test/llvm_autogenerated/func.wast b/test/llvm_autogenerated/func.wast
index d3c82126a..8340ed3c2 100644
--- a/test/llvm_autogenerated/func.wast
+++ b/test/llvm_autogenerated/func.wast
@@ -24,7 +24,7 @@
)
(func $f4 (param $$0 i32) (result i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.eq
(i32.and
(get_local $$0)
@@ -32,7 +32,6 @@
)
(i32.const 0)
)
- $label$0
)
(return
(i32.const 0)
diff --git a/test/llvm_autogenerated/mem-intrinsics.wast b/test/llvm_autogenerated/mem-intrinsics.wast
index 2fa6f992e..3787f157d 100644
--- a/test/llvm_autogenerated/mem-intrinsics.wast
+++ b/test/llvm_autogenerated/mem-intrinsics.wast
@@ -139,21 +139,19 @@
(func $discard_result (param $$0 i32) (param $$1 i32) (param $$2 i32) (param $$3 i32) (param $$4 i32) (result i32)
(block $label$0
(block $label$1
- (br_if
+ (br_if $label$1
(i32.eq
(get_local $$3)
(i32.const 0)
)
- $label$1
)
(set_local $$0
(call_import $def)
)
(br $label$0)
)
- (br_if
+ (br_if $label$0
(get_local $$4)
- $label$0
)
(call_import $memset
(get_local $$0)
diff --git a/test/llvm_autogenerated/phi.wast b/test/llvm_autogenerated/phi.wast
index d4c940fa7..8d5e8714f 100644
--- a/test/llvm_autogenerated/phi.wast
+++ b/test/llvm_autogenerated/phi.wast
@@ -4,12 +4,11 @@
(export "test1" $test1)
(func $test0 (param $$0 i32) (result i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.gt_s
(get_local $$0)
(i32.const -1)
)
- $label$0
)
(set_local $$0
(i32.div_s
@@ -52,12 +51,11 @@
(set_local $$2
(get_local $$1)
)
- (br_if
+ (br_if $label$0
(i32.lt_s
(get_local $$4)
(get_local $$0)
)
- $label$0
)
)
(return
diff --git a/test/llvm_autogenerated/reg-stackify.wast b/test/llvm_autogenerated/reg-stackify.wast
index 624550d38..6acf6d712 100644
--- a/test/llvm_autogenerated/reg-stackify.wast
+++ b/test/llvm_autogenerated/reg-stackify.wast
@@ -70,7 +70,7 @@
)
(func $stack_uses (param $$0 i32) (param $$1 i32) (param $$2 i32) (param $$3 i32) (result i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.ne
(i32.xor
(i32.xor
@@ -96,7 +96,6 @@
)
(i32.const 1)
)
- $label$0
)
(return
(i32.const 0)
@@ -109,7 +108,7 @@
(func $multiple_uses (param $$0 i32) (param $$1 i32) (param $$2 i32)
(local $$3 i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.ge_u
(set_local $$3
(i32.load align=4
@@ -118,14 +117,12 @@
)
(get_local $$1)
)
- $label$0
)
- (br_if
+ (br_if $label$0
(i32.lt_u
(get_local $$3)
(get_local $$0)
)
- $label$0
)
(i32.store align=4
(get_local $$2)
diff --git a/test/llvm_autogenerated/store-results.wast b/test/llvm_autogenerated/store-results.wast
index c99ac2aed..222e66313 100644
--- a/test/llvm_autogenerated/store-results.wast
+++ b/test/llvm_autogenerated/store-results.wast
@@ -27,12 +27,11 @@
(i32.const 1)
)
)
- (br_if
+ (br_if $label$0
(i32.ne
(get_local $$0)
(i32.const 256)
)
- $label$0
)
)
(return)
@@ -53,12 +52,11 @@
(f32.const 1)
)
)
- (br_if
+ (br_if $label$0
(f32.ne
(get_local $$0)
(f32.const 256)
)
- $label$0
)
)
(return)
diff --git a/test/llvm_autogenerated/switch.wast b/test/llvm_autogenerated/switch.wast
index 103124c74..1d10ba958 100644
--- a/test/llvm_autogenerated/switch.wast
+++ b/test/llvm_autogenerated/switch.wast
@@ -11,12 +11,11 @@
(export "bar64" $bar64)
(func $bar32 (param $$0 i32)
(block $label$0
- (br_if
+ (br_if $label$0
(i32.gt_u
(get_local $$0)
(i32.const 23)
)
- $label$0
)
(block $label$1
(block $label$2
@@ -50,12 +49,11 @@
)
(func $bar64 (param $$0 i64)
(block $label$0
- (br_if
+ (br_if $label$0
(i64.gt_u
(get_local $$0)
(i64.const 23)
)
- $label$0
)
(block $label$1
(block $label$2
diff --git a/test/passes/remove-unused-brs.txt b/test/passes/remove-unused-brs.txt
index 5759203b4..761ba80f3 100644
--- a/test/passes/remove-unused-brs.txt
+++ b/test/passes/remove-unused-brs.txt
@@ -40,27 +40,24 @@
)
(func $b6 (param $i1 i32)
(block $topmost
- (br_if
+ (br_if $topmost
(i32.const 1)
- $topmost
)
)
)
(func $b7 (param $i1 i32)
(block $topmost
- (br_if
- (i32.const 1)
- $topmost
+ (br_if $topmost
(i32.const 0)
+ (i32.const 1)
)
)
)
(func $b8 (param $i1 i32)
(block $topmost
(block $inner
- (br_if
+ (br_if $topmost
(i32.const 1)
- $topmost
)
)
)
@@ -68,9 +65,8 @@
(func $b9 (param $i1 i32)
(block $topmost
(block $inner
- (br_if
+ (br_if $topmost
(i32.const 1)
- $inner
)
)
)
@@ -78,10 +74,9 @@
(func $b10 (param $i1 i32)
(block $topmost
(block $inner
- (br_if
- (i32.const 1)
- $topmost
+ (br_if $topmost
(i32.const 0)
+ (i32.const 1)
)
)
)
@@ -89,10 +84,9 @@
(func $b11 (param $i1 i32)
(block $topmost
(block $inner
- (br_if
- (i32.const 1)
- $inner
+ (br_if $inner
(i32.const 0)
+ (i32.const 1)
)
)
)
@@ -118,9 +112,8 @@
(i32.const 1)
(block $block0
(i32.const 12)
- (br_if
+ (br_if $topmost
(i32.const 1)
- $topmost
(i32.const 1)
)
)
@@ -149,18 +142,16 @@
)
(func $b15
(block $topmost
- (br_if
+ (br_if $topmost
(i32.const 17)
- $topmost
)
)
)
(func $b15 (result i32)
(block $topmost
- (br_if
- (i32.const 18)
- $topmost
+ (br_if $topmost
(i32.const 0)
+ (i32.const 18)
)
)
)
diff --git a/test/passes/remove-unused-brs.wast b/test/passes/remove-unused-brs.wast
index ddf5e2fa7..2598a45f4 100644
--- a/test/passes/remove-unused-brs.wast
+++ b/test/passes/remove-unused-brs.wast
@@ -46,35 +46,37 @@
)
(func $b6 (param $i1 i32)
(block $topmost
- (br_if (i32.const 1) $topmost)
+ (br_if $topmost (i32.const 1))
)
)
(func $b7 (param $i1 i32)
(block $topmost
- (br_if (i32.const 1) $topmost
+ (br_if $topmost
(i32.const 0)
+ (i32.const 1)
)
)
)
(func $b8 (param $i1 i32)
(block $topmost
(block $inner
- (br_if (i32.const 1) $topmost)
+ (br_if $topmost (i32.const 1))
)
)
)
(func $b9 (param $i1 i32)
(block $topmost
(block $inner
- (br_if (i32.const 1) $inner)
+ (br_if $topmost (i32.const 1))
)
)
)
(func $b10 (param $i1 i32)
(block $topmost
(block $inner
- (br_if (i32.const 1) $topmost
+ (br_if $topmost
(i32.const 0)
+ (i32.const 1)
)
)
)
@@ -82,8 +84,9 @@
(func $b11 (param $i1 i32)
(block $topmost
(block $inner
- (br_if (i32.const 1) $inner
+ (br_if $inner
(i32.const 0)
+ (i32.const 1)
)
)
)
@@ -111,7 +114,8 @@
(if_else (i32.const 1)
(block
(i32.const 12)
- (br_if (i32.const 1) $topmost
+ (br_if $topmost
+ (i32.const 1)
(i32.const 1)
)
)