diff options
author | Thomas Lively <tlively@google.com> | 2024-01-04 14:25:18 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-04 14:25:18 -0800 |
commit | a58281ca114359cd6e65f5daaf086636aa18b0b0 (patch) | |
tree | ff98bd31d1c87b598027c2303b17855a44346515 /test/lit | |
parent | 0ed42cf976ce9a3dfbe9cbb0885122e8fb6a377b (diff) | |
download | binaryen-a58281ca114359cd6e65f5daaf086636aa18b0b0.tar.gz binaryen-a58281ca114359cd6e65f5daaf086636aa18b0b0.tar.bz2 binaryen-a58281ca114359cd6e65f5daaf086636aa18b0b0.zip |
Require `then` and `else` with `if` (#6201)
We previously supported (and primarily used) a non-standard text format for
conditionals in which the condition, if-true expression, and if-false expression
were all simply s-expression children of the `if` expression. The standard text
format, however, requires the use of `then` and `else` forms to introduce the
if-true and if-false arms of the conditional. Update the legacy text parser to
require the standard format and update all tests to match. Update the printer to
print the standard format as well.
The .wast and .wat test inputs were mechanically updated with this script:
https://gist.github.com/tlively/85ae7f01f92f772241ec994c840ccbb1
Diffstat (limited to 'test/lit')
131 files changed, 28075 insertions, 21149 deletions
diff --git a/test/lit/basic/exception-handling-old.wast b/test/lit/basic/exception-handling-old.wast index c082c1977..6fcb33ed4 100644 --- a/test/lit/basic/exception-handling-old.wast +++ b/test/lit/basic/exception-handling-old.wast @@ -1160,8 +1160,12 @@ ;; CHECK-TEXT-NEXT: (throw $e-i32 ;; CHECK-TEXT-NEXT: (if (result i32) ;; CHECK-TEXT-NEXT: (pop i32) - ;; CHECK-TEXT-NEXT: (i32.const 0) - ;; CHECK-TEXT-NEXT: (i32.const 3) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (i32.const 0) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (i32.const 3) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) @@ -1176,8 +1180,12 @@ ;; CHECK-BIN-NEXT: (throw $e-i32 ;; CHECK-BIN-NEXT: (if (result i32) ;; CHECK-BIN-NEXT: (pop i32) - ;; CHECK-BIN-NEXT: (i32.const 0) - ;; CHECK-BIN-NEXT: (i32.const 3) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (i32.const 0) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (i32.const 3) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) @@ -1191,8 +1199,12 @@ (if (result i32) ;; pop is within an if condition, so this is OK. (pop i32) - (i32.const 0) - (i32.const 3) + (then + (i32.const 0) + ) + (else + (i32.const 3) + ) ) ) ) @@ -1764,8 +1776,12 @@ ;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$0 ;; CHECK-BIN-NODEBUG-NEXT: (if (result i32) ;; CHECK-BIN-NODEBUG-NEXT: (pop i32) -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 3) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 3) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) diff --git a/test/lit/basic/exception-handling.wast b/test/lit/basic/exception-handling.wast index b94f89e1a..e1fa9c14d 100644 --- a/test/lit/basic/exception-handling.wast +++ b/test/lit/basic/exception-handling.wast @@ -79,12 +79,20 @@ ;; CHECK-TEXT-NEXT: (local $null-exn nullexnref) ;; CHECK-TEXT-NEXT: (if (result exnref) ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (if (result nullexnref) - ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (local.get $null-exn) - ;; CHECK-TEXT-NEXT: (ref.null noexn) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (if (result nullexnref) + ;; CHECK-TEXT-NEXT: (i32.const 1) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (local.get $null-exn) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (ref.null noexn) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (local.get $exn) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (local.get $exn) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-BIN: (func $exnref-nullexnref-test (type $3) (result exnref) @@ -92,23 +100,39 @@ ;; CHECK-BIN-NEXT: (local $null-exn nullexnref) ;; CHECK-BIN-NEXT: (if (result exnref) ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (if (result nullexnref) - ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (local.get $null-exn) - ;; CHECK-BIN-NEXT: (ref.null noexn) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (if (result nullexnref) + ;; CHECK-BIN-NEXT: (i32.const 1) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (local.get $null-exn) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (ref.null noexn) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (local.get $exn) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (local.get $exn) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $exnref-nullexnref-test (result exnref) (local $exn exnref) (local $null-exn nullexnref) (if (result exnref) (i32.const 1) - (if (result nullexnref) - (i32.const 1) - (local.get $null-exn) - (ref.null noexn) + (then + (if (result nullexnref) + (i32.const 1) + (then + (local.get $null-exn) + ) + (else + (ref.null noexn) + ) + ) + ) + (else + (local.get $exn) ) - (local.get $exn) ) ) @@ -631,11 +655,15 @@ ;; CHECK-TEXT-NEXT: (try_table (catch $e-i32 $l-catch-inner) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 0) - ;; CHECK-TEXT-NEXT: (throw $e-i32 - ;; CHECK-TEXT-NEXT: (i32.const 3) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (throw $e-i32 + ;; CHECK-TEXT-NEXT: (i32.const 3) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (throw $e-eqref - ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (throw $e-eqref + ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) @@ -653,11 +681,15 @@ ;; CHECK-BIN-NEXT: (try_table (catch $e-i32 $label$2) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 0) - ;; CHECK-BIN-NEXT: (throw $e-i32 - ;; CHECK-BIN-NEXT: (i32.const 3) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (throw $e-i32 + ;; CHECK-BIN-NEXT: (i32.const 3) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (throw $e-eqref - ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (throw $e-eqref + ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) @@ -675,8 +707,12 @@ (try_table (catch $e-i32 $l-catch-inner) (if (i32.const 0) - (throw $e-i32 (i32.const 3)) - (throw $e-eqref (ref.null eq)) + (then + (throw $e-i32 (i32.const 3)) + ) + (else + (throw $e-eqref (ref.null eq)) + ) ) ) ) @@ -725,12 +761,20 @@ ;; CHECK-BIN-NODEBUG-NEXT: (local $1 nullexnref) ;; CHECK-BIN-NODEBUG-NEXT: (if (result exnref) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (if (result nullexnref) -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (local.get $1) -;; CHECK-BIN-NODEBUG-NEXT: (ref.null noexn) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (if (result nullexnref) +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (local.get $1) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (ref.null noexn) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -988,11 +1032,15 @@ ;; CHECK-BIN-NODEBUG-NEXT: (try_table (catch $tag$0 $label$2) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) -;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$0 -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 3) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$0 +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 3) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$3 -;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (throw $tag$3 +;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) diff --git a/test/lit/basic/polymorphic_stack.wast b/test/lit/basic/polymorphic_stack.wast index d51117e16..fc743bf2a 100644 --- a/test/lit/basic/polymorphic_stack.wast +++ b/test/lit/basic/polymorphic_stack.wast @@ -162,8 +162,10 @@ ;; CHECK-TEXT-NEXT: (local $0 f32) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 259) - ;; CHECK-TEXT-NEXT: (local.tee $0 - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (local.tee $0 + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) @@ -171,15 +173,19 @@ ;; CHECK-BIN-NEXT: (local $0 f32) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 259) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $tee2 (local $0 f32) (if (i32.const 259) - (local.set $0 - (unreachable) + (then + (local.set $0 + (unreachable) + ) ) ) ) @@ -245,8 +251,10 @@ ;; CHECK-TEXT: (func $unreachable-in-block-but-code-before (type $FUNCSIG$ii) (param $0 i32) (result i32) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (local.get $0) - ;; CHECK-TEXT-NEXT: (return - ;; CHECK-TEXT-NEXT: (i32.const 127) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (return + ;; CHECK-TEXT-NEXT: (i32.const 127) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (block $label$0 (result i32) @@ -261,8 +269,10 @@ ;; CHECK-BIN: (func $unreachable-in-block-but-code-before (type $FUNCSIG$ii) (param $0 i32) (result i32) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (local.get $0) - ;; CHECK-BIN-NEXT: (return - ;; CHECK-BIN-NEXT: (i32.const 127) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (return + ;; CHECK-BIN-NEXT: (i32.const 127) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (block $label$2 (result i32) @@ -277,8 +287,10 @@ (func $unreachable-in-block-but-code-before (param $0 i32) (result i32) (if (local.get $0) - (return - (i32.const 127) + (then + (return + (i32.const 127) + ) ) ) (block $label$0 (result i32) @@ -325,11 +337,15 @@ ;; CHECK-TEXT-NEXT: (drop ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 0) - ;; CHECK-TEXT-NEXT: (br_if $label$8 + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (br_if $label$8 + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (i32.const 0) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (i32.const 0) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (unreachable) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) @@ -340,8 +356,12 @@ ;; CHECK-BIN-NEXT: (block $label$2 ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 0) - ;; CHECK-BIN-NEXT: (unreachable) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (unreachable) @@ -353,11 +373,15 @@ (drop (if (i32.const 0) - (br_if $label$8 + (then + (br_if $label$8 + (unreachable) + (i32.const 0) + ) + ) + (else (unreachable) - (i32.const 0) ) - (unreachable) ) ) ) @@ -393,7 +417,9 @@ ;; CHECK-BIN-NODEBUG-NEXT: (local $0 f32) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 259) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -416,8 +442,10 @@ ;; CHECK-BIN-NODEBUG: (func $6 (type $1) (param $0 i32) (result i32) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) -;; CHECK-BIN-NODEBUG-NEXT: (return -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 127) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (return +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 127) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 (result i32) @@ -443,8 +471,12 @@ ;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (unreachable) diff --git a/test/lit/basic/reference-types.wast b/test/lit/basic/reference-types.wast index 2b502d789..94d4f3525 100644 --- a/test/lit/basic/reference-types.wast +++ b/test/lit/basic/reference-types.wast @@ -525,45 +525,69 @@ ;; CHECK-TEXT-NEXT: (drop ;; CHECK-TEXT-NEXT: (if (result eqref) ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (local.get $local_eqref) - ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (local.get $local_eqref) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (drop ;; CHECK-TEXT-NEXT: (if (result funcref) ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (local.get $local_funcref) - ;; CHECK-TEXT-NEXT: (ref.null nofunc) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (local.get $local_funcref) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (ref.null nofunc) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (drop ;; CHECK-TEXT-NEXT: (if (result anyref) ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (local.get $local_anyref) - ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (local.get $local_anyref) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (drop ;; CHECK-TEXT-NEXT: (if (result anyref) ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (local.get $local_eqref) - ;; CHECK-TEXT-NEXT: (local.get $local_eqref) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (local.get $local_eqref) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (local.get $local_eqref) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (drop ;; CHECK-TEXT-NEXT: (if (result anyref) ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (ref.null none) - ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (ref.null none) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (drop ;; CHECK-TEXT-NEXT: (if (result anyref) ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (ref.i31 - ;; CHECK-TEXT-NEXT: (i32.const 0) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (ref.i31 + ;; CHECK-TEXT-NEXT: (i32.const 0) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (ref.null none) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (ref.null none) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (drop @@ -1036,45 +1060,69 @@ ;; CHECK-BIN-NEXT: (drop ;; CHECK-BIN-NEXT: (if (result eqref) ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (local.get $local_eqref) - ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (local.get $local_eqref) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (drop ;; CHECK-BIN-NEXT: (if (result funcref) ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (local.get $local_funcref) - ;; CHECK-BIN-NEXT: (ref.null nofunc) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (local.get $local_funcref) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (ref.null nofunc) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (drop ;; CHECK-BIN-NEXT: (if (result anyref) ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (local.get $local_anyref) - ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (local.get $local_anyref) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (drop ;; CHECK-BIN-NEXT: (if (result anyref) ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (local.get $local_eqref) - ;; CHECK-BIN-NEXT: (local.get $local_eqref) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (local.get $local_eqref) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (local.get $local_eqref) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (drop ;; CHECK-BIN-NEXT: (if (result anyref) ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (ref.null none) - ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (ref.null none) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (drop ;; CHECK-BIN-NEXT: (if (result anyref) ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (ref.i31 - ;; CHECK-BIN-NEXT: (i32.const 0) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (ref.i31 + ;; CHECK-BIN-NEXT: (i32.const 0) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (ref.null none) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (ref.null none) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (drop @@ -1420,22 +1468,34 @@ (drop (if (result eqref) (i32.const 1) - (local.get $local_eqref) - (ref.null eq) + (then + (local.get $local_eqref) + ) + (else + (ref.null eq) + ) ) ) (drop (if (result funcref) (i32.const 1) - (local.get $local_funcref) - (ref.null func) + (then + (local.get $local_funcref) + ) + (else + (ref.null func) + ) ) ) (drop (if (result anyref) (i32.const 1) - (local.get $local_anyref) - (ref.null any) + (then + (local.get $local_anyref) + ) + (else + (ref.null any) + ) ) ) @@ -1443,24 +1503,36 @@ (drop (if (result anyref) (i32.const 1) - (local.get $local_eqref) - (local.get $local_eqref) + (then + (local.get $local_eqref) + ) + (else + (local.get $local_eqref) + ) ) ) (drop (if (result anyref) (i32.const 1) - (ref.null eq) - (ref.null i31) + (then + (ref.null eq) + ) + (else + (ref.null i31) + ) ) ) (drop (if (result anyref) (i32.const 1) - (ref.i31 - (i32.const 0) + (then + (ref.i31 + (i32.const 0) + ) + ) + (else + (ref.null eq) ) - (ref.null eq) ) ) @@ -2201,45 +2273,69 @@ ;; CHECK-BIN-NODEBUG-NEXT: (drop ;; CHECK-BIN-NODEBUG-NEXT: (if (result eqref) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) -;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (drop ;; CHECK-BIN-NODEBUG-NEXT: (if (result funcref) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (local.get $1) -;; CHECK-BIN-NODEBUG-NEXT: (ref.null nofunc) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (local.get $1) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (ref.null nofunc) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (drop ;; CHECK-BIN-NODEBUG-NEXT: (if (result anyref) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (local.get $2) -;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (local.get $2) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (drop ;; CHECK-BIN-NODEBUG-NEXT: (if (result anyref) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) -;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (drop ;; CHECK-BIN-NODEBUG-NEXT: (if (result anyref) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) -;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (drop ;; CHECK-BIN-NODEBUG-NEXT: (if (result anyref) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (ref.i31 -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (ref.i31 +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (ref.null none) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (drop diff --git a/test/lit/basic/reg_switch.wast b/test/lit/basic/reg_switch.wast index 5f9dd5d7f..db7494511 100644 --- a/test/lit/basic/reg_switch.wast +++ b/test/lit/basic/reg_switch.wast @@ -22,9 +22,11 @@ ;; CHECK-TEXT: (func $0 (type $0) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 0) - ;; CHECK-TEXT-NEXT: (block $A - ;; CHECK-TEXT-NEXT: (br_table $A - ;; CHECK-TEXT-NEXT: (i32.const 0) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (block $A + ;; CHECK-TEXT-NEXT: (br_table $A + ;; CHECK-TEXT-NEXT: (i32.const 0) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) @@ -32,9 +34,11 @@ ;; CHECK-BIN: (func $0 (type $0) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 0) - ;; CHECK-BIN-NEXT: (block $label$2 - ;; CHECK-BIN-NEXT: (br_table $label$2 - ;; CHECK-BIN-NEXT: (i32.const 0) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (block $label$2 + ;; CHECK-BIN-NEXT: (br_table $label$2 + ;; CHECK-BIN-NEXT: (i32.const 0) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) @@ -42,9 +46,11 @@ ;; CHECK-BIN-NODEBUG: (func $0 (type $0) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) - ;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 - ;; CHECK-BIN-NODEBUG-NEXT: (br_table $label$2 - ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) + ;; CHECK-BIN-NODEBUG-NEXT: (then + ;; CHECK-BIN-NODEBUG-NEXT: (block $label$2 + ;; CHECK-BIN-NODEBUG-NEXT: (br_table $label$2 + ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) + ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -52,9 +58,11 @@ (func $0 (type $0) (if (i32.const 0) - (block $A - (br_table $A - (i32.const 0) + (then + (block $A + (br_table $A + (i32.const 0) + ) ) ) ) diff --git a/test/lit/basic/unit.wat b/test/lit/basic/unit.wat index 4fc36b3b7..9cdcb5792 100644 --- a/test/lit/basic/unit.wat +++ b/test/lit/basic/unit.wat @@ -191,8 +191,10 @@ ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (i32.const 0) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (br $topmost - ;; CHECK-TEXT-NEXT: (f64.const -3.4) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (br $topmost + ;; CHECK-TEXT-NEXT: (f64.const -3.4) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if @@ -202,8 +204,10 @@ ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (f64.const 0) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (br $topmost - ;; CHECK-TEXT-NEXT: (f64.const 5.6) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (br $topmost + ;; CHECK-TEXT-NEXT: (f64.const 5.6) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (f64.const 1.2) @@ -243,8 +247,10 @@ ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (i32.const 0) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (br $label$1 - ;; CHECK-BIN-NEXT: (f64.const -3.4) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (br $label$1 + ;; CHECK-BIN-NEXT: (f64.const -3.4) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (if @@ -254,8 +260,10 @@ ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (f64.const 0) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (br $label$1 - ;; CHECK-BIN-NEXT: (f64.const 5.6) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (br $label$1 + ;; CHECK-BIN-NEXT: (f64.const 5.6) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (f64.const 1.2) @@ -295,8 +303,10 @@ ) (i32.const 0) ) - (br $topmost - (f64.const -3.4) + (then + (br $topmost + (f64.const -3.4) + ) ) ) (if @@ -306,8 +316,10 @@ ) (f64.const 0) ) - (br $topmost - (f64.const 5.6) + (then + (br $topmost + (f64.const 5.6) + ) ) ) (f64.const 1.2) @@ -323,8 +335,10 @@ ;; CHECK-TEXT-NEXT: (local.get $x) ;; CHECK-TEXT-NEXT: (f64.const 0) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (br $topmost - ;; CHECK-TEXT-NEXT: (f64.const 1.2) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (br $topmost + ;; CHECK-TEXT-NEXT: (f64.const 1.2) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if @@ -332,8 +346,10 @@ ;; CHECK-TEXT-NEXT: (local.get $Int) ;; CHECK-TEXT-NEXT: (f64.const 0) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (br $topmost - ;; CHECK-TEXT-NEXT: (f64.const -3.4) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (br $topmost + ;; CHECK-TEXT-NEXT: (f64.const -3.4) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if @@ -341,8 +357,10 @@ ;; CHECK-TEXT-NEXT: (local.get $Double) ;; CHECK-TEXT-NEXT: (i32.const 0) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (br $topmost - ;; CHECK-TEXT-NEXT: (f64.const 5.6) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (br $topmost + ;; CHECK-TEXT-NEXT: (f64.const 5.6) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if @@ -350,8 +368,10 @@ ;; CHECK-TEXT-NEXT: (local.get $x) ;; CHECK-TEXT-NEXT: (local.get $y) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (br $topmost - ;; CHECK-TEXT-NEXT: (local.get $x) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (br $topmost + ;; CHECK-TEXT-NEXT: (local.get $x) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (local.get $y) @@ -367,8 +387,10 @@ ;; CHECK-BIN-NEXT: (local.get $x) ;; CHECK-BIN-NEXT: (f64.const 0) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (br $label$1 - ;; CHECK-BIN-NEXT: (f64.const 1.2) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (br $label$1 + ;; CHECK-BIN-NEXT: (f64.const 1.2) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (if @@ -376,8 +398,10 @@ ;; CHECK-BIN-NEXT: (local.get $Int) ;; CHECK-BIN-NEXT: (f64.const 0) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (br $label$1 - ;; CHECK-BIN-NEXT: (f64.const -3.4) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (br $label$1 + ;; CHECK-BIN-NEXT: (f64.const -3.4) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (if @@ -385,8 +409,10 @@ ;; CHECK-BIN-NEXT: (local.get $Double) ;; CHECK-BIN-NEXT: (i32.const 0) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (br $label$1 - ;; CHECK-BIN-NEXT: (f64.const 5.6) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (br $label$1 + ;; CHECK-BIN-NEXT: (f64.const 5.6) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (if @@ -394,8 +420,10 @@ ;; CHECK-BIN-NEXT: (local.get $x) ;; CHECK-BIN-NEXT: (local.get $y) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (br $label$1 - ;; CHECK-BIN-NEXT: (local.get $x) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (br $label$1 + ;; CHECK-BIN-NEXT: (local.get $x) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (local.get $y) @@ -411,8 +439,10 @@ (local.get $x) (f64.const 0) ) - (br $topmost - (f64.const 1.2) + (then + (br $topmost + (f64.const 1.2) + ) ) ) (if @@ -420,8 +450,10 @@ (local.get $Int) (f64.const 0) ) - (br $topmost - (f64.const -3.4) + (then + (br $topmost + (f64.const -3.4) + ) ) ) (if @@ -429,8 +461,10 @@ (local.get $Double) (i32.const 0) ) - (br $topmost - (f64.const 5.6) + (then + (br $topmost + (f64.const 5.6) + ) ) ) (if @@ -438,8 +472,10 @@ (local.get $x) (local.get $y) ) - (br $topmost - (local.get $x) + (then + (br $topmost + (local.get $x) + ) ) ) (local.get $y) @@ -1497,11 +1533,15 @@ ;; CHECK-TEXT-NEXT: (f64.abs ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 3) - ;; CHECK-TEXT-NEXT: (return - ;; CHECK-TEXT-NEXT: (i32.const 2) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (return + ;; CHECK-TEXT-NEXT: (i32.const 2) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (return - ;; CHECK-TEXT-NEXT: (i32.const 1) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (return + ;; CHECK-TEXT-NEXT: (i32.const 1) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) @@ -1509,11 +1549,15 @@ ;; CHECK-BIN: (func $unreachable-if (type $5) (result i32) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 3) - ;; CHECK-BIN-NEXT: (return - ;; CHECK-BIN-NEXT: (i32.const 2) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (return + ;; CHECK-BIN-NEXT: (i32.const 2) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (return - ;; CHECK-BIN-NEXT: (i32.const 1) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (return + ;; CHECK-BIN-NEXT: (i32.const 1) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) @@ -1521,38 +1565,54 @@ (f64.abs (if ;; note no type - valid in binaryen IR, in wasm must be i32 (i32.const 3) - (return (i32.const 2)) - (return (i32.const 1)) + (then + (return (i32.const 2)) + ) + (else + (return (i32.const 1)) + ) ) ) ) ;; CHECK-TEXT: (func $unreachable-if-toplevel (type $5) (result i32) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 3) - ;; CHECK-TEXT-NEXT: (return - ;; CHECK-TEXT-NEXT: (i32.const 2) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (return + ;; CHECK-TEXT-NEXT: (i32.const 2) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) - ;; CHECK-TEXT-NEXT: (return - ;; CHECK-TEXT-NEXT: (i32.const 1) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (return + ;; CHECK-TEXT-NEXT: (i32.const 1) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-BIN: (func $unreachable-if-toplevel (type $5) (result i32) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 3) - ;; CHECK-BIN-NEXT: (return - ;; CHECK-BIN-NEXT: (i32.const 2) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (return + ;; CHECK-BIN-NEXT: (i32.const 2) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) - ;; CHECK-BIN-NEXT: (return - ;; CHECK-BIN-NEXT: (i32.const 1) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (return + ;; CHECK-BIN-NEXT: (i32.const 1) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $unreachable-if-toplevel (result i32) (if ;; note no type - valid in binaryen IR, in wasm must be i32 (i32.const 3) - (return (i32.const 2)) - (return (i32.const 1)) + (then + (return (i32.const 2)) + ) + (else + (return (i32.const 1)) + ) ) ) ;; CHECK-TEXT: (func $unreachable-loop (type $5) (result i32) @@ -1648,68 +1708,102 @@ ;; CHECK-TEXT: (func $unreachable-ifs (type $FUNCSIG$v) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (nop) - ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (nop) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (nop) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-BIN: (func $unreachable-ifs (type $FUNCSIG$v) ;; CHECK-BIN-NEXT: (unreachable) ;; CHECK-BIN-NEXT: ) (func $unreachable-ifs - (if (unreachable) (nop)) - (if (unreachable) (unreachable)) - (if (unreachable) (nop) (nop)) - (if (unreachable) (unreachable) (nop)) - (if (unreachable) (nop) (unreachable)) - (if (unreachable) (unreachable) (unreachable)) + (if (unreachable) (then (nop))) + (if (unreachable) (then (unreachable))) + (if (unreachable) (then (nop) )(else (nop))) + (if (unreachable) (then (unreachable) )(else (nop))) + (if (unreachable) (then (nop) )(else (unreachable))) + (if (unreachable) (then (unreachable) )(else (unreachable))) ;; - (if (i32.const 1) (unreachable) (nop)) - (if (i32.const 1) (nop) (unreachable)) - (if (i32.const 1) (unreachable) (unreachable)) + (if (i32.const 1) (then (unreachable) )(else (nop))) + (if (i32.const 1) (then (nop) )(else (unreachable))) + (if (i32.const 1) (then (unreachable) )(else (unreachable))) ) ;; CHECK-TEXT: (func $unreachable-if-arm (type $FUNCSIG$v) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (nop) - ;; CHECK-TEXT-NEXT: (block + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (nop) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else ;; CHECK-TEXT-NEXT: (unreachable) ;; CHECK-TEXT-NEXT: (drop ;; CHECK-TEXT-NEXT: (i32.const 1) @@ -1720,20 +1814,28 @@ ;; CHECK-BIN: (func $unreachable-if-arm (type $FUNCSIG$v) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (nop) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (nop) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $unreachable-if-arm (if (i32.const 1) - (block - (nop) + (then + (block + (nop) + ) ) - (block - (unreachable) - (drop - (i32.const 1) + (else + (block + (unreachable) + (drop + (i32.const 1) + ) ) ) ) @@ -1800,8 +1902,10 @@ ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 -;; CHECK-BIN-NODEBUG-NEXT: (f64.const -3.4) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 +;; CHECK-BIN-NODEBUG-NEXT: (f64.const -3.4) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (if @@ -1811,8 +1915,10 @@ ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (f64.const 0) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 -;; CHECK-BIN-NODEBUG-NEXT: (f64.const 5.6) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 +;; CHECK-BIN-NODEBUG-NEXT: (f64.const 5.6) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (f64.const 1.2) @@ -1829,8 +1935,10 @@ ;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) ;; CHECK-BIN-NODEBUG-NEXT: (f64.const 0) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 -;; CHECK-BIN-NODEBUG-NEXT: (f64.const 1.2) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 +;; CHECK-BIN-NODEBUG-NEXT: (f64.const 1.2) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (if @@ -1838,8 +1946,10 @@ ;; CHECK-BIN-NODEBUG-NEXT: (local.get $3) ;; CHECK-BIN-NODEBUG-NEXT: (f64.const 0) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 -;; CHECK-BIN-NODEBUG-NEXT: (f64.const -3.4) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 +;; CHECK-BIN-NODEBUG-NEXT: (f64.const -3.4) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (if @@ -1847,8 +1957,10 @@ ;; CHECK-BIN-NODEBUG-NEXT: (local.get $4) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 0) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 -;; CHECK-BIN-NODEBUG-NEXT: (f64.const 5.6) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 +;; CHECK-BIN-NODEBUG-NEXT: (f64.const 5.6) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (if @@ -1856,8 +1968,10 @@ ;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) ;; CHECK-BIN-NODEBUG-NEXT: (local.get $1) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 -;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (br $label$1 +;; CHECK-BIN-NODEBUG-NEXT: (local.get $0) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (local.get $1) @@ -2229,11 +2343,15 @@ ;; CHECK-BIN-NODEBUG: (func $29 (type $0) (result i32) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 3) -;; CHECK-BIN-NODEBUG-NEXT: (return -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 2) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (return +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 2) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (return -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (return +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -2241,11 +2359,15 @@ ;; CHECK-BIN-NODEBUG: (func $30 (type $0) (result i32) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 3) -;; CHECK-BIN-NODEBUG-NEXT: (return -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 2) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (return +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 2) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) -;; CHECK-BIN-NODEBUG-NEXT: (return -;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (return +;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -2291,7 +2413,11 @@ ;; CHECK-BIN-NODEBUG: (func $36 (type $1) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (nop) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (nop) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) diff --git a/test/lit/basic/unreachable-code.wast b/test/lit/basic/unreachable-code.wast index 16ec691a5..0dfb00c40 100644 --- a/test/lit/basic/unreachable-code.wast +++ b/test/lit/basic/unreachable-code.wast @@ -15,7 +15,9 @@ ;; CHECK-TEXT: (func $a (type $0) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-BIN: (type $0 (func)) @@ -23,52 +25,74 @@ ;; CHECK-BIN: (func $a (type $0) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $a (if (i32.const 1) - (unreachable) + (then + (unreachable) + ) ) ) ;; CHECK-TEXT: (func $b (type $0) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-BIN: (func $b (type $0) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $b (if (i32.const 1) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) ;; CHECK-TEXT: (func $a-block (type $0) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-BIN: (func $a-block (type $0) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $a-block (block (if (i32.const 1) - (unreachable) + (then + (unreachable) + ) ) ) ) @@ -76,22 +100,34 @@ ;; CHECK-TEXT: (func $b-block (type $0) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-BIN: (func $b-block (type $0) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $b-block (block (if (i32.const 1) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) ) @@ -100,7 +136,9 @@ ;; CHECK-TEXT-NEXT: (nop) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (nop) ;; CHECK-TEXT-NEXT: ) @@ -108,14 +146,18 @@ ;; CHECK-BIN-NEXT: (nop) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (nop) ;; CHECK-BIN-NEXT: ) (func $a-prepost (nop) (if (i32.const 1) - (unreachable) + (then + (unreachable) + ) ) (nop) ) @@ -124,8 +166,12 @@ ;; CHECK-TEXT-NEXT: (nop) ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (nop) ;; CHECK-TEXT-NEXT: ) @@ -133,15 +179,23 @@ ;; CHECK-BIN-NEXT: (nop) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $b-prepost (nop) (if (i32.const 1) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) (nop) ) @@ -151,7 +205,9 @@ ;; CHECK-TEXT-NEXT: (block ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (nop) @@ -160,7 +216,9 @@ ;; CHECK-BIN-NEXT: (nop) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: (nop) ;; CHECK-BIN-NEXT: ) @@ -168,7 +226,9 @@ (nop) (block (if (i32.const 1) - (unreachable) + (then + (unreachable) + ) ) ) (nop) @@ -179,8 +239,12 @@ ;; CHECK-TEXT-NEXT: (block ;; CHECK-TEXT-NEXT: (if ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: (nop) @@ -189,16 +253,24 @@ ;; CHECK-BIN-NEXT: (nop) ;; CHECK-BIN-NEXT: (if ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) - ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: (then + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $b-block-prepost (nop) (block (if (i32.const 1) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) (nop) @@ -272,30 +344,42 @@ ;; CHECK-BIN-NODEBUG: (func $0 (type $0) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG: (func $1 (type $0) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG: (func $2 (type $0) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG: (func $3 (type $0) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -303,7 +387,9 @@ ;; CHECK-BIN-NODEBUG-NEXT: (nop) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (nop) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -312,8 +398,12 @@ ;; CHECK-BIN-NODEBUG-NEXT: (nop) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -321,7 +411,9 @@ ;; CHECK-BIN-NODEBUG-NEXT: (nop) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: (nop) ;; CHECK-BIN-NODEBUG-NEXT: ) @@ -330,8 +422,12 @@ ;; CHECK-BIN-NODEBUG-NEXT: (nop) ;; CHECK-BIN-NODEBUG-NEXT: (if ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: (then +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) diff --git a/test/lit/basic/untaken-br_if.wast b/test/lit/basic/untaken-br_if.wast index 23063d796..bf2ad1ce3 100644 --- a/test/lit/basic/untaken-br_if.wast +++ b/test/lit/basic/untaken-br_if.wast @@ -15,11 +15,15 @@ ;; CHECK-TEXT: (func $binaryify-untaken-br_if (type $0) (result f32) ;; CHECK-TEXT-NEXT: (if (result f32) ;; CHECK-TEXT-NEXT: (i32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) - ;; CHECK-TEXT-NEXT: (block $label$1 (result f32) - ;; CHECK-TEXT-NEXT: (br_if $label$1 - ;; CHECK-TEXT-NEXT: (f32.const 1) - ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: (then + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) + ;; CHECK-TEXT-NEXT: (else + ;; CHECK-TEXT-NEXT: (block $label$1 (result f32) + ;; CHECK-TEXT-NEXT: (br_if $label$1 + ;; CHECK-TEXT-NEXT: (f32.const 1) + ;; CHECK-TEXT-NEXT: (unreachable) + ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) ;; CHECK-TEXT-NEXT: ) @@ -29,23 +33,31 @@ ;; CHECK-BIN: (func $binaryify-untaken-br_if (type $0) (result f32) ;; CHECK-BIN-NEXT: (if (result f32) ;; CHECK-BIN-NEXT: (i32.const 1) - ;; CHECK-BIN-NEXT: (unreachable) - ;; CHECK-BIN-NEXT: (block $label$3 (result f32) - ;; CHECK-BIN-NEXT: (drop - ;; CHECK-BIN-NEXT: (f32.const 1) - ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (then ;; CHECK-BIN-NEXT: (unreachable) ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (else + ;; CHECK-BIN-NEXT: (block $label$3 (result f32) + ;; CHECK-BIN-NEXT: (drop + ;; CHECK-BIN-NEXT: (f32.const 1) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: (unreachable) + ;; CHECK-BIN-NEXT: ) + ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) ;; CHECK-BIN-NEXT: ) (func $binaryify-untaken-br_if (result f32) (if (result f32) (i32.const 1) - (unreachable) - (block $label$1 (result f32) - (br_if $label$1 - (f32.const 1) - (unreachable) + (then + (unreachable) + ) + (else + (block $label$1 (result f32) + (br_if $label$1 + (f32.const 1) + (unreachable) + ) ) ) ) @@ -56,12 +68,16 @@ ;; CHECK-BIN-NODEBUG: (func $0 (type $0) (result f32) ;; CHECK-BIN-NODEBUG-NEXT: (if (result f32) ;; CHECK-BIN-NODEBUG-NEXT: (i32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: (unreachable) -;; CHECK-BIN-NODEBUG-NEXT: (block $label$3 (result f32) -;; CHECK-BIN-NODEBUG-NEXT: (drop -;; CHECK-BIN-NODEBUG-NEXT: (f32.const 1) -;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (then ;; CHECK-BIN-NODEBUG-NEXT: (unreachable) ;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (else +;; CHECK-BIN-NODEBUG-NEXT: (block $label$3 (result f32) +;; CHECK-BIN-NODEBUG-NEXT: (drop +;; CHECK-BIN-NODEBUG-NEXT: (f32.const 1) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: (unreachable) +;; CHECK-BIN-NODEBUG-NEXT: ) +;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) ;; CHECK-BIN-NODEBUG-NEXT: ) diff --git a/test/lit/if-then-else.wast b/test/lit/if-then-else.wast index 9d457bef1..9d13cea92 100644 --- a/test/lit/if-then-else.wast +++ b/test/lit/if-then-else.wast @@ -6,18 +6,22 @@ ;; CHECK: (func $test (param $0 i32) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return diff --git a/test/lit/multivalue.wast b/test/lit/multivalue.wast index 77941f529..e3de5da1b 100644 --- a/test/lit/multivalue.wast +++ b/test/lit/multivalue.wast @@ -473,15 +473,19 @@ ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (if (type $2) (result i32 i64 externref) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (tuple.make 3 - ;; CHECK-NEXT: (i32.const 42) - ;; CHECK-NEXT: (i64.const 42) - ;; CHECK-NEXT: (ref.null noextern) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (tuple.make 3 + ;; CHECK-NEXT: (i32.const 42) + ;; CHECK-NEXT: (i64.const 42) + ;; CHECK-NEXT: (ref.null noextern) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (tuple.make 3 - ;; CHECK-NEXT: (i32.const 42) - ;; CHECK-NEXT: (i64.const 42) - ;; CHECK-NEXT: (ref.null noextern) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (tuple.make 3 + ;; CHECK-NEXT: (i32.const 42) + ;; CHECK-NEXT: (i64.const 42) + ;; CHECK-NEXT: (ref.null noextern) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -500,15 +504,19 @@ (func $mv-if (result i32 i64 externref) (if (result i32 i64 externref) (i32.const 1) - (tuple.make 3 - (i32.const 42) - (i64.const 42) - (ref.null extern) + (then + (tuple.make 3 + (i32.const 42) + (i64.const 42) + (ref.null extern) + ) ) - (tuple.make 3 - (i32.const 42) - (i64.const 42) - (ref.null extern) + (else + (tuple.make 3 + (i32.const 42) + (i64.const 42) + (ref.null extern) + ) ) ) ) diff --git a/test/lit/non-nullable-locals.wast b/test/lit/non-nullable-locals.wast index 04bc5df1a..21c12d4ad 100644 --- a/test/lit/non-nullable-locals.wast +++ b/test/lit/non-nullable-locals.wast @@ -123,11 +123,15 @@ ;; CHECK-NEXT: (ref.func $helper) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -140,11 +144,15 @@ (ref.func $helper) ) ) - (drop - (local.get $x) + (then + (drop + (local.get $x) + ) ) - (drop - (local.get $x) + (else + (drop + (local.get $x) + ) ) ) ) diff --git a/test/lit/passes/O.wast b/test/lit/passes/O.wast index ce2c85211..7affbb8b7 100644 --- a/test/lit/passes/O.wast +++ b/test/lit/passes/O.wast @@ -26,8 +26,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $ret) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 999) @@ -36,9 +38,11 @@ (block $out (result i32) (drop (call $ret)) (if (call $ret) - (return + (then (return - (i32.const 1) + (return + (i32.const 1) + ) ) ) ) @@ -55,8 +59,12 @@ (block $label$1 (if (i32.const 0) - (br $label$1) - (unreachable) + (then + (br $label$1) + ) + (else + (unreachable) + ) ) ) ) @@ -83,16 +91,22 @@ (local.get $0) (i32.const -1073741824) ) - (local.set $0 - (i32.const -1073741824) - ) - (if - (i32.gt_s - (local.get $0) - (i32.const 1073741823) - ) + (then (local.set $0 - (i32.const 1073741823) + (i32.const -1073741824) + ) + ) + (else + (if + (i32.gt_s + (local.get $0) + (i32.const 1073741823) + ) + (then + (local.set $0 + (i32.const 1073741823) + ) + ) ) ) ) @@ -108,8 +122,10 @@ (func $end-if-else (export "end-if-else") (param $x i32) (result i32) (if (local.get $x) - (local.set $x - (i32.const 1) + (then + (local.set $x + (i32.const 1) + ) ) ) (local.get $x) @@ -117,15 +133,21 @@ ;; CHECK: (func $end-if-else-call (; has Stack IR ;) (param $0 i32) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (call $ret) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $ret) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $end-if-else-call (export "end-if-else-call") (param $x i32) (result i32) (if (local.get $x) - (local.set $x - (call $ret) + (then + (local.set $x + (call $ret) + ) ) ) (local.get $x) diff --git a/test/lit/passes/O3_inline-functions-with-loops_flexible-inline-max-function-size=30.wast b/test/lit/passes/O3_inline-functions-with-loops_flexible-inline-max-function-size=30.wast index e0045579d..87dec51e3 100644 --- a/test/lit/passes/O3_inline-functions-with-loops_flexible-inline-max-function-size=30.wast +++ b/test/lit/passes/O3_inline-functions-with-loops_flexible-inline-max-function-size=30.wast @@ -28,8 +28,10 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.add @@ -81,7 +83,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (local.get $0) @@ -134,7 +136,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (local.get $0) diff --git a/test/lit/passes/O3_inlining.wast b/test/lit/passes/O3_inlining.wast index a16a8b8d4..14f54df5c 100644 --- a/test/lit/passes/O3_inlining.wast +++ b/test/lit/passes/O3_inlining.wast @@ -16,7 +16,9 @@ (func $0 (if (global.get $global$1) - (unreachable) + (then + (unreachable) + ) ) (global.set $global$1 (i32.const 0) @@ -29,8 +31,12 @@ (i32.load16_u offset=3 (i32.const 0) ) - (i32.const 1) - (i32.const 0) + (then + (i32.const 1) + ) + (else + (i32.const 0) + ) ) ) (unreachable) @@ -41,7 +47,9 @@ ;; CHECK: (func $1 (param $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global$1) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $global$1 ;; CHECK-NEXT: (i32.const 0) @@ -52,7 +60,9 @@ ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $1 (param $var$0 i32) diff --git a/test/lit/passes/O4_disable-bulk-memory.wast b/test/lit/passes/O4_disable-bulk-memory.wast index 051f62456..63bb0ea40 100644 --- a/test/lit/passes/O4_disable-bulk-memory.wast +++ b/test/lit/passes/O4_disable-bulk-memory.wast @@ -20,14 +20,18 @@ ) (i32.const 127) ) - (unreachable) + (then + (unreachable) + ) ) (global.set $global$0 (i32.const -1) ) (if (global.get $global$0) - (unreachable) + (then + (unreachable) + ) ) (unreachable) ) @@ -162,30 +166,34 @@ (i32.const 2) ) ) - (block (result i32) - (local.set $3 - (local.get $2) - ) - (local.set $4 - (local.get $1) - ) - (local.set $5 - (i32.const 0) - ) - (i32.load offset=8 - (i32.add + (then + (block (result i32) + (local.set $3 + (local.get $2) + ) + (local.set $4 + (local.get $1) + ) + (local.set $5 + (i32.const 0) + ) + (i32.load offset=8 (i32.add - (local.get $3) - (i32.shl - (local.get $4) - (i32.const 2) + (i32.add + (local.get $3) + (i32.shl + (local.get $4) + (i32.const 2) + ) ) + (local.get $5) ) - (local.get $5) ) ) ) - (unreachable) + (else + (unreachable) + ) ) ) (func $assembly/index/Body#offsetMomentum (; 5 ;) (type $2) (param $0 i32) (param $1 f64) (param $2 f64) (param $3 f64) (result i32) @@ -227,7 +235,9 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 1073741824) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.gt_u @@ -259,42 +269,48 @@ ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (memory.grow - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (memory.grow + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 65535) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 65535) + ;; CHECK-NEXT: (i32.const -65536) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -65536) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (memory.grow - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (memory.grow + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -315,7 +331,9 @@ (local.get $0) (i32.const 1073741824) ) - (unreachable) + (then + (unreachable) + ) ) (local.set $1 (global.get $global$1) @@ -357,54 +375,60 @@ (i32.const 16) ) ) - (block - (local.set $2 - (i32.shr_u - (i32.and - (i32.add - (i32.sub - (local.get $4) - (local.get $1) + (then + (block + (local.set $2 + (i32.shr_u + (i32.and + (i32.add + (i32.sub + (local.get $4) + (local.get $1) + ) + (i32.const 65535) + ) + (i32.xor + (i32.const 65535) + (i32.const -1) ) - (i32.const 65535) - ) - (i32.xor - (i32.const 65535) - (i32.const -1) ) + (i32.const 16) ) - (i32.const 16) ) - ) - (local.set $3 - (select - (local.tee $3 - (local.get $5) - ) - (local.tee $6 - (local.get $2) - ) - (i32.gt_s - (local.get $3) - (local.get $6) - ) - ) - ) - (if - (i32.lt_s - (memory.grow - (local.get $3) + (local.set $3 + (select + (local.tee $3 + (local.get $5) + ) + (local.tee $6 + (local.get $2) + ) + (i32.gt_s + (local.get $3) + (local.get $6) + ) ) - (i32.const 0) ) (if (i32.lt_s (memory.grow - (local.get $2) + (local.get $3) ) (i32.const 0) ) - (unreachable) + (then + (if + (i32.lt_s + (memory.grow + (local.get $2) + ) + (i32.const 0) + ) + (then + (unreachable) + ) + ) + ) ) ) ) @@ -531,9 +555,11 @@ (i32.eqz (local.get $0) ) - (local.set $0 - (call $~lib/memory/memory.allocate - (i32.const 4) + (then + (local.set $0 + (call $~lib/memory/memory.allocate + (i32.const 4) + ) ) ) ) @@ -584,9 +610,11 @@ (i32.eqz (local.get $0) ) - (local.set $0 - (call $~lib/memory/memory.allocate - (i32.const 56) + (then + (local.set $0 + (call $~lib/memory/memory.allocate + (i32.const 56) + ) ) ) ) @@ -755,14 +783,16 @@ (i32.const 1073741816) ) ) - (block - (call $~lib/env/abort - (i32.const 0) - (i32.const 40) - (i32.const 26) - (i32.const 2) + (then + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 40) + (i32.const 26) + (i32.const 2) + ) + (unreachable) ) - (unreachable) ) ) (local.set $1 @@ -793,7 +823,9 @@ (i32.eqz (local.get $2) ) - (return) + (then + (return) + ) ) (i32.store8 (local.get $0) @@ -814,7 +846,9 @@ (local.get $2) (i32.const 2) ) - (return) + (then + (return) + ) ) (i32.store8 (i32.add @@ -855,7 +889,9 @@ (local.get $2) (i32.const 6) ) - (return) + (then + (return) + ) ) (i32.store8 (i32.add @@ -879,7 +915,9 @@ (local.get $2) (i32.const 8) ) - (return) + (then + (return) + ) ) (local.set $3 (i32.and @@ -939,7 +977,9 @@ (local.get $2) (i32.const 8) ) - (return) + (then + (return) + ) ) (i32.store (i32.add @@ -980,7 +1020,9 @@ (local.get $2) (i32.const 24) ) - (return) + (then + (return) + ) ) (i32.store (i32.add @@ -1091,47 +1133,49 @@ (local.get $2) (i32.const 32) ) - (block - (block $label$10 - (i64.store - (local.get $0) - (local.get $5) - ) - (i64.store - (i32.add + (then + (block + (block $label$10 + (i64.store (local.get $0) - (i32.const 8) + (local.get $5) ) - (local.get $5) - ) - (i64.store - (i32.add - (local.get $0) - (i32.const 16) + (i64.store + (i32.add + (local.get $0) + (i32.const 8) + ) + (local.get $5) ) - (local.get $5) - ) - (i64.store - (i32.add - (local.get $0) - (i32.const 24) + (i64.store + (i32.add + (local.get $0) + (i32.const 16) + ) + (local.get $5) ) - (local.get $5) - ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 32) + (i64.store + (i32.add + (local.get $0) + (i32.const 24) + ) + (local.get $5) ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 32) + (local.set $2 + (i32.sub + (local.get $2) + (i32.const 32) + ) + ) + (local.set $0 + (i32.add + (local.get $0) + (i32.const 32) + ) ) ) + (br $label$8) ) - (br $label$8) ) ) ) @@ -1148,14 +1192,16 @@ (local.get $1) (i32.const 268435454) ) - (block - (call $~lib/env/abort - (i32.const 0) - (i32.const 8) - (i32.const 45) - (i32.const 39) + (then + (block + (call $~lib/env/abort + (i32.const 0) + (i32.const 8) + (i32.const 45) + (i32.const 39) + ) + (unreachable) ) - (unreachable) ) ) (local.set $2 @@ -1175,9 +1221,11 @@ (i32.eqz (local.get $0) ) - (local.set $0 - (call $~lib/memory/memory.allocate - (i32.const 8) + (then + (local.set $0 + (call $~lib/memory/memory.allocate + (i32.const 8) + ) ) ) ) @@ -1514,7 +1562,7 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i64.const 0) @@ -1668,7 +1716,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (f64.load offset=48 ;; CHECK-NEXT: (local.tee $1 @@ -1742,10 +1790,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load offset=8 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.load offset=8 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (f64.div @@ -1854,7 +1906,7 @@ ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (local.get $13) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $14 ;; CHECK-NEXT: (f64.load ;; CHECK-NEXT: (local.tee $0 @@ -1914,7 +1966,7 @@ ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: (local.get $13) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (f64.mul ;; CHECK-NEXT: (local.get $17) @@ -2701,7 +2753,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (f64.load ;; CHECK-NEXT: (local.tee $1 @@ -2784,7 +2836,7 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (f64.sub ;; CHECK-NEXT: (local.get $7) @@ -2946,32 +2998,40 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load offset=8 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.load offset=8 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $assembly/index/getBody (; 25 ;) (type $3) (param $0 i32) (result i32) @@ -2994,11 +3054,15 @@ ) ) ) - (call $~lib/array/Array<Body>#__get - (local.get $1) - (local.get $0) + (then + (call $~lib/array/Array<Body>#__get + (local.get $1) + (local.get $0) + ) + ) + (else + (i32.const 0) ) - (i32.const 0) ) ) ;; CHECK: (func $start (; has Stack IR ;) diff --git a/test/lit/passes/Oz.wast b/test/lit/passes/Oz.wast index 85a722737..42295ec23 100644 --- a/test/lit/passes/Oz.wast +++ b/test/lit/passes/Oz.wast @@ -166,8 +166,10 @@ ;; CHECK: (func $11 (type $1) (; has Stack IR ;) (param $0 i32) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) @@ -175,9 +177,13 @@ (func $11 (export "eliminate-redundant-checks-1") (param $0 i32) (result i32) (if (local.get $0) - (if - (local.get $0) - (return (local.get $0)) + (then + (if + (local.get $0) + (then + (return (local.get $0)) + ) + ) ) ) (i32.const 0) @@ -189,15 +195,19 @@ (i32.const 0) (local.get $0) ) - (return (local.get $0)) + (then + (return (local.get $0)) + ) ) (i32.const 0) ) ;; CHECK: (func $12 (type $0) (; has Stack IR ;) (param $0 i32) (param $1 i32) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) @@ -205,9 +215,13 @@ (func $12 (export "eliminate-redundant-checks-2") (param $0 i32) (param $1 i32) (result i32) (if (local.tee $1 (local.get $0)) - (if - (local.get $1) - (return (local.get $1)) + (then + (if + (local.get $1) + (then + (return (local.get $1)) + ) + ) ) ) (i32.const 0) @@ -219,7 +233,9 @@ (i32.const 0) (local.get $1) ) - (return (local.get $1)) + (then + (return (local.get $1)) + ) ) (i32.const 0) ) @@ -230,8 +246,10 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) @@ -243,7 +261,9 @@ (i32.const 0) (local.tee $1 (local.get $0)) ) - (return (local.get $1)) + (then + (return (local.get $1)) + ) ) (i32.const 0) ) @@ -255,8 +275,10 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) @@ -268,7 +290,9 @@ (local.get $1) (local.tee $1 (local.get $0)) ) - (return (local.get $1)) + (then + (return (local.get $1)) + ) ) (i32.const 0) ) diff --git a/test/lit/passes/asyncify-wasm64.wast b/test/lit/passes/asyncify-wasm64.wast index 8349eedf2..07d1942e4 100644 --- a/test/lit/passes/asyncify-wasm64.wast +++ b/test/lit/passes/asyncify-wasm64.wast @@ -55,7 +55,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -91,7 +91,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -116,7 +116,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $dead0) ;; CHECK-NEXT: ) @@ -145,15 +145,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -163,7 +165,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -254,7 +256,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -290,7 +292,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -315,7 +317,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $dead0) ;; CHECK-NEXT: ) @@ -344,15 +346,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -362,7 +366,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -451,7 +455,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -487,7 +491,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -518,15 +522,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -536,7 +542,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -557,15 +563,17 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -575,7 +583,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $live1) ;; CHECK-NEXT: ) @@ -652,7 +660,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -683,7 +691,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -711,28 +719,32 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -741,7 +753,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -797,7 +809,9 @@ ;; CHECK-NEXT: ) (func $liveness4 (param $live0 i32) (param $dead0 i32) (if (i32.const 0) - (call $import) + (then + (call $import) + ) ) (drop (local.get $live0)) ) @@ -811,7 +825,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -822,7 +838,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -847,7 +863,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $dead0) ;; CHECK-NEXT: ) @@ -865,28 +881,32 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -895,7 +915,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $dead0 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -937,7 +957,9 @@ (func $liveness5 (param $dead0 i32) (drop (local.get $dead0)) (if (i32.const 0) - (call $import) ;; live before and after call, but not during + (then + (call $import) ;; live before and after call, but not during + ) ) (local.set $dead0 (i32.const 1)) (drop (local.get $dead0)) @@ -953,7 +975,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -984,7 +1006,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -1009,8 +1031,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $live) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $live) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -1024,7 +1048,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import2 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -1033,8 +1057,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1098,7 +1124,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -1134,7 +1160,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i64.add @@ -1159,7 +1185,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -1180,7 +1206,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call_indirect (type $f) ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $3) @@ -1190,8 +1216,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1264,7 +1292,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1281,7 +1311,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1301,7 +1333,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1318,7 +1352,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify-wasm64_pass-arg=in-secondary-memory.wast b/test/lit/passes/asyncify-wasm64_pass-arg=in-secondary-memory.wast index 35692883e..1a8f6dfef 100644 --- a/test/lit/passes/asyncify-wasm64_pass-arg=in-secondary-memory.wast +++ b/test/lit/passes/asyncify-wasm64_pass-arg=in-secondary-memory.wast @@ -48,7 +48,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store $asyncify_memory ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -84,7 +84,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store $asyncify_memory ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -109,7 +109,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $dead0) ;; CHECK-NEXT: ) @@ -138,15 +138,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -156,7 +158,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -248,7 +250,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -265,7 +269,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -285,7 +291,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -302,7 +310,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify.wast b/test/lit/passes/asyncify.wast index 236f29fa5..968cc5716 100644 --- a/test/lit/passes/asyncify.wast +++ b/test/lit/passes/asyncify.wast @@ -54,7 +54,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -90,7 +90,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -115,7 +115,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $dead0) ;; CHECK-NEXT: ) @@ -144,15 +144,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -162,7 +164,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -253,7 +255,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -289,7 +291,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -314,7 +316,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $dead0) ;; CHECK-NEXT: ) @@ -343,15 +345,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -361,7 +365,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -450,7 +454,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -486,7 +490,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -517,15 +521,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -535,7 +541,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -556,15 +562,17 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -574,7 +582,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $live1) ;; CHECK-NEXT: ) @@ -651,7 +659,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -682,7 +690,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -710,28 +718,32 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -740,7 +752,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -796,7 +808,9 @@ ;; CHECK-NEXT: ) (func $liveness4 (param $live0 i32) (param $dead0 i32) (if (i32.const 0) - (call $import) + (then + (call $import) + ) ) (drop (local.get $live0)) ) @@ -810,7 +824,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -821,7 +837,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -846,7 +862,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $dead0) ;; CHECK-NEXT: ) @@ -864,28 +880,32 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -894,7 +914,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $dead0 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -936,7 +956,9 @@ (func $liveness5 (param $dead0 i32) (drop (local.get $dead0)) (if (i32.const 0) - (call $import) ;; live before and after call, but not during + (then + (call $import) ;; live before and after call, but not during + ) ) (local.set $dead0 (i32.const 1)) (drop (local.get $dead0)) @@ -952,7 +974,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -983,7 +1005,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1008,8 +1030,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $live) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $live) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -1023,7 +1047,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import2 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -1032,8 +1056,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1097,7 +1123,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1133,7 +1159,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1158,7 +1184,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -1179,7 +1205,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call_indirect (type $f) ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $3) @@ -1189,8 +1215,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1263,7 +1291,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1280,7 +1310,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1300,7 +1332,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1317,7 +1351,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_enable-multivalue.wast b/test/lit/passes/asyncify_enable-multivalue.wast index 04b0a4707..69ae2efc6 100644 --- a/test/lit/passes/asyncify_enable-multivalue.wast +++ b/test/lit/passes/asyncify_enable-multivalue.wast @@ -41,7 +41,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $sleeping) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $sleeping ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -49,7 +49,7 @@ ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (global.set $sleeping ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -60,14 +60,18 @@ (func $do_sleep (if (i32.eqz (global.get $sleeping)) - (block - (global.set $sleeping (i32.const 1)) - ;; we should set up the data at address 4 around here - (call $asyncify_start_unwind (i32.const 4)) + (then + (block + (global.set $sleeping (i32.const 1)) + ;; we should set up the data at address 4 around here + (call $asyncify_start_unwind (i32.const 4)) + ) ) - (block - (global.set $sleeping (i32.const 0)) - (call $asyncify_stop_rewind) + (else + (block + (global.set $sleeping (i32.const 0)) + (call $asyncify_stop_rewind) + ) ) ) ) @@ -80,7 +84,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -91,7 +97,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -116,7 +122,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $stuff) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $stuff) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -129,15 +137,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $do_sleep) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -147,7 +157,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $stuff) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $stuff) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -192,7 +204,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -203,7 +217,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -233,15 +247,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $work) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -318,7 +334,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -335,7 +353,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -355,7 +375,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -372,7 +394,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -423,7 +447,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -434,7 +460,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -464,15 +490,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -520,7 +548,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -551,7 +579,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -583,7 +611,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -592,11 +620,15 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -606,7 +638,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $temp ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -684,7 +716,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -715,7 +747,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -746,7 +778,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -755,11 +787,15 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -769,8 +805,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -850,7 +888,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -881,7 +919,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -907,36 +945,38 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $l - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $l + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.div_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.div_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $y + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $l + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $y - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $l - ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -951,15 +991,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -969,7 +1011,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) @@ -1050,7 +1092,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -1061,7 +1105,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1086,8 +1130,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -1098,28 +1144,32 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1150,7 +1200,9 @@ ;; CHECK-NEXT: ) (func $calls-import2-if (param $x i32) (if (local.get $x) - (call $import) + (then + (call $import) + ) ) ) ;; CHECK: (func $calls-import2-if-else (param $x i32) @@ -1165,7 +1217,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1196,7 +1248,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1221,8 +1273,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block @@ -1231,8 +1285,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -1243,30 +1299,34 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1280,30 +1340,34 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1354,8 +1418,12 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else (param $x i32) (if (local.get $x) - (call $import3 (i32.const 1)) - (call $import3 (i32.const 2)) + (then + (call $import3 (i32.const 1)) + ) + (else + (call $import3 (i32.const 2)) + ) ) ) ;; CHECK: (func $calls-import2-if-else-oneside (param $x i32) (result i32) @@ -1370,7 +1438,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -1381,7 +1451,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1408,8 +1478,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block @@ -1418,8 +1490,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -1430,13 +1504,17 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1450,30 +1528,34 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1484,8 +1566,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1518,8 +1602,12 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else-oneside (param $x i32) (result i32) (if (local.get $x) - (return (i32.const 1)) - (call $import3 (i32.const 2)) + (then + (return (i32.const 1)) + ) + (else + (call $import3 (i32.const 2)) + ) ) (return (i32.const 3)) ) @@ -1537,7 +1625,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1568,7 +1656,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1595,8 +1683,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block @@ -1605,8 +1695,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -1617,30 +1709,34 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1654,13 +1750,17 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1671,8 +1771,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1724,8 +1826,12 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else-oneside2 (param $x i32) (result i32) (if (local.get $x) - (call $import3 (i32.const 1)) - (return (i32.const 2)) + (then + (call $import3 (i32.const 1)) + ) + (else + (return (i32.const 2)) + ) ) (return (i32.const 3)) ) @@ -1742,7 +1848,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1778,7 +1884,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1809,7 +1915,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (call $import-mv) ;; CHECK-NEXT: ) @@ -1818,11 +1924,15 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1832,8 +1942,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1905,7 +2017,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1936,7 +2048,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1967,7 +2079,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import3 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -1976,8 +2088,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1987,7 +2101,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -2079,7 +2193,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -2110,7 +2224,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -2141,7 +2255,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -2150,11 +2264,15 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2164,8 +2282,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $l - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $l + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2227,7 +2347,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -2238,7 +2360,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -2263,7 +2385,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -2276,15 +2400,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2294,7 +2420,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -2307,15 +2435,17 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2363,7 +2493,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -2374,7 +2506,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -2399,7 +2531,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring-deep) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring-deep) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -2412,15 +2546,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import-deep) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2430,7 +2566,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -2443,15 +2581,17 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2501,7 +2641,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -2512,7 +2654,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -2542,15 +2684,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2600,7 +2744,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2617,7 +2763,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2637,7 +2785,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2654,7 +2804,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2701,7 +2853,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2718,7 +2872,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2738,7 +2894,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2755,7 +2913,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind.wast b/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind.wast index 59817d3be..dcb4ead34 100644 --- a/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind.wast +++ b/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind.wast @@ -38,7 +38,9 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -46,7 +48,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -76,12 +78,14 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -126,7 +130,7 @@ ;; CHECK-NEXT: (local $9 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -154,7 +158,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -186,17 +190,21 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -206,7 +214,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $temp ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -281,7 +289,7 @@ ;; CHECK-NEXT: (local $5 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -309,7 +317,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -340,17 +348,21 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -360,8 +372,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -438,7 +452,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -455,7 +471,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -475,7 +493,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -492,7 +512,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind_O.wast b/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind_O.wast index b9ee21463..7d53b6cbb 100644 --- a/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind_O.wast +++ b/test/lit/passes/asyncify_mod-asyncify-always-and-only-unwind_O.wast @@ -89,7 +89,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -106,7 +108,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -126,7 +130,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_mod-asyncify-never-unwind.wast b/test/lit/passes/asyncify_mod-asyncify-never-unwind.wast index 6e0e5885c..1ac962eb9 100644 --- a/test/lit/passes/asyncify_mod-asyncify-never-unwind.wast +++ b/test/lit/passes/asyncify_mod-asyncify-never-unwind.wast @@ -41,7 +41,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -52,7 +54,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -82,12 +84,14 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -135,7 +139,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -166,7 +170,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -198,17 +202,21 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -218,7 +226,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $temp ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -296,7 +304,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -327,7 +335,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -358,17 +366,21 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -378,8 +390,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -456,7 +470,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -473,7 +489,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -493,7 +511,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -510,7 +530,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_mod-asyncify-never-unwind_O.wast b/test/lit/passes/asyncify_mod-asyncify-never-unwind_O.wast index ec16b6d9c..112d750ba 100644 --- a/test/lit/passes/asyncify_mod-asyncify-never-unwind_O.wast +++ b/test/lit/passes/asyncify_mod-asyncify-never-unwind_O.wast @@ -51,7 +51,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -67,11 +67,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $calls-import @@ -105,7 +109,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -122,7 +128,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -142,7 +150,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_optimize-level=1.wast b/test/lit/passes/asyncify_optimize-level=1.wast index d745c4bc4..0eefc7ffa 100644 --- a/test/lit/passes/asyncify_optimize-level=1.wast +++ b/test/lit/passes/asyncify_optimize-level=1.wast @@ -50,7 +50,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -66,11 +66,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $__asyncify_unwind @@ -113,7 +115,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -145,7 +147,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -161,11 +163,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -187,8 +191,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) @@ -246,7 +252,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -262,11 +268,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -321,7 +329,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -347,7 +355,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -370,15 +378,17 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $l - ;; CHECK-NEXT: (br_if $l - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.div_s - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $l + ;; CHECK-NEXT: (br_if $l + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.div_s + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -393,7 +403,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $__asyncify_unwind @@ -410,8 +420,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) @@ -487,7 +499,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -503,12 +515,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $__asyncify_unwind @@ -542,7 +556,9 @@ ;; CHECK-NEXT: ) (func $calls-import2-if (param $x i32) (if (local.get $x) - (call $import) + (then + (call $import) + ) ) ) ;; CHECK: (func $calls-import2-if-else (param $0 i32) @@ -560,7 +576,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -576,7 +592,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (global.get $__asyncify_state) @@ -594,7 +612,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -623,7 +641,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import3 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -648,26 +666,28 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (br_if $__asyncify_unwind + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (br_if $__asyncify_unwind ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -710,8 +730,12 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else (param $x i32) (if (local.get $x) - (call $import3 (i32.const 1)) - (call $import3 (i32.const 2)) + (then + (call $import3 (i32.const 1)) + ) + (else + (call $import3 (i32.const 2)) + ) ) ) ;; CHECK: (func $calls-import2-if-else-oneside (param $0 i32) (result i32) @@ -724,7 +748,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -761,8 +785,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -785,7 +811,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import3 ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) @@ -804,8 +830,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) @@ -830,8 +858,12 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else-oneside (param $x i32) (result i32) (if (local.get $x) - (return (i32.const 1)) - (call $import3 (i32.const 2)) + (then + (return (i32.const 1)) + ) + (else + (call $import3 (i32.const 2)) + ) ) (return (i32.const 3)) ) @@ -850,7 +882,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -866,7 +898,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (global.get $__asyncify_state) @@ -888,7 +922,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -904,12 +938,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import3 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -939,16 +975,20 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) @@ -988,8 +1028,12 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else-oneside2 (param $x i32) (result i32) (if (local.get $x) - (call $import3 (i32.const 1)) - (return (i32.const 2)) + (then + (call $import3 (i32.const 1)) + ) + (else + (return (i32.const 2)) + ) ) (return (i32.const 3)) ) @@ -1000,7 +1044,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -1026,7 +1070,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -1055,7 +1099,7 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import3 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -1074,11 +1118,13 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $l - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $l + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1138,7 +1184,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -1164,7 +1210,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -1193,7 +1239,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -1271,7 +1317,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -1294,7 +1340,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -1305,7 +1353,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $__asyncify_unwind @@ -1322,7 +1370,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -1334,7 +1384,7 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $__asyncify_unwind @@ -1385,7 +1435,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -1408,7 +1458,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring-deep) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring-deep) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -1419,7 +1471,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import-deep) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $__asyncify_unwind @@ -1436,7 +1488,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -1448,7 +1502,7 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $__asyncify_unwind @@ -1507,7 +1561,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.sub @@ -1523,11 +1577,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $__asyncify_unwind @@ -1580,7 +1636,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1597,7 +1655,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1617,7 +1677,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1634,7 +1696,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast index 3c67158d3..6a0026459 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo.wast @@ -37,7 +37,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (block $__asyncify_unwind @@ -48,7 +50,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -72,7 +74,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $nothing) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $nothing) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return) @@ -130,7 +134,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -147,7 +153,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -167,7 +175,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -184,7 +194,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.wast b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.wast index adaea8343..217feb358 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-addlist@foo_pass-arg=asyncify-ignore-indirect.wast @@ -43,7 +43,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -54,7 +56,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -79,7 +81,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $nothing) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $nothing) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -92,7 +96,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call_indirect (type $t) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -101,8 +105,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -169,7 +175,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -186,7 +194,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -206,7 +216,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -223,7 +235,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.wast b/test/lit/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.wast index b7edc038c..e86fe988e 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-asserts_pass-arg=asyncify-onlylist@waka.wast @@ -55,7 +55,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -78,7 +80,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -105,7 +109,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) @@ -132,7 +138,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -159,7 +167,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -176,7 +186,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -196,7 +208,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -213,7 +227,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.wast b/test/lit/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.wast index dcc864713..d89ff3a1a 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-blacklist@foo,bar.wast @@ -50,7 +50,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -61,7 +63,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -91,15 +93,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -145,7 +149,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -156,7 +162,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -186,15 +192,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $baz) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -244,7 +252,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -261,7 +271,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -281,7 +293,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -298,7 +312,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-imports.wast b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-imports.wast index 05fccc63f..dc99a09d0 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-imports.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-imports.wast @@ -55,18 +55,26 @@ ;; CHECK: (func $calls-import2-if-else (param $x i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $calls-import2-if-else (param $x i32) (if (local.get $x) - (call $import3 (i32.const 1)) - (call $import3 (i32.const 2)) + (then + (call $import3 (i32.const 1)) + ) + (else + (call $import3 (i32.const 2)) + ) ) ) ;; CHECK: (func $calls-indirect (param $x i32) @@ -80,7 +88,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -111,7 +119,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -136,8 +144,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -151,7 +161,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call_indirect (type $f) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -160,8 +170,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -233,7 +245,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -250,7 +264,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -270,7 +286,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -287,7 +305,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast index 0811e2a9e..519c6ea2f 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-ignore-indirect.wast @@ -46,7 +46,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -57,7 +59,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -87,15 +89,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -139,7 +143,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -170,7 +174,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -201,7 +205,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -210,11 +214,15 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -224,8 +232,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -287,7 +297,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -318,7 +328,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -343,8 +353,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block @@ -353,8 +365,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -365,30 +379,34 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -402,30 +420,34 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -476,8 +498,12 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else (param $x i32) (if (local.get $x) - (call $import3 (i32.const 1)) - (call $import3 (i32.const 2)) + (then + (call $import3 (i32.const 1)) + ) + (else + (call $import3 (i32.const 2)) + ) ) ) ;; CHECK: (func $calls-indirect (param $x i32) @@ -508,7 +534,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -525,7 +553,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -545,7 +575,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -562,7 +594,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.wast b/test/lit/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.wast index fd214582e..ba781e12a 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-imports@env.import,env.import2.wast @@ -40,7 +40,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $sleeping) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $sleeping ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -48,7 +48,7 @@ ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (global.set $sleeping ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -59,14 +59,18 @@ (func $do_sleep (if (i32.eqz (global.get $sleeping)) - (block - (global.set $sleeping (i32.const 1)) - ;; we should set up the data at address 4 around here - (call $asyncify_start_unwind (i32.const 4)) + (then + (block + (global.set $sleeping (i32.const 1)) + ;; we should set up the data at address 4 around here + (call $asyncify_start_unwind (i32.const 4)) + ) ) - (block - (global.set $sleeping (i32.const 0)) - (call $asyncify_stop_rewind) + (else + (block + (global.set $sleeping (i32.const 0)) + (call $asyncify_stop_rewind) + ) ) ) ) @@ -79,7 +83,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -90,7 +96,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -115,7 +121,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $stuff) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $stuff) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -128,15 +136,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $do_sleep) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -146,7 +156,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $stuff) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $stuff) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -191,7 +203,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -202,7 +216,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -232,15 +246,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $work) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -314,7 +330,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -331,7 +349,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -351,7 +371,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -368,7 +390,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -415,7 +439,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -426,7 +452,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -456,15 +482,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -512,7 +540,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -543,7 +571,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -575,7 +603,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -584,11 +612,15 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -598,7 +630,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $temp ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -676,7 +708,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -707,7 +739,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -738,7 +770,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -747,11 +779,15 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -761,8 +797,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -841,7 +879,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -872,7 +910,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -898,36 +936,38 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $l - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $l + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.div_s - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.div_s + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $y + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $l + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $y - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $l - ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -942,15 +982,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -960,7 +1002,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) @@ -1040,7 +1082,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -1051,7 +1095,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1076,8 +1120,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -1088,28 +1134,32 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (global.get $__asyncify_state) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1140,34 +1190,48 @@ ;; CHECK-NEXT: ) (func $calls-import2-if (param $x i32) (if (local.get $x) - (call $import) + (then + (call $import) + ) ) ) ;; CHECK: (func $calls-import2-if-else (param $x i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $calls-import2-if-else (param $x i32) (if (local.get $x) - (call $import3 (i32.const 1)) - (call $import3 (i32.const 2)) + (then + (call $import3 (i32.const 1)) + ) + (else + (call $import3 (i32.const 2)) + ) ) ) ;; CHECK: (func $calls-import2-if-else-oneside (param $x i32) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return @@ -1176,19 +1240,27 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else-oneside (param $x i32) (result i32) (if (local.get $x) - (return (i32.const 1)) - (call $import3 (i32.const 2)) + (then + (return (i32.const 1)) + ) + (else + (call $import3 (i32.const 2)) + ) ) (return (i32.const 3)) ) ;; CHECK: (func $calls-import2-if-else-oneside2 (param $x i32) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (call $import3 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return @@ -1197,8 +1269,12 @@ ;; CHECK-NEXT: ) (func $calls-import2-if-else-oneside2 (param $x i32) (result i32) (if (local.get $x) - (call $import3 (i32.const 1)) - (return (i32.const 2)) + (then + (call $import3 (i32.const 1)) + ) + (else + (return (i32.const 2)) + ) ) (return (i32.const 3)) ) @@ -1241,7 +1317,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1272,7 +1348,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1303,7 +1379,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (call $import2) ;; CHECK-NEXT: ) @@ -1312,11 +1388,15 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1326,8 +1406,10 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $l - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $l + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1389,7 +1471,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -1400,7 +1484,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1425,7 +1509,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -1438,15 +1524,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1456,7 +1544,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -1469,15 +1559,17 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1525,7 +1617,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -1536,7 +1630,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1561,7 +1655,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring-deep) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring-deep) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -1574,15 +1670,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import-deep) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1592,7 +1690,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $boring) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or @@ -1605,15 +1705,17 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1663,7 +1765,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -1674,7 +1778,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -1704,15 +1808,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1762,7 +1868,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1779,7 +1887,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1799,7 +1909,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1816,7 +1928,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.wast b/test/lit/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.wast index ba5c59cd1..d5dd3775a 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-onlylist@foo,bar.wast @@ -38,7 +38,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -49,7 +51,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -79,15 +81,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -127,7 +131,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -138,7 +144,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -168,15 +174,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -244,7 +252,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -261,7 +271,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -281,7 +293,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -298,7 +312,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-side-module.wast b/test/lit/passes/asyncify_pass-arg=asyncify-side-module.wast index 5afc9a83b..9dee0f8c0 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-side-module.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-side-module.wast @@ -43,7 +43,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -60,7 +62,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -80,7 +84,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -97,7 +103,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=asyncify-verbose.wast b/test/lit/passes/asyncify_pass-arg=asyncify-verbose.wast index 8e932d494..035c46059 100644 --- a/test/lit/passes/asyncify_pass-arg=asyncify-verbose.wast +++ b/test/lit/passes/asyncify_pass-arg=asyncify-verbose.wast @@ -37,7 +37,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -48,7 +50,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -78,15 +80,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -126,7 +130,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -137,7 +143,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -167,15 +173,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $calls-import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -215,7 +223,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (block $__asyncify_unwind (result i32) @@ -226,7 +236,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -256,15 +266,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $calls-calls-import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -320,7 +332,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -337,7 +351,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -357,7 +373,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -374,7 +392,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/asyncify_pass-arg=in-secondary-memory.wast b/test/lit/passes/asyncify_pass-arg=in-secondary-memory.wast index e1f8178a0..7772d68f5 100644 --- a/test/lit/passes/asyncify_pass-arg=in-secondary-memory.wast +++ b/test/lit/passes/asyncify_pass-arg=in-secondary-memory.wast @@ -58,7 +58,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store $asyncify_memory ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -94,7 +94,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store $asyncify_memory ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: (i32.add @@ -119,7 +119,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $dead0) ;; CHECK-NEXT: ) @@ -148,15 +148,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__asyncify_unwind - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__asyncify_unwind + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -166,7 +168,7 @@ ;; CHECK-NEXT: (global.get $__asyncify_state) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (local.get $live0) ;; CHECK-NEXT: ) @@ -266,7 +268,7 @@ ;; SIZE-NEXT: (global.get $__asyncify_state) ;; SIZE-NEXT: (i32.const 2) ;; SIZE-NEXT: ) - ;; SIZE-NEXT: (block + ;; SIZE-NEXT: (then ;; SIZE-NEXT: (i32.store $asyncify_memory ;; SIZE-NEXT: (global.get $__asyncify_data) ;; SIZE-NEXT: (i32.add @@ -302,7 +304,7 @@ ;; SIZE-NEXT: (global.get $__asyncify_state) ;; SIZE-NEXT: (i32.const 2) ;; SIZE-NEXT: ) - ;; SIZE-NEXT: (block + ;; SIZE-NEXT: (then ;; SIZE-NEXT: (i32.store $asyncify_memory ;; SIZE-NEXT: (global.get $__asyncify_data) ;; SIZE-NEXT: (i32.add @@ -327,7 +329,7 @@ ;; SIZE-NEXT: (global.get $__asyncify_state) ;; SIZE-NEXT: (i32.const 0) ;; SIZE-NEXT: ) - ;; SIZE-NEXT: (block + ;; SIZE-NEXT: (then ;; SIZE-NEXT: (local.set $4 ;; SIZE-NEXT: (local.get $dead0) ;; SIZE-NEXT: ) @@ -356,15 +358,17 @@ ;; SIZE-NEXT: (i32.const 0) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) - ;; SIZE-NEXT: (block + ;; SIZE-NEXT: (then ;; SIZE-NEXT: (call $import) ;; SIZE-NEXT: (if ;; SIZE-NEXT: (i32.eq ;; SIZE-NEXT: (global.get $__asyncify_state) ;; SIZE-NEXT: (i32.const 1) ;; SIZE-NEXT: ) - ;; SIZE-NEXT: (br $__asyncify_unwind - ;; SIZE-NEXT: (i32.const 0) + ;; SIZE-NEXT: (then + ;; SIZE-NEXT: (br $__asyncify_unwind + ;; SIZE-NEXT: (i32.const 0) + ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) @@ -374,7 +378,7 @@ ;; SIZE-NEXT: (global.get $__asyncify_state) ;; SIZE-NEXT: (i32.const 0) ;; SIZE-NEXT: ) - ;; SIZE-NEXT: (block + ;; SIZE-NEXT: (then ;; SIZE-NEXT: (local.set $6 ;; SIZE-NEXT: (local.get $live0) ;; SIZE-NEXT: ) @@ -466,7 +470,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -483,7 +489,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -503,7 +511,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -520,7 +530,9 @@ ;; CHECK-NEXT: (global.get $__asyncify_data) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (unreachable) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -544,7 +556,9 @@ ;; SIZE-NEXT: (global.get $__asyncify_data) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) -;; SIZE-NEXT: (unreachable) +;; SIZE-NEXT: (then +;; SIZE-NEXT: (unreachable) +;; SIZE-NEXT: ) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) @@ -561,7 +575,9 @@ ;; SIZE-NEXT: (global.get $__asyncify_data) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) -;; SIZE-NEXT: (unreachable) +;; SIZE-NEXT: (then +;; SIZE-NEXT: (unreachable) +;; SIZE-NEXT: ) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) @@ -581,7 +597,9 @@ ;; SIZE-NEXT: (global.get $__asyncify_data) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) -;; SIZE-NEXT: (unreachable) +;; SIZE-NEXT: (then +;; SIZE-NEXT: (unreachable) +;; SIZE-NEXT: ) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) @@ -598,7 +616,9 @@ ;; SIZE-NEXT: (global.get $__asyncify_data) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) -;; SIZE-NEXT: (unreachable) +;; SIZE-NEXT: (then +;; SIZE-NEXT: (unreachable) +;; SIZE-NEXT: ) ;; SIZE-NEXT: ) ;; SIZE-NEXT: ) diff --git a/test/lit/passes/catch-pop-fixup-eh.wast b/test/lit/passes/catch-pop-fixup-eh.wast index 685a07685..5aba0f73d 100644 --- a/test/lit/passes/catch-pop-fixup-eh.wast +++ b/test/lit/passes/catch-pop-fixup-eh.wast @@ -250,8 +250,12 @@ ;; CHECK-NEXT: (catch $e-i32 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (pop i32) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -287,8 +291,12 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $l0) diff --git a/test/lit/passes/cfp.wast b/test/lit/passes/cfp.wast index b61f2c6a6..7fb2a7f13 100644 --- a/test/lit/passes/cfp.wast +++ b/test/lit/passes/cfp.wast @@ -417,8 +417,12 @@ ;; CHECK-NEXT: (local.get $struct) ;; CHECK-NEXT: (if (result f32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (f32.const 42) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (f32.const 42) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -428,8 +432,12 @@ ;; Fall though a 42 via an if. (if (result f32) (local.get $x) - (unreachable) - (f32.const 42) + (then + (unreachable) + ) + (else + (f32.const 42) + ) ) ) ) diff --git a/test/lit/passes/coalesce-locals-gc.wast b/test/lit/passes/coalesce-locals-gc.wast index 8af0d2187..f5ec6bc39 100644 --- a/test/lit/passes/coalesce-locals-gc.wast +++ b/test/lit/passes/coalesce-locals-gc.wast @@ -293,16 +293,20 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (tuple.make 2 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (tuple.make 2 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (tuple.make 2 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (tuple.make 2 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -311,25 +315,29 @@ ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (if (type $1) (result (ref any) i32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (tuple.make 2 - ;; CHECK-NEXT: (ref.as_non_null - ;; CHECK-NEXT: (tuple.extract 2 0 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (tuple.make 2 + ;; CHECK-NEXT: (ref.as_non_null + ;; CHECK-NEXT: (tuple.extract 2 0 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (tuple.extract 2 1 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (tuple.extract 2 1 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (tuple.make 2 - ;; CHECK-NEXT: (ref.as_non_null - ;; CHECK-NEXT: (tuple.extract 2 0 + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (tuple.make 2 + ;; CHECK-NEXT: (ref.as_non_null + ;; CHECK-NEXT: (tuple.extract 2 0 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (tuple.extract 2 1 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (tuple.extract 2 1 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -369,16 +377,20 @@ (if (i32.const 0) ;; These two sets will remain. - (local.set $x - (tuple.make 2 - (local.get $any) - (i32.const 1) + (then + (local.set $x + (tuple.make 2 + (local.get $any) + (i32.const 1) + ) ) ) - (local.set $x - (tuple.make 2 - (local.get $any) - (i32.const 2) + (else + (local.set $x + (tuple.make 2 + (local.get $any) + (i32.const 2) + ) ) ) ) @@ -388,8 +400,12 @@ (if (result (ref any) i32) (i32.const 0) ;; These gets will be invalid, so the local will have to be made nullable. - (local.get $x) - (local.get $x) + (then + (local.get $x) + ) + (else + (local.get $x) + ) ) ) ) diff --git a/test/lit/passes/coalesce-locals-learning.wast b/test/lit/passes/coalesce-locals-learning.wast index b8871ddf5..aa20e87c5 100644 --- a/test/lit/passes/coalesce-locals-learning.wast +++ b/test/lit/passes/coalesce-locals-learning.wast @@ -342,11 +342,15 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -355,11 +359,15 @@ (local $y i32) (if (i32.const 0) - (drop - (local.get $x) + (then + (drop + (local.get $x) + ) ) - (drop - (local.get $y) + (else + (drop + (local.get $y) + ) ) ) ) @@ -367,20 +375,24 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block3 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block3 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -390,20 +402,24 @@ (local $y i32) (if (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) + (then + (block $block1 + (local.set $x + (i32.const 0) + ) + (drop + (local.get $x) + ) ) ) - (block $block3 - (local.set $y - (i32.const 1) - ) - (drop - (local.get $y) + (else + (block $block3 + (local.set $y + (i32.const 1) + ) + (drop + (local.get $y) + ) ) ) ) @@ -413,11 +429,15 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -432,11 +452,15 @@ (local $y i32) (if (i32.const 0) - (local.set $x - (i32.const 0) + (then + (local.set $x + (i32.const 0) + ) ) - (local.set $y - (i32.const 1) + (else + (local.set $y + (i32.const 1) + ) ) ) (drop @@ -457,11 +481,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -482,11 +510,15 @@ ) (if (i32.const 0) - (drop - (i32.const 1) + (then + (drop + (i32.const 1) + ) ) - (drop - (i32.const 2) + (else + (drop + (i32.const 2) + ) ) ) (drop @@ -507,8 +539,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -529,8 +563,10 @@ ) (if (i32.const 0) - (drop - (i32.const 1) + (then + (drop + (i32.const 1) + ) ) ) (drop @@ -548,8 +584,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -567,8 +605,10 @@ ) (if (i32.const 0) - (local.set $y - (i32.const 1) + (then + (local.set $y + (i32.const 1) + ) ) ) (drop @@ -586,12 +626,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -604,12 +646,14 @@ ) (if (i32.const 0) - (block $block1 - (drop - (local.get $x) - ) - (drop - (local.get $y) + (then + (block $block1 + (drop + (local.get $x) + ) + (drop + (local.get $y) + ) ) ) ) @@ -621,12 +665,14 @@ ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -638,12 +684,14 @@ (local.tee $x (i32.const 1) ) - (block $block1 - (drop - (local.get $x) - ) - (drop - (local.get $y) + (then + (block $block1 + (drop + (local.get $x) + ) + (drop + (local.get $y) + ) ) ) ) @@ -653,12 +701,14 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -671,12 +721,14 @@ (local $y i32) (if (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) + (then + (block $block1 + (local.set $x + (i32.const 0) + ) + (drop + (local.get $x) + ) ) ) ) @@ -688,15 +740,17 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -709,15 +763,17 @@ (local $y i32) (if (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - (local.set $y - (i32.const 1) + (then + (block $block1 + (local.set $x + (i32.const 0) + ) + (drop + (local.get $x) + ) + (local.set $y + (i32.const 1) + ) ) ) ) @@ -729,12 +785,14 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -747,12 +805,14 @@ (local $y i32) (if (i32.const 0) - (block $block1 - (drop - (local.get $x) - ) - (local.set $y - (i32.const 1) + (then + (block $block1 + (drop + (local.get $x) + ) + (local.set $y + (i32.const 1) + ) ) ) ) @@ -983,102 +1043,122 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (block $block3 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 101) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block3 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 100) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 101) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block5 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 103) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block5 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 102) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 103) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block8 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 104) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 105) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block10 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 106) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 107) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (block $block8 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 104) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 105) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block13 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 108) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 109) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block10 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 106) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 107) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block15 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 110) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 111) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: (block $block13 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 108) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 109) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block15 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 110) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 111) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $greedy-can-be-happy (type $2) @@ -1090,102 +1170,122 @@ (local $y3 i32) (if (i32.const 0) - (if - (i32.const 1) + (then (if - (i32.const 2) - (block $block3 - (local.set $x1 - (i32.const 100) - ) - (local.set $y2 - (i32.const 101) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y2) + (i32.const 1) + (then + (if + (i32.const 2) + (then + (block $block3 + (local.set $x1 + (i32.const 100) + ) + (local.set $y2 + (i32.const 101) + ) + (drop + (local.get $x1) + ) + (drop + (local.get $y2) + ) + ) + ) + (else + (block $block5 + (local.set $x1 + (i32.const 102) + ) + (local.set $y3 + (i32.const 103) + ) + (drop + (local.get $x1) + ) + (drop + (local.get $y3) + ) + ) + ) ) ) - (block $block5 - (local.set $x1 - (i32.const 102) - ) - (local.set $y3 - (i32.const 103) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y3) + (else + (if + (i32.const 3) + (then + (block $block8 + (local.set $x2 + (i32.const 104) + ) + (local.set $y1 + (i32.const 105) + ) + (drop + (local.get $x2) + ) + (drop + (local.get $y1) + ) + ) + ) + (else + (block $block10 + (local.set $x2 + (i32.const 106) + ) + (local.set $y3 + (i32.const 107) + ) + (drop + (local.get $x2) + ) + (drop + (local.get $y3) + ) + ) + ) ) ) ) + ) + (else (if - (i32.const 3) - (block $block8 - (local.set $x2 - (i32.const 104) - ) - (local.set $y1 - (i32.const 105) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y1) + (i32.const 4) + (then + (block $block13 + (local.set $x3 + (i32.const 108) + ) + (local.set $y1 + (i32.const 109) + ) + (drop + (local.get $x3) + ) + (drop + (local.get $y1) + ) ) ) - (block $block10 - (local.set $x2 - (i32.const 106) - ) - (local.set $y3 - (i32.const 107) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y3) + (else + (block $block15 + (local.set $x3 + (i32.const 110) + ) + (local.set $y2 + (i32.const 111) + ) + (drop + (local.get $x3) + ) + (drop + (local.get $y2) + ) ) ) ) ) - (if - (i32.const 4) - (block $block13 - (local.set $x3 - (i32.const 108) - ) - (local.set $y1 - (i32.const 109) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y1) - ) - ) - (block $block15 - (local.set $x3 - (i32.const 110) - ) - (local.set $y2 - (i32.const 111) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y2) - ) - ) - ) ) ) ;; CHECK: (func $greedy-can-be-sad @@ -1193,102 +1293,122 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (block $block3 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 101) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block3 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 100) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 101) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block5 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 103) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block5 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 102) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 103) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block8 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 104) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 105) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block10 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 106) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 107) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (block $block8 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 104) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 105) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block13 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 108) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 109) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block10 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 106) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 107) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block15 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 110) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 111) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: (block $block13 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 108) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 109) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block15 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 110) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 111) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $greedy-can-be-sad (type $2) @@ -1300,102 +1420,122 @@ (local $y3 i32) (if (i32.const 0) - (if - (i32.const 1) + (then (if - (i32.const 2) - (block $block3 - (local.set $x1 - (i32.const 100) - ) - (local.set $y2 - (i32.const 101) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y2) + (i32.const 1) + (then + (if + (i32.const 2) + (then + (block $block3 + (local.set $x1 + (i32.const 100) + ) + (local.set $y2 + (i32.const 101) + ) + (drop + (local.get $x1) + ) + (drop + (local.get $y2) + ) + ) + ) + (else + (block $block5 + (local.set $x1 + (i32.const 102) + ) + (local.set $y3 + (i32.const 103) + ) + (drop + (local.get $x1) + ) + (drop + (local.get $y3) + ) + ) + ) ) ) - (block $block5 - (local.set $x1 - (i32.const 102) - ) - (local.set $y3 - (i32.const 103) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y3) + (else + (if + (i32.const 3) + (then + (block $block8 + (local.set $x2 + (i32.const 104) + ) + (local.set $y1 + (i32.const 105) + ) + (drop + (local.get $x2) + ) + (drop + (local.get $y1) + ) + ) + ) + (else + (block $block10 + (local.set $x2 + (i32.const 106) + ) + (local.set $y3 + (i32.const 107) + ) + (drop + (local.get $x2) + ) + (drop + (local.get $y3) + ) + ) + ) ) ) ) + ) + (else (if - (i32.const 3) - (block $block8 - (local.set $x2 - (i32.const 104) - ) - (local.set $y1 - (i32.const 105) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y1) + (i32.const 4) + (then + (block $block13 + (local.set $x3 + (i32.const 108) + ) + (local.set $y1 + (i32.const 109) + ) + (drop + (local.get $x3) + ) + (drop + (local.get $y1) + ) ) ) - (block $block10 - (local.set $x2 - (i32.const 106) - ) - (local.set $y3 - (i32.const 107) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y3) + (else + (block $block15 + (local.set $x3 + (i32.const 110) + ) + (local.set $y2 + (i32.const 111) + ) + (drop + (local.get $x3) + ) + (drop + (local.get $y2) + ) ) ) ) ) - (if - (i32.const 4) - (block $block13 - (local.set $x3 - (i32.const 108) - ) - (local.set $y1 - (i32.const 109) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y1) - ) - ) - (block $block15 - (local.set $x3 - (i32.const 110) - ) - (local.set $y2 - (i32.const 111) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y2) - ) - ) - ) ) ) ;; CHECK: (func $_memcpy (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -1405,8 +1545,10 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 4096) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $3 @@ -1423,93 +1565,101 @@ ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block2 - ;; CHECK-NEXT: (block $while-out$0 - ;; CHECK-NEXT: (loop $while-in$1 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out$0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block4 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block2 + ;; CHECK-NEXT: (block $while-out$0 + ;; CHECK-NEXT: (loop $while-in$1 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $while-out$0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (block $block4 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.store8 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in$1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in$1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $while-out$2 - ;; CHECK-NEXT: (loop $while-in$3 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.ge_s - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (block $while-out$2 + ;; CHECK-NEXT: (loop $while-in$3 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.ge_s + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out$2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block7 - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $while-out$2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (block $block7 + ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in$3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in$3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1523,7 +1673,9 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out$4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $while-out$4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block $block9 ;; CHECK-NEXT: (i32.store8 @@ -1565,8 +1717,10 @@ (local.get $i3) (i32.const 4096) ) - (drop - (local.get $i1) + (then + (drop + (local.get $i1) + ) ) ) (local.set $i4 @@ -1583,93 +1737,101 @@ (i32.const 3) ) ) - (block $block2 - (block $while-out$0 - (loop $while-in$1 - (if - (i32.eqz - (i32.and - (local.get $i1) - (i32.const 3) - ) - ) - (br $while-out$0) - ) - (block $block4 + (then + (block $block2 + (block $while-out$0 + (loop $while-in$1 (if (i32.eqz - (local.get $i3) + (i32.and + (local.get $i1) + (i32.const 3) + ) ) - (return - (local.get $i4) + (then + (br $while-out$0) ) ) - (i32.store8 - (local.get $i1) - (i32.load8_s - (local.get $i2) + (block $block4 + (if + (i32.eqz + (local.get $i3) + ) + (then + (return + (local.get $i4) + ) + ) ) - ) - (local.set $i1 - (i32.add + (i32.store8 (local.get $i1) - (i32.const 1) + (i32.load8_s + (local.get $i2) + ) ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 1) + (local.set $i1 + (i32.add + (local.get $i1) + (i32.const 1) + ) ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 1) + (local.set $i2 + (i32.add + (local.get $i2) + (i32.const 1) + ) + ) + (local.set $i3 + (i32.sub + (local.get $i3) + (i32.const 1) + ) ) ) + (br $while-in$1) ) - (br $while-in$1) ) - ) - (block $while-out$2 - (loop $while-in$3 - (if - (i32.eqz - (i32.ge_s - (local.get $i3) - (i32.const 4) + (block $while-out$2 + (loop $while-in$3 + (if + (i32.eqz + (i32.ge_s + (local.get $i3) + (i32.const 4) + ) ) - ) - (br $while-out$2) - ) - (block $block7 - (i32.store - (local.get $i1) - (i32.load - (local.get $i2) + (then + (br $while-out$2) ) ) - (local.set $i1 - (i32.add + (block $block7 + (i32.store (local.get $i1) - (i32.const 4) + (i32.load + (local.get $i2) + ) ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 4) + (local.set $i1 + (i32.add + (local.get $i1) + (i32.const 4) + ) ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 4) + (local.set $i2 + (i32.add + (local.get $i2) + (i32.const 4) + ) + ) + (local.set $i3 + (i32.sub + (local.get $i3) + (i32.const 4) + ) ) ) + (br $while-in$3) ) - (br $while-in$3) ) ) ) @@ -1683,7 +1845,9 @@ (i32.const 0) ) ) - (br $while-out$4) + (then + (br $while-out$4) + ) ) (block $block9 (i32.store8 @@ -1721,16 +1885,22 @@ ;; CHECK: (func $this-is-effective-i-tell-you (param $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $0) @@ -1739,16 +1909,22 @@ (func $this-is-effective-i-tell-you (type $4) (param $x i32) (if (i32.const -1) - (block $block1 - (if - (i32.const 0) - (nop) - ) - (local.set $x - (i32.const 1) + (then + (block $block1 + (if + (i32.const 0) + (then + (nop) + ) + ) + (local.set $x + (i32.const 1) + ) ) ) - (nop) + (else + (nop) + ) ) (drop (local.get $x) diff --git a/test/lit/passes/coalesce-locals.wast b/test/lit/passes/coalesce-locals.wast index aa76ca823..9666c02fa 100644 --- a/test/lit/passes/coalesce-locals.wast +++ b/test/lit/passes/coalesce-locals.wast @@ -359,11 +359,15 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -372,11 +376,15 @@ (local $y i32) (if (i32.const 0) - (drop - (local.get $x) + (then + (drop + (local.get $x) + ) ) - (drop - (local.get $y) + (else + (drop + (local.get $y) + ) ) ) ) @@ -384,20 +392,24 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block3 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block3 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -407,20 +419,24 @@ (local $y i32) (if (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) + (then + (block $block1 + (local.set $x + (i32.const 0) + ) + (drop + (local.get $x) + ) ) ) - (block $block3 - (local.set $y - (i32.const 1) - ) - (drop - (local.get $y) + (else + (block $block3 + (local.set $y + (i32.const 1) + ) + (drop + (local.get $y) + ) ) ) ) @@ -430,11 +446,15 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -449,11 +469,15 @@ (local $y i32) (if (i32.const 0) - (local.set $x - (i32.const 0) + (then + (local.set $x + (i32.const 0) + ) ) - (local.set $y - (i32.const 1) + (else + (local.set $y + (i32.const 1) + ) ) ) (drop @@ -474,11 +498,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -499,11 +527,15 @@ ) (if (i32.const 0) - (drop - (i32.const 1) + (then + (drop + (i32.const 1) + ) ) - (drop - (i32.const 2) + (else + (drop + (i32.const 2) + ) ) ) (drop @@ -524,8 +556,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -546,8 +580,10 @@ ) (if (i32.const 0) - (drop - (i32.const 1) + (then + (drop + (i32.const 1) + ) ) ) (drop @@ -565,8 +601,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -584,8 +622,10 @@ ) (if (i32.const 0) - (local.set $y - (i32.const 1) + (then + (local.set $y + (i32.const 1) + ) ) ) (drop @@ -603,12 +643,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -621,12 +663,14 @@ ) (if (i32.const 0) - (block $block1 - (drop - (local.get $x) - ) - (drop - (local.get $y) + (then + (block $block1 + (drop + (local.get $x) + ) + (drop + (local.get $y) + ) ) ) ) @@ -638,12 +682,14 @@ ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -655,12 +701,14 @@ (local.tee $x (i32.const 1) ) - (block $block1 - (drop - (local.get $x) - ) - (drop - (local.get $y) + (then + (block $block1 + (drop + (local.get $x) + ) + (drop + (local.get $y) + ) ) ) ) @@ -670,12 +718,14 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -688,12 +738,14 @@ (local $y i32) (if (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) + (then + (block $block1 + (local.set $x + (i32.const 0) + ) + (drop + (local.get $x) + ) ) ) ) @@ -705,15 +757,17 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -726,15 +780,17 @@ (local $y i32) (if (i32.const 0) - (block $block1 - (local.set $x - (i32.const 0) - ) - (drop - (local.get $x) - ) - (local.set $y - (i32.const 1) + (then + (block $block1 + (local.set $x + (i32.const 0) + ) + (drop + (local.get $x) + ) + (local.set $y + (i32.const 1) + ) ) ) ) @@ -746,12 +802,14 @@ ;; CHECK-NEXT: (local $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -764,15 +822,17 @@ (local $y i32) (if (i32.const 0) - (block $block1 - ;; These locals can be coalesced together: $x's live range ends here, - ;; and $y's begins right after it, so they do not have an overlap with - ;; a different value. - (drop - (local.get $x) - ) - (local.set $y - (i32.const 1) + (then + (block $block1 + ;; These locals can be coalesced together: $x's live range ends here, + ;; and $y's begins right after it, so they do not have an overlap with + ;; a different value. + (drop + (local.get $x) + ) + (local.set $y + (i32.const 1) + ) ) ) ) @@ -785,12 +845,14 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -803,13 +865,15 @@ (local $y i32) (if (i32.const 0) - (block $block1 - ;; As above, but flipping these two instructions causes a conflict. - (local.set $y - (i32.const 1) - ) - (drop - (local.get $x) + (then + (block $block1 + ;; As above, but flipping these two instructions causes a conflict. + (local.set $y + (i32.const 1) + ) + (drop + (local.get $x) + ) ) ) ) @@ -1036,102 +1100,122 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (block $block3 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 101) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block3 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 100) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 101) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block5 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 103) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block5 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 102) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 103) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block8 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 104) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 105) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block10 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 106) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 107) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (block $block8 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 104) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 105) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block13 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 108) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 109) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block10 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 106) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 107) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block15 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 110) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 111) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: (block $block13 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 108) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 109) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block15 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 110) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 111) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $greedy-can-be-happy (type $2) @@ -1143,102 +1227,122 @@ (local $y3 i32) (if (i32.const 0) - (if - (i32.const 1) + (then (if - (i32.const 2) - (block $block3 - (local.set $x1 - (i32.const 100) - ) - (local.set $y2 - (i32.const 101) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y2) + (i32.const 1) + (then + (if + (i32.const 2) + (then + (block $block3 + (local.set $x1 + (i32.const 100) + ) + (local.set $y2 + (i32.const 101) + ) + (drop + (local.get $x1) + ) + (drop + (local.get $y2) + ) + ) + ) + (else + (block $block5 + (local.set $x1 + (i32.const 102) + ) + (local.set $y3 + (i32.const 103) + ) + (drop + (local.get $x1) + ) + (drop + (local.get $y3) + ) + ) + ) ) ) - (block $block5 - (local.set $x1 - (i32.const 102) - ) - (local.set $y3 - (i32.const 103) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y3) + (else + (if + (i32.const 3) + (then + (block $block8 + (local.set $x2 + (i32.const 104) + ) + (local.set $y1 + (i32.const 105) + ) + (drop + (local.get $x2) + ) + (drop + (local.get $y1) + ) + ) + ) + (else + (block $block10 + (local.set $x2 + (i32.const 106) + ) + (local.set $y3 + (i32.const 107) + ) + (drop + (local.get $x2) + ) + (drop + (local.get $y3) + ) + ) + ) ) ) ) + ) + (else (if - (i32.const 3) - (block $block8 - (local.set $x2 - (i32.const 104) - ) - (local.set $y1 - (i32.const 105) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y1) + (i32.const 4) + (then + (block $block13 + (local.set $x3 + (i32.const 108) + ) + (local.set $y1 + (i32.const 109) + ) + (drop + (local.get $x3) + ) + (drop + (local.get $y1) + ) ) ) - (block $block10 - (local.set $x2 - (i32.const 106) - ) - (local.set $y3 - (i32.const 107) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y3) + (else + (block $block15 + (local.set $x3 + (i32.const 110) + ) + (local.set $y2 + (i32.const 111) + ) + (drop + (local.get $x3) + ) + (drop + (local.get $y2) + ) ) ) ) ) - (if - (i32.const 4) - (block $block13 - (local.set $x3 - (i32.const 108) - ) - (local.set $y1 - (i32.const 109) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y1) - ) - ) - (block $block15 - (local.set $x3 - (i32.const 110) - ) - (local.set $y2 - (i32.const 111) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y2) - ) - ) - ) ) ) ;; CHECK: (func $greedy-can-be-sad @@ -1247,102 +1351,122 @@ ;; CHECK-NEXT: (local $2 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (block $block3 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 101) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block3 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 100) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 101) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block5 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.const 103) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block5 - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 102) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.const 103) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block8 + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 104) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 105) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block10 + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 106) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.const 107) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (block $block8 - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 104) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 105) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block13 + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.const 108) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 109) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block10 - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 106) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.const 107) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block15 + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.const 110) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 111) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: (block $block13 - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.const 108) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 109) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block15 - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.const 110) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 111) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $greedy-can-be-sad (type $2) @@ -1354,102 +1478,122 @@ (local $y3 i32) (if (i32.const 0) - (if - (i32.const 1) + (then (if - (i32.const 2) - (block $block3 - (local.set $x1 - (i32.const 100) - ) - (local.set $y2 - (i32.const 101) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y2) + (i32.const 1) + (then + (if + (i32.const 2) + (then + (block $block3 + (local.set $x1 + (i32.const 100) + ) + (local.set $y2 + (i32.const 101) + ) + (drop + (local.get $x1) + ) + (drop + (local.get $y2) + ) + ) + ) + (else + (block $block5 + (local.set $x1 + (i32.const 102) + ) + (local.set $y3 + (i32.const 103) + ) + (drop + (local.get $x1) + ) + (drop + (local.get $y3) + ) + ) + ) ) ) - (block $block5 - (local.set $x1 - (i32.const 102) - ) - (local.set $y3 - (i32.const 103) - ) - (drop - (local.get $x1) - ) - (drop - (local.get $y3) + (else + (if + (i32.const 3) + (then + (block $block8 + (local.set $x2 + (i32.const 104) + ) + (local.set $y1 + (i32.const 105) + ) + (drop + (local.get $x2) + ) + (drop + (local.get $y1) + ) + ) + ) + (else + (block $block10 + (local.set $x2 + (i32.const 106) + ) + (local.set $y3 + (i32.const 107) + ) + (drop + (local.get $x2) + ) + (drop + (local.get $y3) + ) + ) + ) ) ) ) + ) + (else (if - (i32.const 3) - (block $block8 - (local.set $x2 - (i32.const 104) - ) - (local.set $y1 - (i32.const 105) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y1) + (i32.const 4) + (then + (block $block13 + (local.set $x3 + (i32.const 108) + ) + (local.set $y1 + (i32.const 109) + ) + (drop + (local.get $x3) + ) + (drop + (local.get $y1) + ) ) ) - (block $block10 - (local.set $x2 - (i32.const 106) - ) - (local.set $y3 - (i32.const 107) - ) - (drop - (local.get $x2) - ) - (drop - (local.get $y3) + (else + (block $block15 + (local.set $x3 + (i32.const 110) + ) + (local.set $y2 + (i32.const 111) + ) + (drop + (local.get $x3) + ) + (drop + (local.get $y2) + ) ) ) ) ) - (if - (i32.const 4) - (block $block13 - (local.set $x3 - (i32.const 108) - ) - (local.set $y1 - (i32.const 109) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y1) - ) - ) - (block $block15 - (local.set $x3 - (i32.const 110) - ) - (local.set $y2 - (i32.const 111) - ) - (drop - (local.get $x3) - ) - (drop - (local.get $y2) - ) - ) - ) ) ) ;; CHECK: (func $_memcpy (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -1459,8 +1603,10 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 4096) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $3 @@ -1477,93 +1623,101 @@ ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block2 - ;; CHECK-NEXT: (block $while-out$0 - ;; CHECK-NEXT: (loop $while-in$1 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out$0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block4 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block2 + ;; CHECK-NEXT: (block $while-out$0 + ;; CHECK-NEXT: (loop $while-in$1 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $while-out$0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (block $block4 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.store8 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in$1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in$1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $while-out$2 - ;; CHECK-NEXT: (loop $while-in$3 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.ge_s - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (block $while-out$2 + ;; CHECK-NEXT: (loop $while-in$3 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.ge_s + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out$2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $block7 - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $while-out$2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (block $block7 + ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in$3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in$3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1577,7 +1731,9 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out$4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $while-out$4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block $block9 ;; CHECK-NEXT: (i32.store8 @@ -1619,8 +1775,10 @@ (local.get $i3) (i32.const 4096) ) - (drop - (local.get $i1) + (then + (drop + (local.get $i1) + ) ) ) (local.set $i4 @@ -1637,93 +1795,101 @@ (i32.const 3) ) ) - (block $block2 - (block $while-out$0 - (loop $while-in$1 - (if - (i32.eqz - (i32.and - (local.get $i1) - (i32.const 3) - ) - ) - (br $while-out$0) - ) - (block $block4 + (then + (block $block2 + (block $while-out$0 + (loop $while-in$1 (if (i32.eqz - (local.get $i3) + (i32.and + (local.get $i1) + (i32.const 3) + ) ) - (return - (local.get $i4) + (then + (br $while-out$0) ) ) - (i32.store8 - (local.get $i1) - (i32.load8_s - (local.get $i2) + (block $block4 + (if + (i32.eqz + (local.get $i3) + ) + (then + (return + (local.get $i4) + ) + ) ) - ) - (local.set $i1 - (i32.add + (i32.store8 (local.get $i1) - (i32.const 1) + (i32.load8_s + (local.get $i2) + ) ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 1) + (local.set $i1 + (i32.add + (local.get $i1) + (i32.const 1) + ) ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 1) + (local.set $i2 + (i32.add + (local.get $i2) + (i32.const 1) + ) + ) + (local.set $i3 + (i32.sub + (local.get $i3) + (i32.const 1) + ) ) ) + (br $while-in$1) ) - (br $while-in$1) ) - ) - (block $while-out$2 - (loop $while-in$3 - (if - (i32.eqz - (i32.ge_s - (local.get $i3) - (i32.const 4) + (block $while-out$2 + (loop $while-in$3 + (if + (i32.eqz + (i32.ge_s + (local.get $i3) + (i32.const 4) + ) ) - ) - (br $while-out$2) - ) - (block $block7 - (i32.store - (local.get $i1) - (i32.load - (local.get $i2) + (then + (br $while-out$2) ) ) - (local.set $i1 - (i32.add + (block $block7 + (i32.store (local.get $i1) - (i32.const 4) + (i32.load + (local.get $i2) + ) ) - ) - (local.set $i2 - (i32.add - (local.get $i2) - (i32.const 4) + (local.set $i1 + (i32.add + (local.get $i1) + (i32.const 4) + ) ) - ) - (local.set $i3 - (i32.sub - (local.get $i3) - (i32.const 4) + (local.set $i2 + (i32.add + (local.get $i2) + (i32.const 4) + ) + ) + (local.set $i3 + (i32.sub + (local.get $i3) + (i32.const 4) + ) ) ) + (br $while-in$3) ) - (br $while-in$3) ) ) ) @@ -1737,7 +1903,9 @@ (i32.const 0) ) ) - (br $while-out$4) + (then + (br $while-out$4) + ) ) (block $block9 (i32.store8 @@ -1775,16 +1943,22 @@ ;; CHECK: (func $this-is-effective-i-tell-you (param $0 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: (block $block1 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block1 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $0) @@ -1793,16 +1967,22 @@ (func $this-is-effective-i-tell-you (type $4) (param $x i32) (if (i32.const -1) - (block $block1 - (if - (i32.const 0) - (nop) - ) - (local.set $x - (i32.const 1) + (then + (block $block1 + (if + (i32.const 0) + (then + (nop) + ) + ) + (local.set $x + (i32.const 1) + ) ) ) - (nop) + (else + (nop) + ) ) (drop (local.get $x) @@ -2004,8 +2184,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $get) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $out @@ -2037,7 +2219,9 @@ ) ) (if (call $get) - (local.set $2 (local.get $1)) ;; copy for 1/2 + (then + (local.set $2 (local.get $1)) ;; copy for 1/2 + ) ) (br_if $out (local.get $2)) (local.set $1 (i32.const 100)) @@ -2053,8 +2237,12 @@ ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -2073,8 +2261,12 @@ (local.set $x (if (result i32) (i32.const 1) - (local.get $x) - (local.get $y) + (then + (local.get $x) + ) + (else + (local.get $y) + ) ) ) (drop (local.get $x)) @@ -2089,8 +2281,12 @@ ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -2109,8 +2305,12 @@ (local.set $x (if (result i32) (i32.const 1) - (local.get $y) - (local.get $x) + (then + (local.get $y) + ) + (else + (local.get $x) + ) ) ) (drop (local.get $x)) @@ -2125,8 +2325,12 @@ ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -2145,8 +2349,12 @@ (local.set $x (if (result i32) (i32.const 1) - (unreachable) - (local.get $x) + (then + (unreachable) + ) + (else + (local.get $x) + ) ) ) (drop (local.get $x)) @@ -2161,8 +2369,12 @@ ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -2181,8 +2393,12 @@ (local.set $x (if (result i32) (i32.const 1) - (unreachable) - (local.get $y) + (then + (unreachable) + ) + (else + (local.get $y) + ) ) ) (drop (local.get $x)) @@ -2198,8 +2414,12 @@ ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2220,8 +2440,12 @@ (local.tee $x (if (result i32) (i32.const 1) - (local.get $x) - (i32.const 2) + (then + (local.get $x) + ) + (else + (i32.const 2) + ) ) ) ) @@ -2253,7 +2477,9 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if ;; CHECK-NEXT: (br $label$0) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2264,7 +2490,9 @@ (local.tee $0 (if (br $label$0) - (nop) + (then + (nop) + ) ) ) ) @@ -2275,8 +2503,12 @@ ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (if (result f64) ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (f64.lt @@ -2290,8 +2522,12 @@ (local.tee $0 (if (result f64) (local.get $1) - (local.get $0) - (unreachable) + (then + (local.get $0) + ) + (else + (unreachable) + ) ) ) (f64.lt @@ -2305,8 +2541,12 @@ ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (if (result f64) ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (f64.lt @@ -2320,8 +2560,12 @@ (local.tee $0 (if (result f64) (local.get $1) - (unreachable) - (local.get $0) + (then + (unreachable) + ) + (else + (local.get $0) + ) ) ) (f64.lt @@ -2335,8 +2579,10 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -2347,7 +2593,9 @@ (local $y i32) (local.set $x (local.get $y)) (if (i32.const 1) - (local.set $x (i32.const 1)) + (then + (local.set $x (i32.const 1)) + ) ) (local.set $x (local.get $y)) (local.set $x (local.get $y)) @@ -2357,8 +2605,10 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -2369,7 +2619,9 @@ (local $y i32) (local.set $y (local.get $x)) (if (i32.const 1) - (local.set $y (i32.const 1)) + (then + (local.set $y (i32.const 1)) + ) ) (local.set $y (local.get $x)) (local.set $y (local.get $x)) @@ -2382,15 +2634,19 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -2402,8 +2658,10 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -2424,11 +2682,15 @@ (local.set $w (local.get $z)) (local.set $x (local.get $z)) (if (i32.const 1) - (local.set $y (i32.const 1)) + (then + (local.set $y (i32.const 1)) + ) ) (local.set $x (local.get $z)) (if (i32.const 1) - (local.set $y (i32.const 1)) + (then + (local.set $y (i32.const 1)) + ) ) (local.set $y (local.get $x)) (local.set $z (local.get $y)) @@ -2436,7 +2698,9 @@ (local.set $z (i32.const 2)) (local.set $x (local.get $z)) (if (i32.const 1) - (local.set $y (i32.const 1)) + (then + (local.set $y (i32.const 1)) + ) ) (local.set $y (local.get $x)) (local.set $z (local.get $y)) @@ -2797,11 +3061,15 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -2840,11 +3108,15 @@ ;; next testcase for more on this.) (if (local.get $0) - (local.set $3 - (local.get $1) + (then + (local.set $3 + (local.get $1) + ) ) - (local.set $3 - (local.get $2) + (else + (local.set $3 + (local.get $2) + ) ) ) (drop @@ -2868,8 +3140,12 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $0) @@ -2901,11 +3177,15 @@ (nop) (if (local.get $0) - (local.set $1 - (local.get $0) + (then + (local.set $1 + (local.get $0) + ) ) - (local.set $1 - (local.get $0) + (else + (local.set $1 + (local.get $0) + ) ) ) (drop diff --git a/test/lit/passes/code-folding_enable-threads.wast b/test/lit/passes/code-folding_enable-threads.wast index 487fbd3ac..b07000278 100644 --- a/test/lit/passes/code-folding_enable-threads.wast +++ b/test/lit/passes/code-folding_enable-threads.wast @@ -19,7 +19,7 @@ ;; CHECK-NEXT: (block $label$1 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $label$3 ;; CHECK-NEXT: (call_indirect (type $13) ;; CHECK-NEXT: (block $label$4 @@ -37,15 +37,17 @@ (block $label$1 (if (i32.const 1) - (block $label$3 - (call_indirect (type $13) - (block $label$4 (result f32) ;; but this type may change dangerously - (nop) ;; fold this - (br $label$3) + (then + (block $label$3 + (call_indirect (type $13) + (block $label$4 (result f32) ;; but this type may change dangerously + (nop) ;; fold this + (br $label$3) + ) + (i32.const 105) ) - (i32.const 105) + (nop) ;; with this ) - (nop) ;; with this ) ) ) @@ -53,22 +55,30 @@ ;; CHECK: (func $negative-zero (result f32) ;; CHECK-NEXT: (if (result f32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $label$0 (result f32) - ;; CHECK-NEXT: (f32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $label$0 (result f32) + ;; CHECK-NEXT: (f32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $label$1 (result f32) - ;; CHECK-NEXT: (f32.const -0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $label$1 (result f32) + ;; CHECK-NEXT: (f32.const -0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $negative-zero (result f32) (if (result f32) (i32.const 0) - (block $label$0 (result f32) - (f32.const 0) + (then + (block $label$0 (result f32) + (f32.const 0) + ) ) - (block $label$1 (result f32) - (f32.const -0) + (else + (block $label$1 (result f32) + (f32.const -0) + ) ) ) ) @@ -83,11 +93,15 @@ (func $negative-zero-b (result f32) (if (result f32) (i32.const 0) - (block $label$0 (result f32) - (f32.const -0) + (then + (block $label$0 (result f32) + (f32.const -0) + ) ) - (block $label$1 (result f32) - (f32.const -0) + (else + (block $label$1 (result f32) + (f32.const -0) + ) ) ) ) @@ -102,11 +116,15 @@ (func $negative-zero-c (result f32) (if (result f32) (i32.const 0) - (block $label$0 (result f32) - (f32.const 0) + (then + (block $label$0 (result f32) + (f32.const 0) + ) ) - (block $label$1 (result f32) - (f32.const 0) + (else + (block $label$1 (result f32) + (f32.const 0) + ) ) ) ) @@ -114,23 +132,29 @@ ;; CHECK-NEXT: (block $label$A ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $label$B - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (br_table $label$A $label$B + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block $label$B + ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_table $label$A $label$B + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (return) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block $label$C ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (br_table $label$A $label$C - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_table $label$A $label$C + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -143,29 +167,37 @@ (block $label$A (if (unreachable) - (block + (then (block - (block $label$B - (if - (unreachable) - (br_table $label$A $label$B + (block + (block $label$B + (if (unreachable) + (then + (br_table $label$A $label$B + (unreachable) + ) + ) ) ) + (return) ) - (return) ) ) - (block - (block $label$C - (if - (unreachable) - (br_table $label$A $label$C ;; this all looks mergeable, but $label$A is outside + (else + (block + (block $label$C + (if (unreachable) + (then + (br_table $label$A $label$C ;; this all looks mergeable, but $label$A is outside + (unreachable) + ) + ) ) ) + (return) ) - (return) ) ) ) @@ -175,18 +207,24 @@ ;; CHECK-NEXT: (block $label$A ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $folding-inner0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (br $folding-inner0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $folding-inner0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block $label$B ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (br_table $label$B $label$B - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_table $label$B $label$B + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -196,29 +234,37 @@ (block $label$A (if (unreachable) - (block + (then (block - (block $label$B - (if - (unreachable) - (br_table $label$B $label$B + (block + (block $label$B + (if (unreachable) + (then + (br_table $label$B $label$B + (unreachable) + ) + ) ) ) + (return) ) - (return) ) ) - (block - (block $label$C - (if - (unreachable) - (br_table $label$C $label$C ;; this all looks mergeable, and is, B ~~ C + (else + (block + (block $label$C + (if (unreachable) + (then + (br_table $label$C $label$C ;; this all looks mergeable, and is, B ~~ C + (unreachable) + ) + ) ) ) + (return) ) - (return) ) ) ) @@ -270,11 +316,15 @@ ;; CHECK-NEXT: (local $var$0 i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.load offset=22 - ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.load offset=22 + ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.atomic.load offset=22 - ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.atomic.load offset=22 + ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -282,11 +332,15 @@ (local $var$0 i32) (if (result i32) (i32.const 0) - (i32.load offset=22 - (local.get $var$0) + (then + (i32.load offset=22 + (local.get $var$0) + ) ) - (i32.atomic.load offset=22 - (local.get $var$0) + (else + (i32.atomic.load offset=22 + (local.get $var$0) + ) ) ) ) @@ -313,13 +367,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global$0) - ;; CHECK-NEXT: (br $folding-inner0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $folding-inner0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global$0) - ;; CHECK-NEXT: (br $folding-inner0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $folding-inner0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -351,28 +409,32 @@ ) (if (global.get $global$0) - (block - (global.set $global$0 - (i32.sub - (global.get $global$0) - (i32.const 1) + (then + (block + (global.set $global$0 + (i32.sub + (global.get $global$0) + (i32.const 1) + ) ) + (unreachable) ) - (unreachable) ) ) (unreachable) ) (if (global.get $global$0) - (block - (global.set $global$0 - (i32.sub - (global.get $global$0) - (i32.const 1) + (then + (block + (global.set $global$0 + (i32.sub + (global.get $global$0) + (i32.const 1) + ) ) + (unreachable) ) - (unreachable) ) ) (unreachable) diff --git a/test/lit/passes/code-pushing-eh.wast b/test/lit/passes/code-pushing-eh.wast index 60d9f907f..bfda0dd16 100644 --- a/test/lit/passes/code-pushing-eh.wast +++ b/test/lit/passes/code-pushing-eh.wast @@ -329,8 +329,10 @@ ;; CHECK-NEXT: (block $block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $param) - ;; CHECK-NEXT: (throw $e - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (throw $e + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $x @@ -351,7 +353,9 @@ (local.set $x (i32.const 1)) (if (local.get $param) - (throw $e (i32.const 0)) + (then + (throw $e (i32.const 0)) + ) ) (drop (local.get $x)) ) @@ -365,8 +369,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $param) - ;; CHECK-NEXT: (throw $e - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (throw $e + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -385,7 +391,9 @@ (local.set $x (i32.const 1)) (if (local.get $param) - (throw $e (i32.const 0)) + (then + (throw $e (i32.const 0)) + ) ) (drop (local.get $x)) ) diff --git a/test/lit/passes/code-pushing_ignore-implicit-traps.wast b/test/lit/passes/code-pushing_ignore-implicit-traps.wast index d8fadefd7..b275e58e2 100644 --- a/test/lit/passes/code-pushing_ignore-implicit-traps.wast +++ b/test/lit/passes/code-pushing_ignore-implicit-traps.wast @@ -200,7 +200,9 @@ ;; CHECK-NEXT: (block $out ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -214,7 +216,7 @@ (local $x i32) (block $out (local.set $x (i32.const 1)) - (if (i32.const 2) (nop)) + (if (i32.const 2) (then (nop))) (drop (local.get $x)) ) ) @@ -510,7 +512,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $value-interferes) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $value-interferes) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) @@ -522,7 +526,9 @@ (block $out (local.set $x (i32.load (i32.const 0))) (if (i32.const 1) - (call $value-interferes) + (then + (call $value-interferes) + ) ) (drop (local.get $x)) ) @@ -696,7 +702,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -707,7 +715,9 @@ (br_if $out (i32.const 1)) (if (local.get $x) - (nop) + (then + (nop) + ) ) ) ) diff --git a/test/lit/passes/code-pushing_into_if.wast b/test/lit/passes/code-pushing_into_if.wast index 3ef905dd5..ec10bb226 100644 --- a/test/lit/passes/code-pushing_into_if.wast +++ b/test/lit/passes/code-pushing_into_if.wast @@ -12,7 +12,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-nop (param $p i32) @@ -21,7 +23,9 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (nop) + (then + (nop) + ) ) ) @@ -32,8 +36,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-nop-nop (param $p i32) @@ -41,8 +49,12 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (nop) - (nop) ;; add a nop here compared to the last testcase (no output change) + (then + (nop) + ) + (else + (nop) ;; add a nop here compared to the last testcase (no output change) + ) ) ) @@ -51,7 +63,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -67,7 +79,9 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) ) @@ -76,7 +90,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -84,7 +98,9 @@ ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-use-nop (param $p i32) @@ -92,8 +108,12 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (drop (local.get $x)) - (nop) ;; add a nop here compared to the last testcase (no output change) + (then + (drop (local.get $x)) + ) + (else + (nop) ;; add a nop here compared to the last testcase (no output change) + ) ) ) @@ -102,8 +122,10 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -119,8 +141,12 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (nop) - (drop (local.get $x)) + (then + (nop) + ) + (else + (drop (local.get $x)) + ) ) ) @@ -135,8 +161,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -150,7 +178,9 @@ (local.set $y (local.get $x)) (if (local.get $p) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) ) @@ -161,11 +191,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -175,8 +209,12 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (drop (local.get $x)) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) + (else + (drop (local.get $x)) + ) ) ) @@ -187,8 +225,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -201,7 +241,9 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) (drop (local.get $x)) ) @@ -213,10 +255,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) @@ -227,8 +273,12 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (drop (local.get $x)) - (nop) ;; add a nop here compared to the last testcase (no output change) + (then + (drop (local.get $x)) + ) + (else + (nop) ;; add a nop here compared to the last testcase (no output change) + ) ) (drop (local.get $x)) ) @@ -240,9 +290,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -254,8 +308,12 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (nop) - (drop (local.get $x)) ;; now the use in the if is in the else arm + (then + (nop) + ) + (else + (drop (local.get $x)) ;; now the use in the if is in the else arm + ) ) (drop (local.get $x)) ) @@ -265,7 +323,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -273,7 +331,9 @@ ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) @@ -285,8 +345,12 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (drop (local.get $x)) - (return) + (then + (drop (local.get $x)) + ) + (else + (return) + ) ) (drop (local.get $x)) ) @@ -296,8 +360,10 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (return) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -315,8 +381,12 @@ (local.set $x (i32.const 1)) (if (local.get $p) - (return) ;; as above, but with arms flipped - (drop (local.get $x)) + (then + (return) ;; as above, but with arms flipped + ) + (else + (drop (local.get $x)) + ) ) (drop (local.get $x)) ) @@ -330,7 +400,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -344,7 +414,7 @@ ;; CHECK-NEXT: (local.get $z) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $y ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) @@ -364,11 +434,15 @@ (local.set $z (i32.const 3)) (if (local.get $p) - (block - (drop (local.get $x)) - (drop (local.get $z)) + (then + (block + (drop (local.get $x)) + (drop (local.get $z)) + ) + ) + (else + (drop (local.get $y)) ) - (drop (local.get $y)) ) ) @@ -381,7 +455,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (local.get $t) ;; CHECK-NEXT: ) @@ -399,7 +473,9 @@ (drop (i32.const 2)) (if (local.get $p) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) ) @@ -416,8 +492,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -429,7 +507,9 @@ (drop (local.tee $t (i32.const 2))) (if (local.get $p) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) ) @@ -443,8 +523,10 @@ ;; CHECK-NEXT: (local.tee $t ;; CHECK-NEXT: (local.get $p) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -455,7 +537,9 @@ (local.set $x (local.get $t)) (if (local.tee $t (local.get $p)) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) ) @@ -467,8 +551,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -479,7 +565,9 @@ (local.set $x (local.get $t)) (if (local.get $x) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) ) @@ -493,8 +581,10 @@ ;; CHECK-NEXT: (local.tee $x ;; CHECK-NEXT: (local.get $p) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -505,7 +595,9 @@ (local.set $x (local.get $t)) (if (local.tee $x (local.get $p)) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) ) @@ -517,7 +609,7 @@ ;; CHECK-NEXT: (return) ;; CHECK-NEXT: (local.get $p) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -537,7 +629,9 @@ ;; anyhow. (local.get $p) ) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) ) @@ -552,8 +646,10 @@ ;; CHECK-NEXT: (br $out) ;; CHECK-NEXT: (local.get $p) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return) @@ -573,7 +669,9 @@ (br $out) (local.get $p) ) - (drop (local.get $x)) + (then + (drop (local.get $x)) + ) ) (return) ) @@ -589,10 +687,12 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $y ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -611,8 +711,12 @@ (local.set $y (local.get $x)) (if (local.get $p) - (drop (local.get $x)) - (drop (local.get $y)) + (then + (drop (local.get $x)) + ) + (else + (drop (local.get $y)) + ) ) ) @@ -625,7 +729,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $y ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -633,8 +737,10 @@ ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -647,8 +753,12 @@ (local.set $y (local.get $x)) (if (local.get $p) - (drop (local.get $y)) - (drop (local.get $x)) + (then + (drop (local.get $y)) + ) + (else + (drop (local.get $x)) + ) ) ) @@ -657,7 +767,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $temp ;; CHECK-NEXT: (call $call.without.effects ;; CHECK-NEXT: (i32.const 1234) @@ -684,8 +794,10 @@ ) (if (local.get $p) - (return - (local.get $temp) + (then + (return + (local.get $temp) + ) ) ) (i32.const 0) @@ -701,8 +813,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $temp) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $temp) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $temp) @@ -721,8 +835,10 @@ ) (if (local.get $p) - (return - (local.get $temp) + (then + (return + (local.get $temp) + ) ) ) (local.get $temp) ;; this line changed. @@ -738,8 +854,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $temp) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $temp) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -758,8 +876,10 @@ ) (if (local.get $p) - (return - (local.get $temp) + (then + (return + (local.get $temp) + ) ) ) (nop) ;; this line was added. @@ -776,8 +896,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $temp) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $temp) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -800,8 +922,10 @@ ) (if (local.get $p) - (return - (local.get $temp) + (then + (return + (local.get $temp) + ) ) ) (nop) @@ -817,7 +941,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $temp ;; CHECK-NEXT: (call $call.without.effects ;; CHECK-NEXT: (i32.const 1234) @@ -850,8 +974,10 @@ ) (if (local.get $p) - (return - (local.get $temp) + (then + (return + (local.get $temp) + ) ) ) (nop) @@ -875,8 +1001,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $temp) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $temp) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) @@ -897,8 +1025,10 @@ ) (if (local.get $p) - (return - (local.get $temp) + (then + (return + (local.get $temp) + ) ) ) (i32.const 0) @@ -909,14 +1039,18 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (block $label$3 - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (ref.as_non_null - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $label$3 + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.as_non_null + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -938,10 +1072,14 @@ ) (if (i32.const 1) - (unreachable) - (block $label$3 - (drop - (local.get $1) + (then + (unreachable) + ) + (else + (block $label$3 + (drop + (local.get $1) + ) ) ) ) diff --git a/test/lit/passes/code-pushing_tnh.wast b/test/lit/passes/code-pushing_tnh.wast index 1dcf725ad..74791aca9 100644 --- a/test/lit/passes/code-pushing_tnh.wast +++ b/test/lit/passes/code-pushing_tnh.wast @@ -13,7 +13,9 @@ ;; CHECK-NEXT: (block $block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $temp ;; CHECK-NEXT: (i32.div_u @@ -39,7 +41,9 @@ ) (if (local.get $y) - (return) + (then + (return) + ) ) (drop (local.get $temp) @@ -54,8 +58,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -68,8 +74,10 @@ ) (if (i32.const 0) - (drop - (local.get $x) + (then + (drop + (local.get $x) + ) ) ) ) diff --git a/test/lit/passes/dae-gc-refine-return.wast b/test/lit/passes/dae-gc-refine-return.wast index aa474d7f3..11638b62f 100644 --- a/test/lit/passes/dae-gc-refine-return.wast +++ b/test/lit/passes/dae-gc-refine-return.wast @@ -78,8 +78,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if (result i31ref) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $refine-return-flow) - ;; CHECK-NEXT: (call $refine-return-flow) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $refine-return-flow) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $refine-return-flow) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $call-refine-return-flow (result anyref) @@ -91,8 +95,12 @@ ;; function's return value. (if (result anyref) (i32.const 1) - (call $refine-return-flow) - (call $refine-return-flow) + (then + (call $refine-return-flow) + ) + (else + (call $refine-return-flow) + ) ) ) @@ -125,14 +133,18 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $i31) @@ -145,11 +157,15 @@ (if (i32.const 1) - (return (local.get $i31)) + (then + (return (local.get $i31)) + ) ) (if (i32.const 2) - (return (local.get $i31)) + (then + (return (local.get $i31)) + ) ) (local.get $i31) ) @@ -163,14 +179,18 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $struct) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $struct) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $i31) @@ -184,12 +204,16 @@ (if (i32.const 1) - (return (local.get $i31)) + (then + (return (local.get $i31)) + ) ) (if (i32.const 2) ;; The refined return type has to be a supertype of struct. - (return (local.get $struct)) + (then + (return (local.get $struct)) + ) ) (local.get $i31) ) @@ -203,14 +227,18 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $i31) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $struct) @@ -224,11 +252,15 @@ (if (i32.const 1) - (return (local.get $i31)) + (then + (return (local.get $i31)) + ) ) (if (i32.const 2) - (return (local.get $i31)) + (then + (return (local.get $i31)) + ) ) ;; The refined return type has to be a supertype of struct. (local.get $struct) @@ -301,8 +333,10 @@ ;; CHECK-NEXT: (local $any anyref) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $any) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $any) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return_call $tail-callee) @@ -313,7 +347,9 @@ ;; This function's return type cannot be refined because of another return ;; whose type prevents it. (if (i32.const 1) - (return (local.get $any)) + (then + (return (local.get $any)) + ) ) (return_call $tail-callee) ) @@ -354,8 +390,10 @@ ;; CHECK-NEXT: (local $any anyref) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $any) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $any) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return_call_indirect $0 (type $return_{}) @@ -366,7 +404,9 @@ (local $any anyref) (if (i32.const 1) - (return (local.get $any)) + (then + (return (local.get $any)) + ) ) (return_call_indirect (type $return_{}) (i32.const 0)) ) @@ -410,8 +450,10 @@ ;; CHECK-NEXT: (local $"return_{}" (ref null $return_{})) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $any) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $any) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return_call_ref $return_{} @@ -423,7 +465,9 @@ (local $return_{} (ref null $return_{})) (if (i32.const 1) - (return (local.get $any)) + (then + (return (local.get $any)) + ) ) (return_call_ref $return_{} (local.get $return_{})) ) @@ -466,18 +510,26 @@ ;; CHECK: (func $update-null (type $10) (param $x i32) (param $y i32) (result (ref null ${i32})) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (struct.new_default ${i32_f32}) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (struct.new_default ${i32_f32}) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (struct.new_default ${i32_i64}) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (struct.new_default ${i32_i64}) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $update-null (param $x i32) (param $y i32) (result anyref) @@ -485,12 +537,20 @@ ;; determined by the other two, and is their shared parent ${}. (if (local.get $x) - (if - (local.get $y) - (return (struct.new ${i32_f32})) - (return (ref.null any)) + (then + (if + (local.get $y) + (then + (return (struct.new ${i32_f32})) + ) + (else + (return (ref.null any)) + ) + ) + ) + (else + (return (struct.new ${i32_i64})) ) - (return (struct.new ${i32_i64})) ) ) diff --git a/test/lit/passes/dae-optimizing.wast b/test/lit/passes/dae-optimizing.wast index ddffbacfe..cb15d55cb 100644 --- a/test/lit/passes/dae-optimizing.wast +++ b/test/lit/passes/dae-optimizing.wast @@ -20,25 +20,31 @@ ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (i32.const 33554432) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $label$2 (result f32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (global.get $global$0) - ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $label$2 (result f32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (global.get $global$0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $label$2 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$2 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -11) @@ -50,33 +56,39 @@ (local.tee $7 (i32.const 33554432) ) - (drop - (loop $label$2 (result f32) - (if - (global.get $global$0) - (return - (local.get $7) + (then + (drop + (loop $label$2 (result f32) + (if + (global.get $global$0) + (then + (return + (local.get $7) + ) + ) ) - ) - (local.set $8 - (block $label$4 (result i32) - (drop - (local.tee $7 - (local.get $8) + (local.set $8 + (block $label$4 (result i32) + (drop + (local.tee $7 + (local.get $8) + ) ) + (i32.const 0) ) - (i32.const 0) ) + (br_if $label$2 + (local.get $7) + ) + (f32.const 1) ) - (br_if $label$2 - (local.get $7) - ) - (f32.const 1) ) ) - (drop - (call $1 - (f32.const 1) + (else + (drop + (call $1 + (f32.const 1) + ) ) ) ) diff --git a/test/lit/passes/dce-eh.wast b/test/lit/passes/dce-eh.wast index f05f5122e..123f7a42d 100644 --- a/test/lit/passes/dce-eh.wast +++ b/test/lit/passes/dce-eh.wast @@ -94,7 +94,9 @@ (throw $e) ) ) - (nop) + (then + (nop) + ) ) (ref.null extern) ) diff --git a/test/lit/passes/dce_all-features.wast b/test/lit/passes/dce_all-features.wast index 255ca82fd..3eb683676 100644 --- a/test/lit/passes/dce_all-features.wast +++ b/test/lit/passes/dce_all-features.wast @@ -43,12 +43,16 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $out3 - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $out3 + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block $out4 @@ -66,25 +70,37 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block4 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block4 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block $out16 ;; CHECK-NEXT: (block $in @@ -96,14 +112,16 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block11 - ;; CHECK-NEXT: (block $out18 - ;; CHECK-NEXT: (block $in19 - ;; CHECK-NEXT: (br_if $in19 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block11 + ;; CHECK-NEXT: (block $out18 + ;; CHECK-NEXT: (block $in19 + ;; CHECK-NEXT: (br_if $in19 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -125,32 +143,38 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block13 - ;; CHECK-NEXT: (block $out25 - ;; CHECK-NEXT: (block $in26 - ;; CHECK-NEXT: (br_table $in26 $in26 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block13 + ;; CHECK-NEXT: (block $out25 + ;; CHECK-NEXT: (block $in26 + ;; CHECK-NEXT: (br_table $in26 $in26 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block15 - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 42) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block15 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 42) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block $out29 ;; CHECK-NEXT: (loop $in30 @@ -162,18 +186,20 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block $block20 - ;; CHECK-NEXT: (loop $in32 - ;; CHECK-NEXT: (br_if $in32 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $block20 + ;; CHECK-NEXT: (loop $in32 + ;; CHECK-NEXT: (br_if $in32 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 123) ;; CHECK-NEXT: ) @@ -182,15 +208,19 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 123) ;; CHECK-NEXT: ) @@ -202,7 +232,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 139) ;; CHECK-NEXT: ) @@ -211,7 +241,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 246) ;; CHECK-NEXT: ) @@ -220,19 +250,25 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -4) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 22) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 33) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -241,23 +277,31 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 44) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 55) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 66) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 77) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 88) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -266,11 +310,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 99) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 123) ;; CHECK-NEXT: ) @@ -282,7 +328,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 101) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 123) ;; CHECK-NEXT: ) @@ -291,7 +337,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 102) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1337) @@ -306,8 +354,10 @@ ) (if (i32.const 1) - (drop - (i32.const 2) + (then + (drop + (i32.const 2) + ) ) ) (br_table $out $out $out $out @@ -317,19 +367,23 @@ ) (if (i32.const 0) - (block $out - (unreachable) - (drop - (i32.const 0) + (then + (block $out + (unreachable) + (drop + (i32.const 0) + ) ) ) ) (if (i32.const 0) - (block $out - (return) - (drop - (i32.const 0) + (then + (block $out + (return) + (drop + (i32.const 0) + ) ) ) ) @@ -351,68 +405,80 @@ ) (if (i32.const 0) - (block $block4 - (if - (i32.const 0) - (block $out - (unreachable) - (drop - (i32.const 0) + (then + (block $block4 + (if + (i32.const 0) + (then + (block $out + (unreachable) + (drop + (i32.const 0) + ) + ) ) - ) - (block $out - (unreachable) - (drop - (i32.const 0) + (else + (block $out + (unreachable) + (drop + (i32.const 0) + ) + ) ) ) - ) - (drop - (i32.const 0) + (drop + (i32.const 0) + ) ) ) ) (if (i32.const 0) - (drop - (block $out (result i32) - (br $out + (then + (drop + (block $out (result i32) + (br $out + (unreachable) + ) + (drop + (i32.const 0) + ) (unreachable) ) - (drop - (i32.const 0) - ) - (unreachable) ) ) ) (if (i32.const 0) - (drop - (block $out (result i32) - (br_if $out + (then + (drop + (block $out (result i32) + (br_if $out + (unreachable) + (i32.const 0) + ) + (drop + (i32.const 0) + ) (unreachable) - (i32.const 0) ) - (drop - (i32.const 0) - ) - (unreachable) ) ) ) (if (i32.const 0) - (drop - (block $out (result i32) - (br_if $out - (unreachable) + (then + (drop + (block $out (result i32) + (br_if $out + (unreachable) + (unreachable) + ) + (drop + (i32.const 0) + ) (unreachable) ) - (drop - (i32.const 0) - ) - (unreachable) ) ) ) @@ -426,17 +492,19 @@ ) (if (i32.const 0) - (block $block11 - (block $out - (block $in - (br_if $in - (i32.const 1) + (then + (block $block11 + (block $out + (block $in + (br_if $in + (i32.const 1) + ) ) + (unreachable) + ) + (drop + (i32.const 10) ) - (unreachable) - ) - (drop - (i32.const 10) ) ) ) @@ -458,41 +526,47 @@ ) (if (i32.const 0) - (block $block13 - (block $out - (block $in - (br_table $in $in - (i32.const 1) + (then + (block $block13 + (block $out + (block $in + (br_table $in $in + (i32.const 1) + ) ) + (unreachable) + ) + (drop + (i32.const 10) ) - (unreachable) - ) - (drop - (i32.const 10) ) ) ) (if (i32.const 0) - (block $block15 - (drop - (i32.const 10) - ) - (drop - (i32.const 42) - ) - (unreachable) - (return + (then + (block $block15 + (drop + (i32.const 10) + ) + (drop + (i32.const 42) + ) (unreachable) + (return + (unreachable) + ) + (unreachable) + (return) ) - (unreachable) - (return) ) ) (if (i32.const 0) - (loop $loop-in18 - (unreachable) + (then + (loop $loop-in18 + (unreachable) + ) ) ) (block $out @@ -505,166 +579,206 @@ ) (if (i32.const 0) - (block $block20 - (loop $in - (br_if $in - (i32.const 1) + (then + (block $block20 + (loop $in + (br_if $in + (i32.const 1) + ) + (unreachable) + ) + (drop + (i32.const 10) ) - (unreachable) - ) - (drop - (i32.const 10) ) ) ) (if (i32.const 1) - (call $call-me - (i32.const 123) - (unreachable) + (then + (call $call-me + (i32.const 123) + (unreachable) + ) ) ) (if (i32.const 2) - (call $call-me - (unreachable) - (i32.const 0) + (then + (call $call-me + (unreachable) + (i32.const 0) + ) ) ) (if (i32.const 3) - (call $call-me - (unreachable) - (unreachable) + (then + (call $call-me + (unreachable) + (unreachable) + ) ) ) (if (i32.const -1) - (call_indirect (type $ii) - (i32.const 123) - (i32.const 456) - (unreachable) + (then + (call_indirect (type $ii) + (i32.const 123) + (i32.const 456) + (unreachable) + ) ) ) (if (i32.const -2) - (call_indirect (type $ii) - (i32.const 139) - (unreachable) - (i32.const 0) + (then + (call_indirect (type $ii) + (i32.const 139) + (unreachable) + (i32.const 0) + ) ) ) (if (i32.const -3) - (call_indirect (type $ii) - (i32.const 246) - (unreachable) - (unreachable) + (then + (call_indirect (type $ii) + (i32.const 246) + (unreachable) + (unreachable) + ) ) ) (if (i32.const -4) - (call_indirect (type $ii) - (unreachable) - (unreachable) - (unreachable) + (then + (call_indirect (type $ii) + (unreachable) + (unreachable) + (unreachable) + ) ) ) (if (i32.const 11) - (local.set $x - (unreachable) + (then + (local.set $x + (unreachable) + ) ) ) (if (i32.const 22) - (drop - (i32.load - (unreachable) + (then + (drop + (i32.load + (unreachable) + ) ) ) ) (if (i32.const 33) - (i32.store - (i32.const 0) - (unreachable) + (then + (i32.store + (i32.const 0) + (unreachable) + ) ) ) (if (i32.const 44) - (i32.store - (unreachable) - (i32.const 0) + (then + (i32.store + (unreachable) + (i32.const 0) + ) ) ) (if (i32.const 55) - (i32.store - (unreachable) - (unreachable) + (then + (i32.store + (unreachable) + (unreachable) + ) ) ) (if (i32.const 66) - (drop - (i32.eqz - (unreachable) + (then + (drop + (i32.eqz + (unreachable) + ) ) ) ) (if (i32.const 77) - (drop - (i32.add - (unreachable) - (i32.const 0) + (then + (drop + (i32.add + (unreachable) + (i32.const 0) + ) ) ) ) (if (i32.const 88) - (drop - (i32.add - (i32.const 0) - (unreachable) + (then + (drop + (i32.add + (i32.const 0) + (unreachable) + ) ) ) ) (if (i32.const 99) - (i32.add - (unreachable) - (unreachable) + (then + (i32.add + (unreachable) + (unreachable) + ) ) ) (if (i32.const 100) - (drop - (select - (i32.const 123) - (i32.const 456) - (unreachable) + (then + (drop + (select + (i32.const 123) + (i32.const 456) + (unreachable) + ) ) ) ) (if (i32.const 101) - (drop - (select - (i32.const 123) - (unreachable) - (i32.const 456) + (then + (drop + (select + (i32.const 123) + (unreachable) + (i32.const 456) + ) ) ) ) (if (i32.const 102) - (drop - (select - (unreachable) - (i32.const 123) - (i32.const 456) + (then + (drop + (select + (unreachable) + (i32.const 123) + (i32.const 456) + ) ) ) ) @@ -898,28 +1012,32 @@ ;; CHECK-NEXT: (i64.eqz ;; CHECK-NEXT: (local.get $var$0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $label$0 (result i64) - ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $label$0 (result i64) + ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $label$1 - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i64.sub - ;; CHECK-NEXT: (local.get $var$0) - ;; CHECK-NEXT: (i64.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $label$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (block (result i64) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: (i64.sub + ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: (i64.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result i64) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -931,24 +1049,28 @@ (i64.eqz (local.get $var$0) ) - (block $label$0 (result i64) - (local.get $var$1) + (then + (block $label$0 (result i64) + (local.get $var$1) + ) ) - (block $label$1 (result i64) - (call $call-unreach - (i64.sub - (local.get $var$0) - (i64.const 1) - ) - (i64.mul - (block (result i64) - (local.set $2 - (local.get $var$0) + (else + (block $label$1 (result i64) + (call $call-unreach + (i64.sub + (local.get $var$0) + (i64.const 1) + ) + (i64.mul + (block (result i64) + (local.set $2 + (local.get $var$0) + ) + (nop) + (local.get $2) ) - (nop) - (local.get $2) + (unreachable) ) - (unreachable) ) ) ) @@ -1033,8 +1155,10 @@ (unreachable) (if (unreachable) - (br_if $label$0 - (local.get $var$1) + (then + (br_if $label$0 + (local.get $var$1) + ) ) ) ) @@ -1061,8 +1185,12 @@ ;; CHECK-NEXT: (block $label$0 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$0) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1071,8 +1199,12 @@ (br $label$0 (if (result i32) (local.get $var$0) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) ) @@ -1157,8 +1289,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1177,8 +1313,12 @@ ) (i32.const 1) ) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) ) @@ -1227,8 +1367,12 @@ (i32.load16_s offset=22 align=1 (i32.const 0) ) - (br $top) ;; this keeps the block none after the inner block gets unreachable. but it will vanish into unreachable itself - (unreachable) + (then + (br $top) ;; this keeps the block none after the inner block gets unreachable. but it will vanish into unreachable itself + ) + (else + (unreachable) + ) ) ) ) @@ -1248,16 +1392,24 @@ ;; CHECK: (func $0 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $0 (global.set $global (if (result f64) (i32.const 0) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) ) @@ -1269,8 +1421,12 @@ ;; CHECK-NEXT: (local $local f64) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $0 @@ -1278,8 +1434,12 @@ (local.set $local (if (result f64) (i32.const 0) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) ) @@ -1318,17 +1478,25 @@ ;; CHECK: (func $unnecessary-concrete-if (type $0) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $unnecessary-concrete-if (result i32) (if (result i32) ;; unnecessary type (i32.const 0) - (return (i32.const 1)) - (unreachable) + (then + (return (i32.const 1)) + ) + (else + (unreachable) + ) ) ) ;; CHECK: (func $unnecessary-concrete-try (type $0) (result i32) @@ -1368,8 +1536,12 @@ (nop) (unreachable) ) - (unreachable) - (br $label$1) + (then + (unreachable) + ) + (else + (br $label$1) + ) ) ) ) @@ -1436,9 +1608,13 @@ ;; CHECK-NEXT: (ref.cast i31ref ;; CHECK-NEXT: (if (result i31ref) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (ref.i31 - ;; CHECK-NEXT: (i32.const 42) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (ref.i31 + ;; CHECK-NEXT: (i32.const 42) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1454,11 +1630,15 @@ (ref.cast i31ref (if (result i31ref) (i32.const 0) - (block (result i31ref) - (unreachable) + (then + (block (result i31ref) + (unreachable) + ) ) - (ref.i31 - (i32.const 42) + (else + (ref.i31 + (i32.const 42) + ) ) ) ) diff --git a/test/lit/passes/dce_vacuum_remove-unused-names.wast b/test/lit/passes/dce_vacuum_remove-unused-names.wast index b7a53d61b..492029191 100644 --- a/test/lit/passes/dce_vacuum_remove-unused-names.wast +++ b/test/lit/passes/dce_vacuum_remove-unused-names.wast @@ -49,8 +49,12 @@ ;; CHECK-NEXT: (local.get $var$1) ;; CHECK-NEXT: (i64.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $set-unreachable (param $var$0 i64) (result i64) @@ -64,11 +68,15 @@ (local.get $var$1) (i64.const 0) ) - (unreachable) - (local.set $var$2 - (i64.mul - (unreachable) - (local.get $var$2) + (then + (unreachable) + ) + (else + (local.set $var$2 + (i64.mul + (unreachable) + (local.get $var$2) + ) ) ) ) diff --git a/test/lit/passes/denan.wast b/test/lit/passes/denan.wast index 1932ce534..7baabc369 100644 --- a/test/lit/passes/denan.wast +++ b/test/lit/passes/denan.wast @@ -186,8 +186,12 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: (f32.const 0) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (local.get $0) +;; CHECK-NEXT: ) +;; CHECK-NEXT: (else +;; CHECK-NEXT: (f32.const 0) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -197,8 +201,12 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: (f64.const 0) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (local.get $0) +;; CHECK-NEXT: ) +;; CHECK-NEXT: (else +;; CHECK-NEXT: (f64.const 0) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (module @@ -255,8 +263,12 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: (f32.const 0) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (local.get $0) +;; CHECK-NEXT: ) +;; CHECK-NEXT: (else +;; CHECK-NEXT: (f32.const 0) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -266,7 +278,11 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (local.get $0) -;; CHECK-NEXT: (f64.const 0) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (local.get $0) +;; CHECK-NEXT: ) +;; CHECK-NEXT: (else +;; CHECK-NEXT: (f64.const 0) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/directize_all-features.wast b/test/lit/passes/directize_all-features.wast index 53ff29ab6..c560baf0e 100644 --- a/test/lit/passes/directize_all-features.wast +++ b/test/lit/passes/directize_all-features.wast @@ -785,13 +785,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (call $foo1 - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $foo1 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $foo2 - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $foo2 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -806,13 +810,17 @@ ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: (if ;; IMMUT-NEXT: (local.get $z) - ;; IMMUT-NEXT: (call $foo1 - ;; IMMUT-NEXT: (local.get $3) - ;; IMMUT-NEXT: (local.get $4) + ;; IMMUT-NEXT: (then + ;; IMMUT-NEXT: (call $foo1 + ;; IMMUT-NEXT: (local.get $3) + ;; IMMUT-NEXT: (local.get $4) + ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) - ;; IMMUT-NEXT: (call $foo2 - ;; IMMUT-NEXT: (local.get $3) - ;; IMMUT-NEXT: (local.get $4) + ;; IMMUT-NEXT: (else + ;; IMMUT-NEXT: (call $foo2 + ;; IMMUT-NEXT: (local.get $3) + ;; IMMUT-NEXT: (local.get $4) + ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) @@ -908,10 +916,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (call $foo2 - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $foo2 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -926,10 +938,14 @@ ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: (if ;; IMMUT-NEXT: (local.get $z) - ;; IMMUT-NEXT: (unreachable) - ;; IMMUT-NEXT: (call $foo2 - ;; IMMUT-NEXT: (local.get $3) - ;; IMMUT-NEXT: (local.get $4) + ;; IMMUT-NEXT: (then + ;; IMMUT-NEXT: (unreachable) + ;; IMMUT-NEXT: ) + ;; IMMUT-NEXT: (else + ;; IMMUT-NEXT: (call $foo2 + ;; IMMUT-NEXT: (local.get $3) + ;; IMMUT-NEXT: (local.get $4) + ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) @@ -957,8 +973,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; IMMUT: (func $select-both-out-of-range (type $0) (param $x i32) (param $y i32) (param $z i32) @@ -972,8 +992,12 @@ ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: (if ;; IMMUT-NEXT: (local.get $z) - ;; IMMUT-NEXT: (unreachable) - ;; IMMUT-NEXT: (unreachable) + ;; IMMUT-NEXT: (then + ;; IMMUT-NEXT: (unreachable) + ;; IMMUT-NEXT: ) + ;; IMMUT-NEXT: (else + ;; IMMUT-NEXT: (unreachable) + ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) (func $select-both-out-of-range (param $x i32) (param $y i32) (param $z i32) @@ -1060,15 +1084,23 @@ ;; CHECK: (func $select-bad-type (type $2) (param $z i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; IMMUT: (func $select-bad-type (type $2) (param $z i32) ;; IMMUT-NEXT: (if ;; IMMUT-NEXT: (local.get $z) - ;; IMMUT-NEXT: (unreachable) - ;; IMMUT-NEXT: (unreachable) + ;; IMMUT-NEXT: (then + ;; IMMUT-NEXT: (unreachable) + ;; IMMUT-NEXT: ) + ;; IMMUT-NEXT: (else + ;; IMMUT-NEXT: (unreachable) + ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) (func $select-bad-type (param $z i32) @@ -1129,11 +1161,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (call $foo-ref - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $foo-ref + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $foo-ref - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $foo-ref + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1144,11 +1180,15 @@ ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: (if ;; IMMUT-NEXT: (local.get $x) - ;; IMMUT-NEXT: (call $foo-ref - ;; IMMUT-NEXT: (local.get $1) + ;; IMMUT-NEXT: (then + ;; IMMUT-NEXT: (call $foo-ref + ;; IMMUT-NEXT: (local.get $1) + ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) - ;; IMMUT-NEXT: (call $foo-ref - ;; IMMUT-NEXT: (local.get $1) + ;; IMMUT-NEXT: (else + ;; IMMUT-NEXT: (call $foo-ref + ;; IMMUT-NEXT: (local.get $1) + ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) ;; IMMUT-NEXT: ) diff --git a/test/lit/passes/flatten_all-features.wast b/test/lit/passes/flatten_all-features.wast index 3ce849686..fd7332609 100644 --- a/test/lit/passes/flatten_all-features.wast +++ b/test/lit/passes/flatten_all-features.wast @@ -568,14 +568,18 @@ ;; CHECK: (func $a11 (type $1) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $a11 (if (i32.const 0) - (drop (i32.const 1)) + (then + (drop (i32.const 1)) + ) ) ) ;; CHECK: (func $a12 (type $2) (result i32) @@ -583,11 +587,15 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $1 @@ -599,8 +607,12 @@ ;; CHECK-NEXT: ) (func $a12 (result i32) (if (result i32) (i32.const 0) - (i32.const 1) - (i32.const 2) + (then + (i32.const 1) + ) + (else + (i32.const 2) + ) ) ) ;; CHECK: (func $a13 (type $2) (result i32) @@ -622,11 +634,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -648,8 +664,12 @@ (block $x i32 (if i32 (br_table $x (i32.const 2) (i32.const 0)) - (i32.const 0) - (i32.const 1) + (then + (i32.const 0) + ) + (else + (i32.const 1) + ) ) ) ) @@ -700,11 +720,11 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block $label$3 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -725,10 +745,14 @@ (i32.load16_u (i32.const 53) ) - (unreachable) - (drop - (block $label$3 (result f32) - (unreachable) + (then + (unreachable) + ) + (else + (drop + (block $label$3 (result f32) + (unreachable) + ) ) ) ) @@ -955,8 +979,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_table $out $out $out $out @@ -967,7 +993,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $out1 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -980,7 +1006,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $out3 ;; CHECK-NEXT: (return) ;; CHECK-NEXT: (unreachable) @@ -1010,11 +1036,11 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $block4 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $out8 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -1024,7 +1050,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block $out9 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -1045,7 +1071,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $out11 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -1066,7 +1092,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $out13 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -1087,7 +1113,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $out15 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -1118,7 +1144,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $block11 ;; CHECK-NEXT: (block $out18 ;; CHECK-NEXT: (block $in19 @@ -1159,7 +1185,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $block13 ;; CHECK-NEXT: (block $out25 ;; CHECK-NEXT: (block $in26 @@ -1181,7 +1207,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $block15 ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 10) @@ -1206,7 +1232,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (loop $loop-in18 ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -1229,7 +1255,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $block20 ;; CHECK-NEXT: (loop $in32 ;; CHECK-NEXT: (block @@ -1251,7 +1277,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (call $call-me ;; CHECK-NEXT: (i32.const 123) @@ -1262,7 +1288,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (call $call-me ;; CHECK-NEXT: (unreachable) @@ -1273,7 +1299,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (call $call-me @@ -1285,7 +1311,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (call_indirect $0 (type $ii) ;; CHECK-NEXT: (i32.const 123) @@ -1297,7 +1323,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (call_indirect $0 (type $ii) ;; CHECK-NEXT: (i32.const 139) @@ -1309,7 +1335,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (call_indirect $0 (type $ii) @@ -1322,7 +1348,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -4) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -1336,7 +1362,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) @@ -1344,7 +1370,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 22) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (unreachable) @@ -1357,7 +1383,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 33) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 0) @@ -1368,7 +1394,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 44) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (unreachable) @@ -1379,7 +1405,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 55) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (i32.store @@ -1391,7 +1417,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 66) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (unreachable) @@ -1404,7 +1430,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 77) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (unreachable) @@ -1418,7 +1444,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 88) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.const 0) @@ -1432,7 +1458,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 99) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (i32.add @@ -1444,7 +1470,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (select ;; CHECK-NEXT: (i32.const 123) @@ -1459,7 +1485,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 101) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (select ;; CHECK-NEXT: (i32.const 123) @@ -1474,7 +1500,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 102) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (select ;; CHECK-NEXT: (unreachable) @@ -1500,8 +1526,10 @@ ) (if (i32.const 1) - (drop - (i32.const 2) + (then + (drop + (i32.const 2) + ) ) ) (br_table $out $out $out $out @@ -1511,19 +1539,23 @@ ) (if (i32.const 0) - (block $out1 - (unreachable) - (drop - (i32.const 0) + (then + (block $out1 + (unreachable) + (drop + (i32.const 0) + ) ) ) ) (if (i32.const 0) - (block $out3 - (return) - (drop - (i32.const 0) + (then + (block $out3 + (return) + (drop + (i32.const 0) + ) ) ) ) @@ -1545,68 +1577,80 @@ ) (if (i32.const 0) - (block $block4 - (if - (i32.const 0) - (block $out8 - (unreachable) - (drop - (i32.const 0) + (then + (block $block4 + (if + (i32.const 0) + (then + (block $out8 + (unreachable) + (drop + (i32.const 0) + ) + ) ) - ) - (block $out9 - (unreachable) - (drop - (i32.const 0) + (else + (block $out9 + (unreachable) + (drop + (i32.const 0) + ) + ) ) ) - ) - (drop - (i32.const 0) + (drop + (i32.const 0) + ) ) ) ) (if (i32.const 0) - (drop - (block $out11 (result i32) - (br $out11 + (then + (drop + (block $out11 (result i32) + (br $out11 + (unreachable) + ) + (drop + (i32.const 0) + ) (unreachable) ) - (drop - (i32.const 0) - ) - (unreachable) ) ) ) (if (i32.const 0) - (drop - (block $out13 (result i32) - (br_if $out13 + (then + (drop + (block $out13 (result i32) + (br_if $out13 + (unreachable) + (i32.const 0) + ) + (drop + (i32.const 0) + ) (unreachable) - (i32.const 0) - ) - (drop - (i32.const 0) ) - (unreachable) ) ) ) (if (i32.const 0) - (drop - (block $out15 (result i32) - (br_if $out15 - (unreachable) + (then + (drop + (block $out15 (result i32) + (br_if $out15 + (unreachable) + (unreachable) + ) + (drop + (i32.const 0) + ) (unreachable) ) - (drop - (i32.const 0) - ) - (unreachable) ) ) ) @@ -1620,17 +1664,19 @@ ) (if (i32.const 0) - (block $block11 - (block $out18 - (block $in19 - (br_if $in19 - (i32.const 1) + (then + (block $block11 + (block $out18 + (block $in19 + (br_if $in19 + (i32.const 1) + ) ) + (unreachable) + ) + (drop + (i32.const 10) ) - (unreachable) - ) - (drop - (i32.const 10) ) ) ) @@ -1652,41 +1698,47 @@ ) (if (i32.const 0) - (block $block13 - (block $out25 - (block $in26 - (br_table $in26 $in26 - (i32.const 1) + (then + (block $block13 + (block $out25 + (block $in26 + (br_table $in26 $in26 + (i32.const 1) + ) ) + (unreachable) + ) + (drop + (i32.const 10) ) - (unreachable) - ) - (drop - (i32.const 10) ) ) ) (if (i32.const 0) - (block $block15 - (drop - (i32.const 10) - ) - (drop - (i32.const 42) - ) - (unreachable) - (return + (then + (block $block15 + (drop + (i32.const 10) + ) + (drop + (i32.const 42) + ) (unreachable) + (return + (unreachable) + ) + (unreachable) + (return) ) - (unreachable) - (return) ) ) (if (i32.const 0) - (loop $loop-in18 - (unreachable) + (then + (loop $loop-in18 + (unreachable) + ) ) ) (block $out29 @@ -1699,166 +1751,206 @@ ) (if (i32.const 0) - (block $block20 - (loop $in32 - (br_if $in32 - (i32.const 1) + (then + (block $block20 + (loop $in32 + (br_if $in32 + (i32.const 1) + ) + (unreachable) + ) + (drop + (i32.const 10) ) - (unreachable) - ) - (drop - (i32.const 10) ) ) ) (if (i32.const 1) - (call $call-me - (i32.const 123) - (unreachable) + (then + (call $call-me + (i32.const 123) + (unreachable) + ) ) ) (if (i32.const 2) - (call $call-me - (unreachable) - (i32.const 0) + (then + (call $call-me + (unreachable) + (i32.const 0) + ) ) ) (if (i32.const 3) - (call $call-me - (unreachable) - (unreachable) + (then + (call $call-me + (unreachable) + (unreachable) + ) ) ) (if (i32.const -1) - (call_indirect (type $ii) - (i32.const 123) - (i32.const 456) - (unreachable) + (then + (call_indirect (type $ii) + (i32.const 123) + (i32.const 456) + (unreachable) + ) ) ) (if (i32.const -2) - (call_indirect (type $ii) - (i32.const 139) - (unreachable) - (i32.const 0) + (then + (call_indirect (type $ii) + (i32.const 139) + (unreachable) + (i32.const 0) + ) ) ) (if (i32.const -3) - (call_indirect (type $ii) - (i32.const 246) - (unreachable) - (unreachable) + (then + (call_indirect (type $ii) + (i32.const 246) + (unreachable) + (unreachable) + ) ) ) (if (i32.const -4) - (call_indirect (type $ii) - (unreachable) - (unreachable) - (unreachable) + (then + (call_indirect (type $ii) + (unreachable) + (unreachable) + (unreachable) + ) ) ) (if (i32.const 11) - (local.set $x - (unreachable) + (then + (local.set $x + (unreachable) + ) ) ) (if (i32.const 22) - (drop - (i32.load - (unreachable) + (then + (drop + (i32.load + (unreachable) + ) ) ) ) (if (i32.const 33) - (i32.store - (i32.const 0) - (unreachable) + (then + (i32.store + (i32.const 0) + (unreachable) + ) ) ) (if (i32.const 44) - (i32.store - (unreachable) - (i32.const 0) + (then + (i32.store + (unreachable) + (i32.const 0) + ) ) ) (if (i32.const 55) - (i32.store - (unreachable) - (unreachable) + (then + (i32.store + (unreachable) + (unreachable) + ) ) ) (if (i32.const 66) - (drop - (i32.eqz - (unreachable) + (then + (drop + (i32.eqz + (unreachable) + ) ) ) ) (if (i32.const 77) - (drop - (i32.add - (unreachable) - (i32.const 0) + (then + (drop + (i32.add + (unreachable) + (i32.const 0) + ) ) ) ) (if (i32.const 88) - (drop - (i32.add - (i32.const 0) - (unreachable) + (then + (drop + (i32.add + (i32.const 0) + (unreachable) + ) ) ) ) (if (i32.const 99) - (i32.add - (unreachable) - (unreachable) + (then + (i32.add + (unreachable) + (unreachable) + ) ) ) (if (i32.const 100) - (drop - (select - (i32.const 123) - (i32.const 456) - (unreachable) + (then + (drop + (select + (i32.const 123) + (i32.const 456) + (unreachable) + ) ) ) ) (if (i32.const 101) - (drop - (select - (i32.const 123) - (unreachable) - (i32.const 456) + (then + (drop + (select + (i32.const 123) + (unreachable) + (i32.const 456) + ) ) ) ) (if (i32.const 102) - (drop - (select - (unreachable) - (i32.const 123) - (i32.const 456) + (then + (drop + (select + (unreachable) + (i32.const 123) + (i32.const 456) + ) ) ) ) @@ -2296,7 +2388,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $label$0 ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $var$1) @@ -2312,7 +2404,7 @@ ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block $label$1 ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (local.get $var$0) @@ -2374,24 +2466,28 @@ (i64.eqz (local.get $var$0) ) - (block $label$0 (result i64) - (local.get $var$1) + (then + (block $label$0 (result i64) + (local.get $var$1) + ) ) - (block $label$1 (result i64) - (call $call-unreach - (i64.sub - (local.get $var$0) - (i64.const 1) - ) - (i64.mul - (block $block (result i64) - (local.set $2 - (local.get $var$0) + (else + (block $label$1 (result i64) + (call $call-unreach + (i64.sub + (local.get $var$0) + (i64.const 1) + ) + (i64.mul + (block $block (result i64) + (local.set $2 + (local.get $var$0) + ) + (nop) + (local.get $2) ) - (nop) - (local.get $2) + (unreachable) ) - (unreachable) ) ) ) @@ -2564,11 +2660,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 6) - ;; CHECK-NEXT: (local.set $13 - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $13 + ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $13 - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $13 + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $14 @@ -2625,11 +2725,15 @@ ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (i32.const 13) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (i32.const 13) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $18 @@ -2647,11 +2751,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: (local.set $20 - ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $20 + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $20 - ;; CHECK-NEXT: (i32.const 13) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $20 + ;; CHECK-NEXT: (i32.const 13) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $21 @@ -2669,11 +2777,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: (local.set $23 - ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $23 + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $23 - ;; CHECK-NEXT: (i32.const 13) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $23 + ;; CHECK-NEXT: (i32.const 13) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $24 @@ -2691,11 +2803,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: (local.set $26 - ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $26 + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $26 - ;; CHECK-NEXT: (i32.const 13) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $26 + ;; CHECK-NEXT: (i32.const 13) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $27 @@ -2703,11 +2819,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 15) - ;; CHECK-NEXT: (local.set $28 - ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $28 + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $28 - ;; CHECK-NEXT: (i32.const 17) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $28 + ;; CHECK-NEXT: (i32.const 17) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $29 @@ -2744,11 +2864,15 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 5) - ;; CHECK-NEXT: (local.set $31 - ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $31 + ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $31 - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $31 + ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $32 @@ -2756,17 +2880,23 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $32) - ;; CHECK-NEXT: (local.set $35 - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $35 + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: (local.set $33 - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $33 + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $33 - ;; CHECK-NEXT: (i32.const 11) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $33 + ;; CHECK-NEXT: (i32.const 11) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $34 @@ -2838,8 +2968,12 @@ (drop (i32.add (i32.const 1) (if (result i32) (i32.const 6) - (i32.const 7) - (i32.const 8) + (then + (i32.const 7) + ) + (else + (i32.const 8) + ) ) )) (drop @@ -2874,8 +3008,12 @@ (select (if (result i32) (i32.const 11) - (i32.const 12) - (i32.const 13) + (then + (i32.const 12) + ) + (else + (i32.const 13) + ) ) (i32.const 9) (i32.const 10) @@ -2886,8 +3024,12 @@ (i32.const 9) (if (result i32) (i32.const 11) - (i32.const 12) - (i32.const 13) + (then + (i32.const 12) + ) + (else + (i32.const 13) + ) ) (i32.const 10) ) @@ -2898,8 +3040,12 @@ (i32.const 10) (if (result i32) (i32.const 11) - (i32.const 12) - (i32.const 13) + (then + (i32.const 12) + ) + (else + (i32.const 13) + ) ) ) ) @@ -2907,14 +3053,22 @@ (select (if (result i32) (i32.const 11) - (i32.const 12) - (i32.const 13) + (then + (i32.const 12) + ) + (else + (i32.const 13) + ) ) (i32.const 14) (if (result i32) (i32.const 15) - (i32.const 16) - (i32.const 17) + (then + (i32.const 16) + ) + (else + (i32.const 17) + ) ) ) ) @@ -2924,14 +3078,26 @@ (if (result i32) (if (result i32) (i32.const 5) - (i32.const 6) - (i32.const 7) + (then + (i32.const 6) + ) + (else + (i32.const 7) + ) ) - (i32.const 8) - (if (result i32) - (i32.const 9) - (i32.const 10) - (i32.const 11) + (then + (i32.const 8) + ) + (else + (if (result i32) + (i32.const 9) + (then + (i32.const 10) + ) + (else + (i32.const 11) + ) + ) ) ) ) @@ -3012,7 +3178,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $label$78 ;; CHECK-NEXT: (local.set $430 ;; CHECK-NEXT: (i32.const 0) @@ -3025,7 +3191,7 @@ ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block $label$79 ;; CHECK-NEXT: (local.set $10 ;; CHECK-NEXT: (local.get $9) @@ -3113,35 +3279,39 @@ (local.get $12) (i32.const 65535) ) - (block - (block $label$78 - (local.set $430 - (i32.const 0) + (then + (block + (block $label$78 + (local.set $430 + (i32.const 0) + ) + ) + (local.set $432 + (local.get $430) ) - ) - (local.set $432 - (local.get $430) ) ) - (block - (block $label$79 - (local.set $431 - (i32.lt_u - (local.get $9) - (i32.load16_u offset=2 - (i32.add - (local.get $5) - (i32.mul - (local.get $12) - (i32.const 12) + (else + (block + (block $label$79 + (local.set $431 + (i32.lt_u + (local.get $9) + (i32.load16_u offset=2 + (i32.add + (local.get $5) + (i32.mul + (local.get $12) + (i32.const 12) + ) ) ) ) ) ) - ) - (local.set $432 - (local.get $431) + (local.set $432 + (local.get $431) + ) ) ) ) diff --git a/test/lit/passes/flatten_dfo_O3_enable-threads.wast b/test/lit/passes/flatten_dfo_O3_enable-threads.wast index ccb029060..34142b73f 100644 --- a/test/lit/passes/flatten_dfo_O3_enable-threads.wast +++ b/test/lit/passes/flatten_dfo_O3_enable-threads.wast @@ -67,39 +67,43 @@ (nop) (if (i32.const 0) - (i32.store8 - (i32.const 8) - (block $label$2 (result i32) - (drop - (br_if $label$2 - (i32.const 1) - (i32.const 0) - ) - ) - (if - (i32.const 0) + (then + (i32.store8 + (i32.const 8) + (block $label$2 (result i32) (drop (br_if $label$2 (i32.const 1) - (i32.const 1) + (i32.const 0) ) ) - ) - (block $label$4 - (br_if $label$4 - (i32.const 0) - ) - (br_if $label$4 + (if (i32.const 0) + (then + (drop + (br_if $label$2 + (i32.const 1) + (i32.const 1) + ) + ) + ) ) - (drop - (br_if $label$2 - (i32.const 1) + (block $label$4 + (br_if $label$4 + (i32.const 0) + ) + (br_if $label$4 (i32.const 0) ) + (drop + (br_if $label$2 + (i32.const 1) + (i32.const 0) + ) + ) ) + (i32.const 6704) ) - (i32.const 6704) ) ) ) @@ -121,44 +125,58 @@ (i32.wrap_i64 (if (result i64) (i32.const 0) - (i64.const 1) - (if (result i64) - (if (result i32) - (i32.const 0) - (unreachable) - (block $label$6 (result i32) - (block $label$7 - (loop $label$8 - (br_if $label$8 - (br_if $label$6 - (local.tee $var$2 - (block $label$9 (result i32) - (local.get $var$1) + (then + (i64.const 1) + ) + (else + (if (result i64) + (if (result i32) + (i32.const 0) + (then + (unreachable) + ) + (else + (block $label$6 (result i32) + (block $label$7 + (loop $label$8 + (br_if $label$8 + (br_if $label$6 + (local.tee $var$2 + (block $label$9 (result i32) + (local.get $var$1) + ) + ) + (i32.const 0) ) ) - (i32.const 0) - ) - ) - (loop $label$10 - (if - (i32.const 0) - (local.set $var$2 - (local.get $var$1) + (loop $label$10 + (if + (i32.const 0) + (then + (local.set $var$2 + (local.get $var$1) + ) + ) + ) + ) + (drop + (i32.eqz + (local.get $var$2) + ) ) ) ) - (drop - (i32.eqz - (local.get $var$2) - ) - ) + (unreachable) ) ) + ) + (then (unreachable) ) + (else + (i64.const 1) + ) ) - (unreachable) - (i64.const 1) ) ) ) @@ -180,27 +198,31 @@ (local.set $var$4 (if (result i32) (i32.const 0) - (block (result i32) - (local.set $var$4 - (local.tee $var$2 - (i32.xor - (i32.const 0) - (i32.const -1) + (then + (block (result i32) + (local.set $var$4 + (local.tee $var$2 + (i32.xor + (i32.const 0) + (i32.const -1) + ) ) ) + (i32.const 0) ) - (i32.const 0) ) - (block (result i32) - (local.set $var$4 - (local.tee $var$2 - (i32.xor - (i32.const 0) - (i32.const -1) + (else + (block (result i32) + (local.set $var$4 + (local.tee $var$2 + (i32.xor + (i32.const 0) + (i32.const -1) + ) ) ) + (i32.const 0) ) - (i32.const 0) ) ) ) @@ -230,14 +252,18 @@ (local.get $var$1) ) ) - (if - (local.get $var$2) - (i64.atomic.store32 offset=3 - (i32.and - (local.get $var$1) ;; only dfo can figure out that this is 0 - (i32.const 15) + (then + (if + (local.get $var$2) + (then + (i64.atomic.store32 offset=3 + (i32.and + (local.get $var$1) ;; only dfo can figure out that this is 0 + (i32.const 15) + ) + (i64.const -32768) + ) ) - (i64.const -32768) ) ) ) @@ -253,14 +279,18 @@ (local.tee $0 (i32.const 1) ) - (loop $label$2 (result i32) - (select - (i32.const 1) - (i32.const -1709605511) - (local.get $0) + (then + (loop $label$2 (result i32) + (select + (i32.const 1) + (i32.const -1709605511) + (local.get $0) + ) ) ) - (unreachable) + (else + (unreachable) + ) ) ) ) diff --git a/test/lit/passes/flatten_i64-to-i32-lowering.wast b/test/lit/passes/flatten_i64-to-i32-lowering.wast index 16ebaf882..d2fc16a58 100644 --- a/test/lit/passes/flatten_i64-to-i32-lowering.wast +++ b/test/lit/passes/flatten_i64-to-i32-lowering.wast @@ -62,10 +62,12 @@ ;; CHECK-NEXT: (local.get $i64toi32_i32$4) ;; CHECK-NEXT: (local.get $i64toi32_i32$3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $i64toi32_i32$5 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $i64toi32_i32$5) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $i64toi32_i32$5 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $i64toi32_i32$5) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/flatten_rereloop.wast b/test/lit/passes/flatten_rereloop.wast index 17a8e8125..07230ca47 100644 --- a/test/lit/passes/flatten_rereloop.wast +++ b/test/lit/passes/flatten_rereloop.wast @@ -29,19 +29,23 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (f64.const -nan:0xfffffd63e4e5a) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (f64.const -nan:0xfffffd63e4e5a) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -50,8 +54,10 @@ (func $0 (result f64) (if (i32.const 0) - (loop $label$2 - (unreachable) + (then + (loop $label$2 + (unreachable) + ) ) ) (f64.const -nan:0xfffffd63e4e5a) @@ -302,25 +308,29 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (f32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (f32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -329,7 +339,9 @@ (func $skipping (param $0 i32) (result f32) (if (i32.const 0) - (unreachable) + (then + (unreachable) + ) ) ;; branches joining here lead to skip opportunities (loop $label$2 (result f32) (f32.const 1) @@ -346,7 +358,9 @@ (func $merging (if (i32.const 0) - (return) + (then + (return) + ) ;; no else, but the else ends up with a return too, and we can merge them ) ) @@ -377,15 +391,19 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (global.set $global - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$3$break) + ;; CHECK-NEXT: (global.set $global + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$3$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $block$3$break) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $block$3$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block @@ -395,8 +413,10 @@ (func $skip-only-empty (if (i32.const 1) - (global.set $global - (i32.const 0) + (then + (global.set $global + (i32.const 0) + ) ) ) ) @@ -412,19 +432,23 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -436,7 +460,9 @@ ) (if (i32.const 1) - (unreachable) ;; blocks a path through + (then + (unreachable) ;; blocks a path through + ) ) (i32.const 0) ) @@ -451,28 +477,32 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (f32.const 9223372036854775808) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (f32.const 9223372036854775808) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$6$break) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$6$break) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (f32.const 65505) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$6$break) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (f32.const 65505) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$6$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -491,15 +521,19 @@ (func $multipass-for-skips (result f32) (if (result f32) (i32.const 0) - (block (result f32) - (block $label$2 - (br_if $label$2 - (i32.const 536870912) + (then + (block (result f32) + (block $label$2 + (br_if $label$2 + (i32.const 536870912) + ) ) + (f32.const 9223372036854775808) ) - (f32.const 9223372036854775808) ) - (f32.const 65505) + (else + (f32.const 65505) + ) ) ) ;; CHECK: (func $branch-merge-vs-replace @@ -508,18 +542,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $branch-merge-vs-replace (if (i32.const 0) - (unreachable) + (then + (unreachable) + ) ) ) ;; CHECK: (func $unswitch-amount @@ -529,29 +569,33 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const -23) - ;; CHECK-NEXT: (br $block$2$break) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $block$5$break - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $switch$4$leave - ;; CHECK-NEXT: (block $switch$4$default - ;; CHECK-NEXT: (block $switch$4$case$2 - ;; CHECK-NEXT: (br_table $switch$4$case$2 $switch$4$default - ;; CHECK-NEXT: (i32.const 44064) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $block$2$break) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block $block$5$break + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block $switch$4$leave + ;; CHECK-NEXT: (block $switch$4$default + ;; CHECK-NEXT: (block $switch$4$case$2 + ;; CHECK-NEXT: (br_table $switch$4$case$2 $switch$4$default + ;; CHECK-NEXT: (i32.const 44064) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$2$break) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$2$break) + ;; CHECK-NEXT: (br $block$5$break) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$5$break) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -564,14 +608,18 @@ (block $label$1 (if (i32.const -23) - (nop) - (block - (block $label$4 - (br_table $label$1 $label$4 - (i32.const 44064) + (then + (nop) + ) + (else + (block + (block $label$4 + (br_table $label$1 $label$4 + (i32.const 44064) + ) ) + (unreachable) ) - (unreachable) ) ) ) @@ -665,54 +713,66 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -732,28 +792,34 @@ ) (if (local.get $1) - (block + (then (block - (local.set $2 - (local.get $x) - ) - (if - (local.get $2) - (block - (return - (i32.const 2) - ) - (unreachable) + (block + (local.set $2 + (local.get $x) ) - (block - (return - (i32.const 3) + (if + (local.get $2) + (then + (block + (return + (i32.const 2) + ) + (unreachable) + ) + ) + (else + (block + (return + (i32.const 3) + ) + (unreachable) + ) ) - (unreachable) ) ) + (unreachable) ) - (unreachable) ) ) ) @@ -764,11 +830,13 @@ ) (if (local.get $3) - (block - (return - (i32.const 4) + (then + (block + (return + (i32.const 4) + ) + (unreachable) ) - (unreachable) ) ) ) @@ -810,13 +878,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (loop $shape$2$continue - ;; CHECK-NEXT: (call $trivial) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $shape$2$continue) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $shape$2$continue + ;; CHECK-NEXT: (call $trivial) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $shape$2$continue) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $block$17$break) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $block$17$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block @@ -836,8 +908,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (br $shape$4$continue) - ;; CHECK-NEXT: (br $block$19$break) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $shape$4$continue) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $block$19$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -858,8 +934,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (br $shape$6$continue) - ;; CHECK-NEXT: (br $block$26$break) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $shape$6$continue) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $block$26$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -880,17 +960,19 @@ ) (if (local.get $1) - (block - (loop $top - (block - (call $trivial) - (nop) - (br $top) + (then + (block + (loop $top + (block + (call $trivial) + (nop) + (br $top) + (unreachable) + ) (unreachable) ) (unreachable) ) - (unreachable) ) ) ) @@ -920,9 +1002,11 @@ ) (if (local.get $3) - (block - (br $top3) - (unreachable) + (then + (block + (br $top3) + (unreachable) + ) ) ) ) @@ -981,19 +1065,23 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (br $block$2$break) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $block$30$break - ;; CHECK-NEXT: (call $unreachable - ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $block$2$break) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block $block$30$break + ;; CHECK-NEXT: (call $unreachable + ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$30$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$30$break) + ;; CHECK-NEXT: (return) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (return) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1011,20 +1099,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $unreachable - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (call $unreachable + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $unreachable - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (call $unreachable + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (return) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1040,46 +1132,52 @@ ) (if (local.get $1) - (block + (then (block - (local.set $2 - (local.get $x) - ) - (if - (local.get $2) - (block - (block $block - (call $unreachable - (i32.const 1) - ) - (nop) - (unreachable) - (unreachable) - (call $unreachable - (i32.const 2) - ) - (nop) - ) - (unreachable) + (block + (local.set $2 + (local.get $x) ) - (block - (block $block4 - (call $unreachable - (i32.const 3) + (if + (local.get $2) + (then + (block + (block $block + (call $unreachable + (i32.const 1) + ) + (nop) + (unreachable) + (unreachable) + (call $unreachable + (i32.const 2) + ) + (nop) + ) + (unreachable) ) - (nop) - (return) - (unreachable) - (call $unreachable - (i32.const 4) + ) + (else + (block + (block $block4 + (call $unreachable + (i32.const 3) + ) + (nop) + (return) + (unreachable) + (call $unreachable + (i32.const 4) + ) + (nop) + ) + (unreachable) ) - (nop) ) - (unreachable) ) ) + (unreachable) ) - (unreachable) ) ) ) @@ -1171,13 +1269,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (br $block$3$break) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $before-and-after - ;; CHECK-NEXT: (i32.const 5) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $block$3$break) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$3$break) + ;; CHECK-NEXT: (call $before-and-after + ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$3$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1220,8 +1322,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (br $shape$4$continue) - ;; CHECK-NEXT: (br $block$8$break) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $shape$4$continue) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $block$8$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1246,15 +1352,19 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $before-and-after - ;; CHECK-NEXT: (i32.const 12) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$10$break) + ;; CHECK-NEXT: (call $before-and-after + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$10$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $block$10$break) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $block$10$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block @@ -1275,20 +1385,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $13) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $before-and-after - ;; CHECK-NEXT: (i32.const 14) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$13$break) + ;; CHECK-NEXT: (call $before-and-after + ;; CHECK-NEXT: (i32.const 14) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$13$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $before-and-after - ;; CHECK-NEXT: (i32.const 15) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$13$break) + ;; CHECK-NEXT: (call $before-and-after + ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$13$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1308,15 +1422,19 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $before-and-after - ;; CHECK-NEXT: (i32.const 16) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$16$break) + ;; CHECK-NEXT: (call $before-and-after + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$16$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $block$16$break) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $block$16$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block @@ -1472,11 +1590,13 @@ ) (if (local.get $3) - (block - (call $before-and-after - (i32.const 12) + (then + (block + (call $before-and-after + (i32.const 12) + ) + (nop) ) - (nop) ) ) ) @@ -1491,17 +1611,21 @@ ) (if (local.get $4) - (block - (call $before-and-after - (i32.const 14) + (then + (block + (call $before-and-after + (i32.const 14) + ) + (nop) ) - (nop) ) - (block - (call $before-and-after - (i32.const 15) + (else + (block + (call $before-and-after + (i32.const 15) + ) + (nop) ) - (nop) ) ) ) @@ -1512,14 +1636,16 @@ ) (if (local.get $5) - (block - (block $block8 - (call $before-and-after - (i32.const 16) + (then + (block + (block $block8 + (call $before-and-after + (i32.const 16) + ) + (nop) ) (nop) ) - (nop) ) ) ) @@ -1703,20 +1829,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$4$break) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$4$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$4$break) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$4$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1728,17 +1858,21 @@ (func $no-return (; 11 ;) (type $0) (if (i32.const 1) - (block - (drop - (i32.const 2) + (then + (block + (drop + (i32.const 2) + ) + (nop) ) - (nop) ) - (block - (drop - (i32.const 3) + (else + (block + (drop + (i32.const 3) + ) + (nop) ) - (nop) ) ) (nop) @@ -1769,31 +1903,39 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $if-br-wat - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br $block$12$break) + ;; CHECK-NEXT: (call $if-br-wat + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (br $block$12$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $block$2$break) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $block$12$break) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (br $block$2$break) - ;; CHECK-NEXT: (br $block$12$break) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1830,26 +1972,32 @@ ) (if (local.get $1) - (block - (call $if-br-wat - (i32.const 1) + (then + (block + (call $if-br-wat + (i32.const 1) + ) + (nop) ) - (nop) ) - (block + (else (block - (local.set $2 - (local.get $x) - ) - (if - (local.get $2) - (block - (br $label$2) - (unreachable) + (block + (local.set $2 + (local.get $x) + ) + (if + (local.get $2) + (then + (block + (br $label$2) + (unreachable) + ) + ) ) ) + (nop) ) - (nop) ) ) ) diff --git a/test/lit/passes/flatten_simplify-locals-nonesting_dfo_O3.wast b/test/lit/passes/flatten_simplify-locals-nonesting_dfo_O3.wast index 011ea86e9..4f1aa8ec3 100644 --- a/test/lit/passes/flatten_simplify-locals-nonesting_dfo_O3.wast +++ b/test/lit/passes/flatten_simplify-locals-nonesting_dfo_O3.wast @@ -38,8 +38,12 @@ (i32.const 1) (local.get $var$0) ) - (i32.const -2405046) - (i32.const 1) + (then + (i32.const -2405046) + ) + (else + (i32.const 1) + ) ) ) ) @@ -51,7 +55,9 @@ (i32.eqz (i32.const 0) ) - (unreachable) + (then + (unreachable) + ) ) (f64.const -9223372036854775808) ) @@ -63,22 +69,28 @@ (block $label$2 (if (i32.const 1) - (block - (drop - (loop $label$5 (result i64) - (if (result i64) - (i32.const 0) - (i64.load offset=22 - (i32.and - (br_if $label$1 - (i32.const 0) - (i32.const 0) + (then + (block + (drop + (loop $label$5 (result i64) + (if (result i64) + (i32.const 0) + (then + (i64.load offset=22 + (i32.and + (br_if $label$1 + (i32.const 0) + (i32.const 0) + ) + (i32.const 15) + ) + (i64.const 1) ) - (i32.const 15) ) - (i64.const 1) + (else + (i64.const 1) + ) ) - (i64.const 1) ) ) ) @@ -102,8 +114,12 @@ (i32.eqz (if (result i32) (i32.const 0) - (i32.const 0) - (local.get $var$2) + (then + (i32.const 0) + ) + (else + (local.get $var$2) + ) ) ) ) @@ -122,7 +138,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const -2147483648) ;; CHECK-NEXT: ) @@ -149,15 +165,17 @@ (i32.eqz (local.get $var$4) ) - (block - (local.set $var$4 - (select - (local.get $var$3) - (i32.const -2147483648) - (local.get $var$2) + (then + (block + (local.set $var$4 + (select + (local.get $var$3) + (i32.const -2147483648) + (local.get $var$2) + ) ) + (br $label$1) ) - (br $label$1) ) ) ) diff --git a/test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast b/test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast index ea693d502..76b4e6e51 100644 --- a/test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast +++ b/test/lit/passes/flatten_simplify-locals-nonesting_souperify-single-use_enable-threads.wast @@ -143,7 +143,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -180,7 +180,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -197,28 +197,32 @@ (local.get $x) (local.get $y) ) - (block - (local.set $i - (i64.eq - (local.get $a) - (local.get $x) + (then + (block + (local.set $i + (i64.eq + (local.get $a) + (local.get $x) + ) ) - ) - (local.set $j - (i64.ne - (local.get $a) - (local.get $y) + (local.set $j + (i64.ne + (local.get $a) + (local.get $y) + ) ) - ) - (local.set $r - (i32.and - (local.get $i) - (local.get $j) + (local.set $r + (i32.and + (local.get $i) + (local.get $j) + ) ) + (return (local.get $r)) ) - (return (local.get $r)) ) - (unreachable) + (else + (unreachable) + ) ) ) ;; Figure 3, simplified to an if @@ -244,7 +248,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -254,7 +258,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -289,16 +293,20 @@ (local.get $x) (i32.const 1) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 1) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 1) + ) ) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 2) + (else + (local.set $x + (i32.add + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -377,7 +385,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -392,10 +400,12 @@ (func $various-conditions-1 (param $x i32) (if (local.get $x) - (local.set $x - (i32.add - (local.get $x) - (i32.const 1) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 1) + ) ) ) ) @@ -414,7 +424,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -432,10 +442,12 @@ (local.get $x) (i32.const 0) ) - (local.set $x - (i32.sub - (local.get $x) - (i32.const 2) + (then + (local.set $x + (i32.sub + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -451,7 +463,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -466,10 +478,12 @@ (func $various-conditions-3 (param $x i32) (if (i32.reinterpret_f32 (f32.const 0)) - (local.set $x - (i32.sub - (local.get $x) - (i32.const 4) + (then + (local.set $x + (i32.sub + (local.get $x) + (i32.const 4) + ) ) ) ) @@ -481,7 +495,7 @@ ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -498,10 +512,12 @@ (func $various-conditions-4 (param $x i32) (if (unreachable) - (local.set $x - (i32.add - (local.get $x) - (i32.const 3) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 3) + ) ) ) ) @@ -525,7 +541,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (i32.ctz @@ -565,18 +581,20 @@ (i32.eqz (local.get $x) ) - (local.set $x - (i32.add - (i32.ctz - (local.get $y) - ) - (i32.sub - (i32.clz - (local.get $x) - ) - (i32.popcnt + (then + (local.set $x + (i32.add + (i32.ctz (local.get $y) ) + (i32.sub + (i32.clz + (local.get $x) + ) + (i32.popcnt + (local.get $y) + ) + ) ) ) ) @@ -602,7 +620,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -622,10 +640,12 @@ (i32.const 1) ) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 2) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -650,7 +670,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -670,10 +690,12 @@ (i32.const 1) ) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 2) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -700,7 +722,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -710,7 +732,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -745,16 +767,20 @@ (local.get $x) (i32.const 1) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 1) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 1) + ) ) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 2) + (else + (local.set $x + (i32.add + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -818,7 +844,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.load @@ -826,18 +852,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -850,13 +882,21 @@ (if (result i32) (if (result i32) (i32.const 1) - (i32.load + (then + (i32.load + (i32.const 0) + ) + ) + (else (i32.const 0) ) + ) + (then (i32.const 0) ) - (i32.const 0) - (i32.const 1) + (else + (i32.const 1) + ) ) ) ;; CHECK: (func $bad-phi-value-2 (param $x i32) (result i32) @@ -870,7 +910,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.load @@ -878,18 +918,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -905,13 +951,21 @@ (if (if (result i32) (i32.const 1) - (i32.load + (then + (i32.load + (i32.const 0) + ) + ) + (else (i32.const 0) ) - (i32.const 0) ) - (local.set $x (i32.const 1)) - (local.set $x (i32.const 2)) + (then + (local.set $x (i32.const 1)) + ) + (else + (local.set $x (i32.const 2)) + ) ) (local.get $x) ) @@ -1123,8 +1177,10 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -1139,8 +1195,10 @@ (local $x f64) (if (i32.const 0) - (local.set $x - (f64.const 1) + (then + (local.set $x + (f64.const 1) + ) ) ) (local.get $x) @@ -1153,11 +1211,15 @@ ;; CHECK-NEXT: (block $label$1 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -1172,8 +1234,12 @@ (block $label$1 (result f64) (if (result f64) (i32.const 0) - (f64.const 0) - (f64.const 1) + (then + (f64.const 0) + ) + (else + (f64.const 1) + ) ) ) ) @@ -1203,7 +1269,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -1214,7 +1280,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -1242,16 +1308,20 @@ (local.get $x) (local.get $y) ) - (local.set $i - (i32.eq - (local.get $x) - (local.get $y) + (then + (local.set $i + (i32.eq + (local.get $x) + (local.get $y) + ) ) ) - (local.set $i - (i32.add - (local.get $x) - (local.get $y) + (else + (local.set $i + (i32.add + (local.get $x) + (local.get $y) + ) ) ) ) @@ -1321,7 +1391,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -1334,8 +1404,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1353,14 +1425,18 @@ (func $in-unreachable-1 (param $x i32) (param $y i32) (result i32) (if (local.get $x) - (block - (local.set $x - (i32.const 1) + (then + (block + (local.set $x + (i32.const 1) + ) + (return (local.get $x)) ) - (return (local.get $x)) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; no phi here! @@ -1378,7 +1454,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -1388,8 +1464,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1407,14 +1485,18 @@ (func $in-unreachable-2 (param $x i32) (param $y i32) (result i32) (if (local.get $x) - (block - (local.set $x - (i32.const 1) + (then + (block + (local.set $x + (i32.const 1) + ) + (unreachable) ) - (unreachable) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; no phi here! @@ -1434,7 +1516,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -1444,8 +1526,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1470,14 +1554,18 @@ (block $out (if (local.get $x) - (block - (local.set $x - (i32.const 1) + (then + (block + (local.set $x + (i32.const 1) + ) + (br $out) ) - (br $out) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; no phi here! @@ -1501,7 +1589,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -1513,8 +1601,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1539,14 +1629,18 @@ (block $out (if (local.get $x) - (block - (local.set $x - (i32.const 1) + (then + (block + (local.set $x + (i32.const 1) + ) + (br_table $out $out $out (i32.const 1)) ) - (br_table $out $out $out (i32.const 1)) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; no phi here! @@ -1571,7 +1665,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -1580,8 +1674,10 @@ ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1606,16 +1702,20 @@ (block $out (if (local.get $x) - (block - (local.set $x - (i32.const 1) - ) - (br_if $out - (local.get $x) + (then + (block + (local.set $x + (i32.const 1) + ) + (br_if $out + (local.get $x) + ) ) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; there *IS* a phi here since it was a br_if @@ -1639,12 +1739,12 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const -8531) @@ -1654,7 +1754,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const -8531) @@ -1703,19 +1803,25 @@ (block $label$3 (if (local.get $2) - (if - (local.get $0) - (block - (local.set $1 - (i32.const -8531) + (then + (if + (local.get $0) + (then + (block + (local.set $1 + (i32.const -8531) + ) + (br $label$3) + ) ) - (br $label$3) - ) - (block - (local.set $1 - (i32.const -8531) + (else + (block + (local.set $1 + (i32.const -8531) + ) + (br $label$1) + ) ) - (br $label$1) ) ) ) @@ -1749,11 +1855,15 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1770,11 +1880,15 @@ (unreachable) (if (local.get $x) - (local.set $x - (i32.const 1) + (then + (local.set $x + (i32.const 1) + ) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) (return @@ -2215,7 +2329,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (i64.eqz @@ -2224,7 +2338,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -2235,7 +2349,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -2248,7 +2362,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $15 ;; CHECK-NEXT: (i64.eqz @@ -2257,7 +2371,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -2268,7 +2382,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -2300,37 +2414,49 @@ (local.get $x) (local.get $y) ) - (if - (i64.eqz - (local.get $x) - ) - (local.set $t - (i64.add + (then + (if + (i64.eqz (local.get $x) - (local.get $y) ) - ) - (local.set $t - (i64.sub - (local.get $x) - (local.get $y) + (then + (local.set $t + (i64.add + (local.get $x) + (local.get $y) + ) + ) + ) + (else + (local.set $t + (i64.sub + (local.get $x) + (local.get $y) + ) + ) ) ) ) - (if - (i64.eqz - (local.get $y) - ) - (local.set $t - (i64.mul - (local.get $x) + (else + (if + (i64.eqz (local.get $y) ) - ) - (local.set $t - (i64.div_s - (local.get $x) - (local.get $y) + (then + (local.set $t + (i64.mul + (local.get $x) + (local.get $y) + ) + ) + ) + (else + (local.set $t + (i64.div_s + (local.get $x) + (local.get $y) + ) + ) ) ) ) @@ -3376,14 +3502,14 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (loop $label$2 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block $label$3 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -3396,7 +3522,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -3423,23 +3549,29 @@ (func $bad-phi-type (param $var$0 i64) (param $var$1 i64) (param $var$2 i32) (param $var$3 f32) (if (local.get $var$2) - (drop - (loop $label$2 (result f64) - (if - (block $label$3 (result i32) - (if + (then + (drop + (loop $label$2 (result f64) + (if + (block $label$3 (result i32) + (if + (i32.const 0) + (then + (unreachable) + ) + ) + (nop) (i32.const 0) + ) + (then (unreachable) ) - (nop) - (i32.const 0) ) - (unreachable) - ) - (br_if $label$2 - (local.get $var$2) + (br_if $label$2 + (local.get $var$2) + ) + (f64.const 0) ) - (f64.const 0) ) ) ) @@ -3466,7 +3598,7 @@ ;; CHECK-NEXT: (block $label$4 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1337) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -3532,7 +3664,9 @@ (block $label$4 (result i32) (if (i32.const 1337) - (unreachable) + (then + (unreachable) + ) ) (local.get $var$0) ) @@ -3594,11 +3728,11 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (loop $label$3 @@ -3624,7 +3758,9 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -3658,22 +3794,28 @@ (i32.const 0) ) ) - (unreachable) - (block (result f32) - (if - (loop $label$3 (result i32) - (block $label$4 (result i32) - (i32.clz - (br_if $label$4 - (local.get $var$0) - (i32.const 1) + (then + (unreachable) + ) + (else + (block (result f32) + (if + (loop $label$3 (result i32) + (block $label$4 (result i32) + (i32.clz + (br_if $label$4 + (local.get $var$0) + (i32.const 1) + ) ) ) ) + (then + (nop) + ) ) - (nop) + (f32.const 1) ) - (f32.const 1) ) ) ) @@ -3852,54 +3994,56 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$0) - ;; CHECK-NEXT: (block $label$2 - ;; CHECK-NEXT: (block $label$3 - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $var$1 - ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $label$2 + ;; CHECK-NEXT: (block $label$3 + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.set $var$1 + ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $label$3 + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.const 12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$3 - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: (br_if $label$2 + ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$2 - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $13 - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.set $13 + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $13) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $13) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -3914,33 +4058,37 @@ (i32.const -7) ) ) - (block $label$2 - (block $label$3 - (local.set $var$1 - (local.get $var$0) - ) - (br_if $label$3 - (local.tee $var$3 - (i32.const 12) + (then + (block $label$2 + (block $label$3 + (local.set $var$1 + (local.get $var$0) ) + (br_if $label$3 + (local.tee $var$3 + (i32.const 12) + ) + ) + (unreachable) ) - (unreachable) - ) - (br_if $label$2 - (i32.eqz - (local.get $var$1) + (br_if $label$2 + (i32.eqz + (local.get $var$1) + ) ) - ) - (if - (i32.ne - (i32.load - (i32.const 0) + (if + (i32.ne + (i32.load + (i32.const 0) + ) + (local.get $var$0) + ) + (then + (unreachable) ) - (local.get $var$0) ) (unreachable) ) - (unreachable) ) ) ) @@ -4164,7 +4312,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -4189,7 +4337,9 @@ ) ) ) - (unreachable) + (then + (unreachable) + ) ) ) ;; CHECK: (func $zext-numGets-hasAnotherUse (param $var$0 i32) (param $var$1 i32) @@ -4247,7 +4397,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -4279,7 +4429,9 @@ (local.get $temp) ) ) - (unreachable) + (then + (unreachable) + ) ) ) ;; CHECK: (func $flipped-needs-right-origin (param $var$0 i32) (result i32) @@ -4320,7 +4472,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -4355,7 +4507,9 @@ (i32.const 4) ) ) - (unreachable) + (then + (unreachable) + ) ) (i32.const 5) ) @@ -4427,7 +4581,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $var$2 @@ -4457,14 +4611,16 @@ (loop $label$1 (if (i32.const 0) - (block - (local.set $var$2 - (i32.add - (i32.const 0) - (i32.const 1) + (then + (block + (local.set $var$2 + (i32.add + (i32.const 0) + (i32.const 1) + ) ) + (br $label$1) ) - (br $label$1) ) ) (local.set $var$3 @@ -4497,36 +4653,42 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (loop $label$2 - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $label$2 + ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $var$3 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $var$1 - ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.set $var$3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.set $var$1 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $var$3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $label$2 ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $var$3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$2 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$1) - ;; CHECK-NEXT: (local.set $var$3 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $var$3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -4565,28 +4727,34 @@ ) (if (i32.const 0) - (loop $label$2 - (if - (local.get $var$1) - (nop) - ) - (local.set $var$1 - (i32.sub - (i32.const 0) - (local.tee $var$3 - (i32.const 1) + (then + (loop $label$2 + (if + (local.get $var$1) + (then + (nop) ) ) - ) - (br_if $label$2 - (i32.const 0) + (local.set $var$1 + (i32.sub + (i32.const 0) + (local.tee $var$3 + (i32.const 1) + ) + ) + ) + (br_if $label$2 + (i32.const 0) + ) ) ) ) (if (local.get $var$1) - (local.set $var$3 - (i32.const 1) + (then + (local.set $var$3 + (i32.const 1) + ) ) ) (i32.store diff --git a/test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast b/test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast index e8d423058..5c11e34e3 100644 --- a/test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast +++ b/test/lit/passes/flatten_simplify-locals-nonesting_souperify_enable-threads.wast @@ -143,7 +143,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -180,7 +180,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -197,28 +197,32 @@ (local.get $x) (local.get $y) ) - (block - (local.set $i - (i64.eq - (local.get $a) - (local.get $x) + (then + (block + (local.set $i + (i64.eq + (local.get $a) + (local.get $x) + ) ) - ) - (local.set $j - (i64.ne - (local.get $a) - (local.get $y) + (local.set $j + (i64.ne + (local.get $a) + (local.get $y) + ) ) - ) - (local.set $r - (i32.and - (local.get $i) - (local.get $j) + (local.set $r + (i32.and + (local.get $i) + (local.get $j) + ) ) + (return (local.get $r)) ) - (return (local.get $r)) ) - (unreachable) + (else + (unreachable) + ) ) ) ;; Figure 3, simplified to an if @@ -244,7 +248,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -254,7 +258,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -289,16 +293,20 @@ (local.get $x) (i32.const 1) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 1) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 1) + ) ) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 2) + (else + (local.set $x + (i32.add + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -445,7 +453,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -460,10 +468,12 @@ (func $various-conditions-1 (param $x i32) (if (local.get $x) - (local.set $x - (i32.add - (local.get $x) - (i32.const 1) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 1) + ) ) ) ) @@ -482,7 +492,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -500,10 +510,12 @@ (local.get $x) (i32.const 0) ) - (local.set $x - (i32.sub - (local.get $x) - (i32.const 2) + (then + (local.set $x + (i32.sub + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -519,7 +531,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -534,10 +546,12 @@ (func $various-conditions-3 (param $x i32) (if (i32.reinterpret_f32 (f32.const 0)) - (local.set $x - (i32.sub - (local.get $x) - (i32.const 4) + (then + (local.set $x + (i32.sub + (local.get $x) + (i32.const 4) + ) ) ) ) @@ -549,7 +563,7 @@ ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -566,10 +580,12 @@ (func $various-conditions-4 (param $x i32) (if (unreachable) - (local.set $x - (i32.add - (local.get $x) - (i32.const 3) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 3) + ) ) ) ) @@ -593,7 +609,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (i32.ctz @@ -633,18 +649,20 @@ (i32.eqz (local.get $x) ) - (local.set $x - (i32.add - (i32.ctz - (local.get $y) - ) - (i32.sub - (i32.clz - (local.get $x) - ) - (i32.popcnt + (then + (local.set $x + (i32.add + (i32.ctz (local.get $y) ) + (i32.sub + (i32.clz + (local.get $x) + ) + (i32.popcnt + (local.get $y) + ) + ) ) ) ) @@ -670,7 +688,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -690,10 +708,12 @@ (i32.const 1) ) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 2) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -718,7 +738,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -738,10 +758,12 @@ (i32.const 1) ) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 2) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -768,7 +790,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -778,7 +800,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $x @@ -813,16 +835,20 @@ (local.get $x) (i32.const 1) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 1) + (then + (local.set $x + (i32.add + (local.get $x) + (i32.const 1) + ) ) ) - (local.set $x - (i32.add - (local.get $x) - (i32.const 2) + (else + (local.set $x + (i32.add + (local.get $x) + (i32.const 2) + ) ) ) ) @@ -886,7 +912,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.load @@ -894,18 +920,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -918,13 +950,21 @@ (if (result i32) (if (result i32) (i32.const 1) - (i32.load + (then + (i32.load + (i32.const 0) + ) + ) + (else (i32.const 0) ) + ) + (then (i32.const 0) ) - (i32.const 0) - (i32.const 1) + (else + (i32.const 1) + ) ) ) ;; CHECK: (func $bad-phi-value-2 (param $x i32) (result i32) @@ -938,7 +978,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.load @@ -946,18 +986,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -973,13 +1019,21 @@ (if (if (result i32) (i32.const 1) - (i32.load + (then + (i32.load + (i32.const 0) + ) + ) + (else (i32.const 0) ) - (i32.const 0) ) - (local.set $x (i32.const 1)) - (local.set $x (i32.const 2)) + (then + (local.set $x (i32.const 1)) + ) + (else + (local.set $x (i32.const 2)) + ) ) (local.get $x) ) @@ -1191,8 +1245,10 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -1207,8 +1263,10 @@ (local $x f64) (if (i32.const 0) - (local.set $x - (f64.const 1) + (then + (local.set $x + (f64.const 1) + ) ) ) (local.get $x) @@ -1221,11 +1279,15 @@ ;; CHECK-NEXT: (block $label$1 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -1240,8 +1302,12 @@ (block $label$1 (result f64) (if (result f64) (i32.const 0) - (f64.const 0) - (f64.const 1) + (then + (f64.const 0) + ) + (else + (f64.const 1) + ) ) ) ) @@ -1271,7 +1337,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -1282,7 +1348,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -1310,16 +1376,20 @@ (local.get $x) (local.get $y) ) - (local.set $i - (i32.eq - (local.get $x) - (local.get $y) + (then + (local.set $i + (i32.eq + (local.get $x) + (local.get $y) + ) ) ) - (local.set $i - (i32.add - (local.get $x) - (local.get $y) + (else + (local.set $i + (i32.add + (local.get $x) + (local.get $y) + ) ) ) ) @@ -1389,7 +1459,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -1402,8 +1472,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1421,14 +1493,18 @@ (func $in-unreachable-1 (param $x i32) (param $y i32) (result i32) (if (local.get $x) - (block - (local.set $x - (i32.const 1) + (then + (block + (local.set $x + (i32.const 1) + ) + (return (local.get $x)) ) - (return (local.get $x)) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; no phi here! @@ -1446,7 +1522,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -1456,8 +1532,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1475,14 +1553,18 @@ (func $in-unreachable-2 (param $x i32) (param $y i32) (result i32) (if (local.get $x) - (block - (local.set $x - (i32.const 1) + (then + (block + (local.set $x + (i32.const 1) + ) + (unreachable) ) - (unreachable) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; no phi here! @@ -1502,7 +1584,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -1512,8 +1594,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1538,14 +1622,18 @@ (block $out (if (local.get $x) - (block - (local.set $x - (i32.const 1) + (then + (block + (local.set $x + (i32.const 1) + ) + (br $out) ) - (br $out) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; no phi here! @@ -1569,7 +1657,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -1581,8 +1669,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1607,14 +1697,18 @@ (block $out (if (local.get $x) - (block - (local.set $x - (i32.const 1) + (then + (block + (local.set $x + (i32.const 1) + ) + (br_table $out $out $out (i32.const 1)) ) - (br_table $out $out $out (i32.const 1)) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; no phi here! @@ -1639,7 +1733,7 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -1648,8 +1742,10 @@ ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1674,16 +1770,20 @@ (block $out (if (local.get $x) - (block - (local.set $x - (i32.const 1) - ) - (br_if $out - (local.get $x) + (then + (block + (local.set $x + (i32.const 1) + ) + (br_if $out + (local.get $x) + ) ) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) ;; there *IS* a phi here since it was a br_if @@ -1707,12 +1807,12 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const -8531) @@ -1722,7 +1822,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.const -8531) @@ -1771,19 +1871,25 @@ (block $label$3 (if (local.get $2) - (if - (local.get $0) - (block - (local.set $1 - (i32.const -8531) + (then + (if + (local.get $0) + (then + (block + (local.set $1 + (i32.const -8531) + ) + (br $label$3) + ) ) - (br $label$3) - ) - (block - (local.set $1 - (i32.const -8531) + (else + (block + (local.set $1 + (i32.const -8531) + ) + (br $label$1) + ) ) - (br $label$1) ) ) ) @@ -1817,11 +1923,15 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1838,11 +1948,15 @@ (unreachable) (if (local.get $x) - (local.set $x - (i32.const 1) + (then + (local.set $x + (i32.const 1) + ) ) - (local.set $x - (i32.const 2) + (else + (local.set $x + (i32.const 2) + ) ) ) (return @@ -2283,7 +2397,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (i64.eqz @@ -2292,7 +2406,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -2303,7 +2417,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -2316,7 +2430,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $15 ;; CHECK-NEXT: (i64.eqz @@ -2325,7 +2439,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -2336,7 +2450,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -2368,37 +2482,49 @@ (local.get $x) (local.get $y) ) - (if - (i64.eqz - (local.get $x) - ) - (local.set $t - (i64.add + (then + (if + (i64.eqz (local.get $x) - (local.get $y) ) - ) - (local.set $t - (i64.sub - (local.get $x) - (local.get $y) + (then + (local.set $t + (i64.add + (local.get $x) + (local.get $y) + ) + ) + ) + (else + (local.set $t + (i64.sub + (local.get $x) + (local.get $y) + ) + ) ) ) ) - (if - (i64.eqz - (local.get $y) - ) - (local.set $t - (i64.mul - (local.get $x) + (else + (if + (i64.eqz (local.get $y) ) - ) - (local.set $t - (i64.div_s - (local.get $x) - (local.get $y) + (then + (local.set $t + (i64.mul + (local.get $x) + (local.get $y) + ) + ) + ) + (else + (local.set $t + (i64.div_s + (local.get $x) + (local.get $y) + ) + ) ) ) ) @@ -3444,14 +3570,14 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$2) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (loop $label$2 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block $label$3 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -3464,7 +3590,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -3491,23 +3617,29 @@ (func $bad-phi-type (param $var$0 i64) (param $var$1 i64) (param $var$2 i32) (param $var$3 f32) (if (local.get $var$2) - (drop - (loop $label$2 (result f64) - (if - (block $label$3 (result i32) - (if + (then + (drop + (loop $label$2 (result f64) + (if + (block $label$3 (result i32) + (if + (i32.const 0) + (then + (unreachable) + ) + ) + (nop) (i32.const 0) + ) + (then (unreachable) ) - (nop) - (i32.const 0) ) - (unreachable) - ) - (br_if $label$2 - (local.get $var$2) + (br_if $label$2 + (local.get $var$2) + ) + (f64.const 0) ) - (f64.const 0) ) ) ) @@ -3534,7 +3666,7 @@ ;; CHECK-NEXT: (block $label$4 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1337) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -3600,7 +3732,9 @@ (block $label$4 (result i32) (if (i32.const 1337) - (unreachable) + (then + (unreachable) + ) ) (local.get $var$0) ) @@ -3662,11 +3796,11 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block ;; CHECK-NEXT: (loop $label$3 @@ -3692,7 +3826,9 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) @@ -3726,22 +3862,28 @@ (i32.const 0) ) ) - (unreachable) - (block (result f32) - (if - (loop $label$3 (result i32) - (block $label$4 (result i32) - (i32.clz - (br_if $label$4 - (local.get $var$0) - (i32.const 1) + (then + (unreachable) + ) + (else + (block (result f32) + (if + (loop $label$3 (result i32) + (block $label$4 (result i32) + (i32.clz + (br_if $label$4 + (local.get $var$0) + (i32.const 1) + ) ) ) ) + (then + (nop) + ) ) - (nop) + (f32.const 1) ) - (f32.const 1) ) ) ) @@ -3920,54 +4062,56 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$0) - ;; CHECK-NEXT: (block $label$2 - ;; CHECK-NEXT: (block $label$3 - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $var$1 - ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $label$2 + ;; CHECK-NEXT: (block $label$3 + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.set $var$1 + ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $label$3 + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.const 12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$3 - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: (br_if $label$2 + ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$2 - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $13 - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.set $13 + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $var$0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $13) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $13) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -3982,33 +4126,37 @@ (i32.const -7) ) ) - (block $label$2 - (block $label$3 - (local.set $var$1 - (local.get $var$0) - ) - (br_if $label$3 - (local.tee $var$3 - (i32.const 12) + (then + (block $label$2 + (block $label$3 + (local.set $var$1 + (local.get $var$0) ) + (br_if $label$3 + (local.tee $var$3 + (i32.const 12) + ) + ) + (unreachable) ) - (unreachable) - ) - (br_if $label$2 - (i32.eqz - (local.get $var$1) + (br_if $label$2 + (i32.eqz + (local.get $var$1) + ) ) - ) - (if - (i32.ne - (i32.load - (i32.const 0) + (if + (i32.ne + (i32.load + (i32.const 0) + ) + (local.get $var$0) + ) + (then + (unreachable) ) - (local.get $var$0) ) (unreachable) ) - (unreachable) ) ) ) @@ -4232,7 +4380,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -4257,7 +4405,9 @@ ) ) ) - (unreachable) + (then + (unreachable) + ) ) ) ;; CHECK: (func $zext-numGets-hasAnotherUse (param $var$0 i32) (param $var$1 i32) @@ -4315,7 +4465,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -4347,7 +4497,9 @@ (local.get $temp) ) ) - (unreachable) + (then + (unreachable) + ) ) ) ;; CHECK: (func $flipped-needs-right-origin (param $var$0 i32) (result i32) @@ -4388,7 +4540,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -4423,7 +4575,9 @@ (i32.const 4) ) ) - (unreachable) + (then + (unreachable) + ) ) (i32.const 5) ) @@ -4495,7 +4649,7 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (local.set $var$2 @@ -4525,14 +4679,16 @@ (loop $label$1 (if (i32.const 0) - (block - (local.set $var$2 - (i32.add - (i32.const 0) - (i32.const 1) + (then + (block + (local.set $var$2 + (i32.add + (i32.const 0) + (i32.const 1) + ) ) + (br $label$1) ) - (br $label$1) ) ) (local.set $var$3 @@ -4565,36 +4721,42 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (loop $label$2 - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $label$2 + ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $var$1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $var$3 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (local.set $var$1 - ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.set $var$3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (local.set $var$1 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $var$3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $label$2 ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $var$3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$2 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $var$1) - ;; CHECK-NEXT: (local.set $var$3 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $var$3 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -4633,28 +4795,34 @@ ) (if (i32.const 0) - (loop $label$2 - (if - (local.get $var$1) - (nop) - ) - (local.set $var$1 - (i32.sub - (i32.const 0) - (local.tee $var$3 - (i32.const 1) + (then + (loop $label$2 + (if + (local.get $var$1) + (then + (nop) ) ) - ) - (br_if $label$2 - (i32.const 0) + (local.set $var$1 + (i32.sub + (i32.const 0) + (local.tee $var$3 + (i32.const 1) + ) + ) + ) + (br_if $label$2 + (i32.const 0) + ) ) ) ) (if (local.get $var$1) - (local.set $var$3 - (i32.const 1) + (then + (local.set $var$3 + (i32.const 1) + ) ) ) (i32.store diff --git a/test/lit/passes/global-effects.wast b/test/lit/passes/global-effects.wast index 066604679..00c9a77ff 100644 --- a/test/lit/passes/global-effects.wast +++ b/test/lit/passes/global-effects.wast @@ -330,8 +330,12 @@ ;; WITHOUT-NEXT: (do ;; WITHOUT-NEXT: (if ;; WITHOUT-NEXT: (local.get $x) - ;; WITHOUT-NEXT: (call $throw) - ;; WITHOUT-NEXT: (call $unreachable) + ;; WITHOUT-NEXT: (then + ;; WITHOUT-NEXT: (call $throw) + ;; WITHOUT-NEXT: ) + ;; WITHOUT-NEXT: (else + ;; WITHOUT-NEXT: (call $unreachable) + ;; WITHOUT-NEXT: ) ;; WITHOUT-NEXT: ) ;; WITHOUT-NEXT: ) ;; WITHOUT-NEXT: (catch_all @@ -344,8 +348,12 @@ ;; INCLUDE-NEXT: (do ;; INCLUDE-NEXT: (if ;; INCLUDE-NEXT: (local.get $x) - ;; INCLUDE-NEXT: (call $throw) - ;; INCLUDE-NEXT: (call $unreachable) + ;; INCLUDE-NEXT: (then + ;; INCLUDE-NEXT: (call $throw) + ;; INCLUDE-NEXT: ) + ;; INCLUDE-NEXT: (else + ;; INCLUDE-NEXT: (call $unreachable) + ;; INCLUDE-NEXT: ) ;; INCLUDE-NEXT: ) ;; INCLUDE-NEXT: ) ;; INCLUDE-NEXT: (catch_all @@ -358,8 +366,12 @@ ;; DISCARD-NEXT: (do ;; DISCARD-NEXT: (if ;; DISCARD-NEXT: (local.get $x) - ;; DISCARD-NEXT: (call $throw) - ;; DISCARD-NEXT: (call $unreachable) + ;; DISCARD-NEXT: (then + ;; DISCARD-NEXT: (call $throw) + ;; DISCARD-NEXT: ) + ;; DISCARD-NEXT: (else + ;; DISCARD-NEXT: (call $unreachable) + ;; DISCARD-NEXT: ) ;; DISCARD-NEXT: ) ;; DISCARD-NEXT: ) ;; DISCARD-NEXT: (catch_all @@ -374,8 +386,12 @@ (do (if (local.get $x) - (call $throw) - (call $unreachable) + (then + (call $throw) + ) + (else + (call $unreachable) + ) ) ) (catch_all) @@ -407,8 +423,12 @@ (func $throw-and-import (if (i32.const 1) - (throw $tag) - (call $import) + (then + (throw $tag) + ) + (else + (call $import) + ) ) ) diff --git a/test/lit/passes/gufa-refs.wast b/test/lit/passes/gufa-refs.wast index 6aa741eb1..6d997dfa5 100644 --- a/test/lit/passes/gufa-refs.wast +++ b/test/lit/passes/gufa-refs.wast @@ -1396,11 +1396,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.set $parent - ;; CHECK-NEXT: (local.tee $child - ;; CHECK-NEXT: (struct.new $child - ;; CHECK-NEXT: (i32.const 20) - ;; CHECK-NEXT: (i32.const 30) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $parent + ;; CHECK-NEXT: (local.tee $child + ;; CHECK-NEXT: (struct.new $child + ;; CHECK-NEXT: (i32.const 20) + ;; CHECK-NEXT: (i32.const 30) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1432,11 +1434,13 @@ ;; Another, optional, set to $parent. (if (local.get $x) - (local.set $parent - (local.tee $child - (struct.new $child - (i32.const 20) - (i32.const 30) + (then + (local.set $parent + (local.tee $child + (struct.new $child + (i32.const 20) + (i32.const 30) + ) ) ) ) @@ -3308,8 +3312,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.set $ref-null - ;; CHECK-NEXT: (local.get $ref) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $ref-null + ;; CHECK-NEXT: (local.get $ref) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -3330,8 +3336,10 @@ ) (if (local.get $x) - (local.set $ref-null - (local.get $ref) + (then + (local.set $ref-null + (local.get $ref) + ) ) ) ;; If the |if| executed they are equal, but otherwise not, so we can't diff --git a/test/lit/passes/gufa-ssa.wast b/test/lit/passes/gufa-ssa.wast index c97e30a62..355999f61 100644 --- a/test/lit/passes/gufa-ssa.wast +++ b/test/lit/passes/gufa-ssa.wast @@ -40,8 +40,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 30) - ;; CHECK-NEXT: (local.set $y - ;; CHECK-NEXT: (i32.const 50) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $y + ;; CHECK-NEXT: (i32.const 50) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -89,8 +91,10 @@ ) (if (local.get $x) - (local.set $y - (i32.const 50) + (then + (local.set $y + (i32.const 50) + ) ) ) ;; x is the same but y is no longer optimizable, since it might contain 50. diff --git a/test/lit/passes/gufa-tnh.wast b/test/lit/passes/gufa-tnh.wast index b3d5b122b..cb363c567 100644 --- a/test/lit/passes/gufa-tnh.wast +++ b/test/lit/passes/gufa-tnh.wast @@ -465,7 +465,9 @@ ;; CHECK-NEXT: (local $local (ref null $A)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (ref.cast (ref $B) @@ -478,7 +480,9 @@ ;; Control flow before the cast *does* stop us from optimizing. (if (i32.const 0) - (return) + (then + (return) + ) ) (drop (ref.cast (ref $B) @@ -689,7 +693,9 @@ ;; CHECK-NEXT: (block (result (ref $B)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (ref.cast (ref $B) ;; CHECK-NEXT: (local.get $any) @@ -717,7 +723,9 @@ (block (result (ref $A)) (if (i32.const 0) - (return) + (then + (return) + ) ) (ref.cast (ref $A) (local.get $any) @@ -788,7 +796,9 @@ ;; CHECK-NEXT: (block (result (ref $A)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (ref.cast (ref $A) ;; CHECK-NEXT: (local.get $any) @@ -814,7 +824,9 @@ (block (result (ref $A)) (if (i32.const 0) - (return) + (then + (return) + ) ) (ref.cast (ref $A) (local.get $any) @@ -976,9 +988,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if (result (ref $A)) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return) - ;; CHECK-NEXT: (ref.cast (ref $A) - ;; CHECK-NEXT: (local.get $any) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (ref.cast (ref $A) + ;; CHECK-NEXT: (local.get $any) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (ref.cast (ref $B) @@ -997,9 +1013,13 @@ ;; very last cast. (if (result (ref $A)) (i32.const 0) - (return) - (ref.cast (ref $A) - (local.get $any) + (then + (return) + ) + (else + (ref.cast (ref $A) + (local.get $any) + ) ) ) (ref.cast (ref $A) diff --git a/test/lit/passes/gufa-vs-cfp.wast b/test/lit/passes/gufa-vs-cfp.wast index eb365c5d1..eb95c6bed 100644 --- a/test/lit/passes/gufa-vs-cfp.wast +++ b/test/lit/passes/gufa-vs-cfp.wast @@ -381,8 +381,12 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result f32) ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (f32.const 42) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (f32.const 42) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (f32.const 42) @@ -395,8 +399,12 @@ ;; Fall though a 42 via an if. (if (result f32) (call $import) - (unreachable) - (f32.const 42) + (then + (unreachable) + ) + (else + (f32.const 42) + ) ) ) ) diff --git a/test/lit/passes/gufa.wast b/test/lit/passes/gufa.wast index b97e620ab..fcb60310a 100644 --- a/test/lit/passes/gufa.wast +++ b/test/lit/passes/gufa.wast @@ -104,8 +104,10 @@ ;; CHECK: (func $return (type $0) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2) @@ -116,8 +118,10 @@ ;; below. (if (i32.const 0) - (return - (i32.const 1) + (then + (return + (i32.const 1) + ) ) ) (i32.const 2) @@ -139,8 +143,10 @@ ;; CHECK: (func $return-same (type $0) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) @@ -152,8 +158,10 @@ ;; but see the caller below. (if (i32.const 0) - (return - (i32.const 1) + (then + (return + (i32.const 1) + ) ) ) (i32.const 1) @@ -180,8 +188,10 @@ ;; CHECK-NEXT: (local $x i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $x) @@ -190,8 +200,10 @@ (local $x i32) (if (call $import) - (local.set $x - (i32.const 1) + (then + (local.set $x + (i32.const 1) + ) ) ) ;; $x has two possible values, 1 and the default 0, so we cannot optimize @@ -203,8 +215,10 @@ ;; CHECK-NEXT: (local $x i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $import) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) @@ -213,10 +227,12 @@ (local $x i32) (if (call $import) - (local.set $x - ;; As above, but now we set 0 here. We can optimize the local.get to 0 - ;; in this case. - (i32.const 0) + (then + (local.set $x + ;; As above, but now we set 0 here. We can optimize the local.get to 0 + ;; in this case. + (i32.const 0) + ) ) ) (local.get $x) @@ -225,8 +241,10 @@ ;; CHECK: (func $param-no (type $3) (param $param i32) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $param) - ;; CHECK-NEXT: (local.set $param - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $param + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $param) @@ -234,8 +252,10 @@ (func $param-no (export "param-no") (param $param i32) (result i32) (if (local.get $param) - (local.set $param - (i32.const 1) + (then + (local.set $param + (i32.const 1) + ) ) ) ;; $x has two possible values, the incoming param value and 1, so we cannot @@ -247,8 +267,10 @@ ;; CHECK: (func $param-yes (type $3) (param $param i32) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (local.set $param - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $param + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) @@ -260,8 +282,10 @@ ;; local.set in the if, so we'll optimize it to 1. (if (local.get $param) - (local.set $param - (i32.const 1) + (then + (local.set $param + (i32.const 1) + ) ) ) (local.get $param) @@ -523,8 +547,10 @@ ;; CHECK-NEXT: (block $named (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $named - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $named + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) @@ -537,8 +563,10 @@ ;; CHECK-NEXT: (block $named0 (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $named0 - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $named0 + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) @@ -551,8 +579,10 @@ (block $named (result i32) (if (i32.const 0) - (br $named - (i32.const 1) + (then + (br $named + (i32.const 1) + ) ) ) (i32.const 1) @@ -564,8 +594,10 @@ (block $named (result i32) (if (i32.const 0) - (br $named - (i32.const 2) ;; this changed + (then + (br $named + (i32.const 2) ;; this changed + ) ) ) (i32.const 1) diff --git a/test/lit/passes/heap2local.wast b/test/lit/passes/heap2local.wast index 37a9e7919..286bfdc19 100644 --- a/test/lit/passes/heap2local.wast +++ b/test/lit/passes/heap2local.wast @@ -646,8 +646,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block (result f64) @@ -666,8 +668,10 @@ ;; that as a result of this the final local.get has two sets that send it ;; values, but we know they are both the same allocation. (if (local.get $x) - (local.set $ref - (local.get $ref) + (then + (local.set $ref + (local.get $ref) + ) ) ) (struct.get $struct.A 1 @@ -726,8 +730,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.set $ref - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $ref + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (struct.get $struct.A 1 @@ -740,8 +746,10 @@ (struct.new_default $struct.A) ) (if (local.get $x) - (local.set $ref - (ref.null $struct.A) + (then + (local.set $ref + (ref.null $struct.A) + ) ) ) ;; A get that receives two different allocations, and so we should not try @@ -985,15 +993,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (block (result f64) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result f64) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) @@ -1025,20 +1035,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (block (result f64) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result f64) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1062,14 +1076,18 @@ ) ) (if (local.get $x) - (drop - (struct.get $struct.A 1 - (local.get $ref) + (then + (drop + (struct.get $struct.A 1 + (local.get $ref) + ) ) ) - (struct.set $struct.A 1 - (local.get $ref) - (f64.const 42) + (else + (struct.set $struct.A 1 + (local.get $ref) + (f64.const 42) + ) ) ) (loop $inner @@ -1087,14 +1105,18 @@ ) ) (if (local.get $x) - (drop - (struct.get $struct.A 0 - (local.get $ref) + (then + (drop + (struct.get $struct.A 0 + (local.get $ref) + ) ) ) - (drop - (struct.get $struct.A 1 - (local.get $ref) + (else + (drop + (struct.get $struct.A 1 + (local.get $ref) + ) ) ) ) diff --git a/test/lit/passes/inlining-optimizing_optimize-level=3.wast b/test/lit/passes/inlining-optimizing_optimize-level=3.wast index a0e320bd6..fdfbf7b35 100644 --- a/test/lit/passes/inlining-optimizing_optimize-level=3.wast +++ b/test/lit/passes/inlining-optimizing_optimize-level=3.wast @@ -175,7 +175,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -204,7 +206,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (local.get $1) ) @@ -245,7 +249,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $__THREW__) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $__THREW__ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -260,12 +264,14 @@ (i32.eqz (global.get $__THREW__) ) - (block - (global.set $__THREW__ - (local.get $0) - ) - (global.set $threwValue - (local.get $1) + (then + (block + (global.set $__THREW__ + (local.get $0) + ) + (global.set $threwValue + (local.get $1) + ) ) ) ) @@ -315,7 +321,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (global.get $STACKTOP) @@ -331,7 +339,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $6) @@ -356,7 +366,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.add @@ -418,8 +430,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.load offset=76 ;; CHECK-NEXT: (local.get $0) @@ -437,11 +451,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const -33) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const -33) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -454,16 +470,18 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $_printf_core - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 672) - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $_printf_core + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 672) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $10 ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (local.tee $9 @@ -523,7 +541,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (call_indirect (type $FUNCSIG$iiii) ;; CHECK-NEXT: (local.get $0) @@ -612,7 +630,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (drop (call $_printf @@ -668,7 +688,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (f64.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (call $_frexp ;; CHECK-NEXT: (f64.mul @@ -685,7 +705,9 @@ ;; CHECK-NEXT: (i32.const -64) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -765,24 +787,28 @@ (local.get $0) (f64.const 0) ) - (block (result i32) - (local.set $0 - (call $_frexp - (f64.mul - (local.get $0) - (f64.const 18446744073709551615) + (then + (block (result i32) + (local.set $0 + (call $_frexp + (f64.mul + (local.get $0) + (f64.const 18446744073709551615) + ) + (local.get $1) ) - (local.get $1) ) - ) - (i32.add - (i32.load - (local.get $1) + (i32.add + (i32.load + (local.get $1) + ) + (i32.const -64) ) - (i32.const -64) ) ) - (i32.const 0) + (else + (i32.const 0) + ) ) ) ) @@ -877,14 +903,18 @@ (i32.load8_s (local.get $0) ) - (block + (then + (block + (local.set $0 + (local.get $2) + ) + (br $while-in3) + ) + ) + (else (local.set $0 (local.get $2) ) - (br $while-in3) - ) - (local.set $0 - (local.get $2) ) ) ) @@ -905,10 +935,14 @@ ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load offset=60 - ;; CHECK-NEXT: (call $_pthread_self) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.load offset=60 + ;; CHECK-NEXT: (call $_pthread_self) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 60) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 60) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $___errno_location (result i32) @@ -916,10 +950,14 @@ (i32.load (i32.const 16) ) - (i32.load offset=60 - (call $_pthread_self) + (then + (i32.load offset=60 + (call $_pthread_self) + ) + ) + (else + (i32.const 60) ) - (i32.const 60) ) ) ;; CHECK: (func $___stdio_close (param $0 i32) (result i32) @@ -939,7 +977,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.tee $2 @@ -979,7 +1019,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (i32.store (local.tee $2 @@ -1020,7 +1062,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (local.get $4) @@ -1044,7 +1088,7 @@ ;; CHECK-NEXT: (i32.const 64) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (i32.load offset=60 @@ -1064,9 +1108,11 @@ ;; CHECK-NEXT: (i32.const 54) ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 offset=75 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store8 offset=75 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1101,7 +1147,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (local.set $3 (local.get $4) @@ -1125,29 +1173,33 @@ (i32.const 64) ) ) - (block - (i32.store - (local.get $3) - (i32.load offset=60 - (local.get $0) + (then + (block + (i32.store + (local.get $3) + (i32.load offset=60 + (local.get $0) + ) ) - ) - (i32.store offset=4 - (local.get $3) - (i32.const 21505) - ) - (i32.store offset=8 - (local.get $3) - (local.get $5) - ) - (if - (call $___syscall54 - (i32.const 54) + (i32.store offset=4 (local.get $3) + (i32.const 21505) ) - (i32.store8 offset=75 - (local.get $0) - (i32.const -1) + (i32.store offset=8 + (local.get $3) + (local.get $5) + ) + (if + (call $___syscall54 + (i32.const 54) + (local.get $3) + ) + (then + (i32.store8 offset=75 + (local.get $0) + (i32.const -1) + ) + ) ) ) ) @@ -1181,7 +1233,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.tee $3 @@ -1223,15 +1277,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1257,7 +1313,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (i32.store (local.tee $3 @@ -1299,15 +1357,19 @@ ) (i32.const 0) ) - (block (result i32) - (i32.store - (local.get $0) + (then + (block (result i32) + (i32.store + (local.get $0) + (i32.const -1) + ) (i32.const -1) ) - (i32.const -1) ) - (i32.load - (local.get $0) + (else + (i32.load + (local.get $0) + ) ) ) ) @@ -1320,29 +1382,33 @@ ;; CHECK-NEXT: (local $1 i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (block $do-once (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (i32.load offset=76 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (block $do-once (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (i32.load offset=76 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $do-once + ;; CHECK-NEXT: (call $___fflush_unlocked + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once + ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (call $___fflush_unlocked ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (call $___fflush_unlocked - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.tee $0 @@ -1350,10 +1416,14 @@ ;; CHECK-NEXT: (i32.const 12) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_fflush - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_fflush + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $___lock @@ -1365,34 +1435,38 @@ ;; CHECK-NEXT: (i32.const 40) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.load offset=76 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (i32.load offset=20 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load offset=28 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $while-in + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.load offset=76 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (call $___fflush_unlocked + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (i32.load offset=20 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.load offset=28 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (call $___fflush_unlocked + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load offset=56 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (br_if $while-in + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load offset=56 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1411,121 +1485,145 @@ (block $do-once (if (local.get $0) - (block - (if - (i32.le_s - (i32.load offset=76 - (local.get $0) + (then + (block + (if + (i32.le_s + (i32.load offset=76 + (local.get $0) + ) + (i32.const -1) + ) + (then + (block + (local.set $0 + (call $___fflush_unlocked + (local.get $0) + ) + ) + (br $do-once) + ) ) - (i32.const -1) ) - (block - (local.set $0 - (call $___fflush_unlocked + (local.set $2 + (i32.eqz + (call $___lockfile (local.get $0) ) ) - (br $do-once) ) - ) - (local.set $2 - (i32.eqz - (call $___lockfile + (local.set $1 + (call $___fflush_unlocked (local.get $0) ) ) - ) - (local.set $1 - (call $___fflush_unlocked - (local.get $0) - ) - ) - (local.set $0 - (if (result i32) - (local.get $2) - (local.get $1) - (block (result i32) - (call $___unlockfile - (local.get $0) + (local.set $0 + (if (result i32) + (local.get $2) + (then + (local.get $1) + ) + (else + (block (result i32) + (call $___unlockfile + (local.get $0) + ) + (local.get $1) + ) ) - (local.get $1) ) ) ) ) - (block - (local.set $0 - (if (result i32) - (i32.load - (i32.const 12) - ) - (call $_fflush + (else + (block + (local.set $0 + (if (result i32) (i32.load (i32.const 12) ) - ) - (i32.const 0) - ) - ) - (call $___lock - (i32.const 44) - ) - (if - (local.tee $1 - (i32.load - (i32.const 40) - ) - ) - (loop $while-in - (local.set $2 - (if (result i32) - (i32.gt_s - (i32.load offset=76 - (local.get $1) + (then + (call $_fflush + (i32.load + (i32.const 12) ) - (i32.const -1) - ) - (call $___lockfile - (local.get $1) ) + ) + (else (i32.const 0) ) ) - (if - (i32.gt_u - (i32.load offset=20 - (local.get $1) + ) + (call $___lock + (i32.const 44) + ) + (if + (local.tee $1 + (i32.load + (i32.const 40) + ) + ) + (then + (loop $while-in + (local.set $2 + (if (result i32) + (i32.gt_s + (i32.load offset=76 + (local.get $1) + ) + (i32.const -1) + ) + (then + (call $___lockfile + (local.get $1) + ) + ) + (else + (i32.const 0) + ) + ) ) - (i32.load offset=28 - (local.get $1) + (if + (i32.gt_u + (i32.load offset=20 + (local.get $1) + ) + (i32.load offset=28 + (local.get $1) + ) + ) + (then + (local.set $0 + (i32.or + (call $___fflush_unlocked + (local.get $1) + ) + (local.get $0) + ) + ) + ) ) - ) - (local.set $0 - (i32.or - (call $___fflush_unlocked - (local.get $1) + (if + (local.get $2) + (then + (call $___unlockfile + (local.get $1) + ) ) - (local.get $0) ) - ) - ) - (if - (local.get $2) - (call $___unlockfile - (local.get $1) - ) - ) - (br_if $while-in - (local.tee $1 - (i32.load offset=56 - (local.get $1) + (br_if $while-in + (local.tee $1 + (i32.load offset=56 + (local.get $1) + ) + ) ) ) ) ) - ) - (call $___unlock - (i32.const 44) + (call $___unlock + (i32.const 44) + ) ) ) ) @@ -1549,7 +1647,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (i32.store (local.tee $3 @@ -1604,7 +1704,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $9 ;; CHECK-NEXT: (i32.add @@ -1689,7 +1791,7 @@ ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $_pthread_cleanup_push ;; CHECK-NEXT: (i32.const 5) ;; CHECK-NEXT: (local.get $0) @@ -1720,7 +1822,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: (i32.load @@ -1767,7 +1869,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (local.tee $7 @@ -1802,13 +1904,13 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (i32.add @@ -1825,8 +1927,10 @@ ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $3) @@ -1908,11 +2012,15 @@ ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.load offset=4 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.load offset=4 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1950,7 +2058,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (local.set $9 (i32.add @@ -2035,57 +2145,61 @@ (i32.load (i32.const 16) ) - (block - (call $_pthread_cleanup_push - (i32.const 5) - (local.get $0) - ) - (i32.store - (local.get $10) - (i32.load - (local.get $13) + (then + (block + (call $_pthread_cleanup_push + (i32.const 5) + (local.get $0) ) - ) - (i32.store offset=4 - (local.get $10) - (local.get $1) - ) - (i32.store offset=8 - (local.get $10) - (local.get $4) - ) - (local.set $3 - (call $___syscall_ret - (call $___syscall146 - (i32.const 146) - (local.get $10) + (i32.store + (local.get $10) + (i32.load + (local.get $13) ) ) - ) - (call $_pthread_cleanup_pop - (i32.const 0) + (i32.store offset=4 + (local.get $10) + (local.get $1) + ) + (i32.store offset=8 + (local.get $10) + (local.get $4) + ) + (local.set $3 + (call $___syscall_ret + (call $___syscall146 + (i32.const 146) + (local.get $10) + ) + ) + ) + (call $_pthread_cleanup_pop + (i32.const 0) + ) ) ) - (block - (i32.store - (local.get $9) - (i32.load - (local.get $13) + (else + (block + (i32.store + (local.get $9) + (i32.load + (local.get $13) + ) ) - ) - (i32.store offset=4 - (local.get $9) - (local.get $1) - ) - (i32.store offset=8 - (local.get $9) - (local.get $4) - ) - (local.set $3 - (call $___syscall_ret - (call $___syscall146 - (i32.const 146) - (local.get $9) + (i32.store offset=4 + (local.get $9) + (local.get $1) + ) + (i32.store offset=8 + (local.get $9) + (local.get $4) + ) + (local.set $3 + (call $___syscall_ret + (call $___syscall146 + (i32.const 146) + (local.get $9) + ) ) ) ) @@ -2113,69 +2227,77 @@ ) ) ) - (block (result i32) - (i32.store - (local.get $6) - (local.tee $7 - (i32.load - (local.get $14) + (then + (block (result i32) + (i32.store + (local.get $6) + (local.tee $7 + (i32.load + (local.get $14) + ) ) ) - ) - (i32.store - (local.get $11) - (local.get $7) - ) - (local.set $7 - (i32.load offset=12 - (local.get $1) + (i32.store + (local.get $11) + (local.get $7) ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 8) + (local.set $7 + (i32.load offset=12 + (local.get $1) + ) ) - ) - (local.set $4 - (i32.add - (local.get $4) - (i32.const -1) + (local.set $1 + (i32.add + (local.get $1) + (i32.const 8) + ) + ) + (local.set $4 + (i32.add + (local.get $4) + (i32.const -1) + ) + ) + (i32.sub + (local.get $3) + (local.get $5) ) - ) - (i32.sub - (local.get $3) - (local.get $5) ) ) - (block (result i32) - (if - (i32.eq - (local.get $4) - (i32.const 2) - ) - (block - (i32.store - (local.get $6) - (i32.add - (i32.load + (else + (block (result i32) + (if + (i32.eq + (local.get $4) + (i32.const 2) + ) + (then + (block + (i32.store (local.get $6) + (i32.add + (i32.load + (local.get $6) + ) + (local.get $3) + ) + ) + (local.set $7 + (local.get $5) + ) + (local.set $4 + (i32.const 2) ) - (local.get $3) ) ) - (local.set $7 - (local.get $5) - ) - (local.set $4 - (i32.const 2) + (else + (local.set $7 + (local.get $5) + ) ) ) - (local.set $7 - (local.get $5) - ) + (local.get $3) ) - (local.get $3) ) ) ) @@ -2254,11 +2376,15 @@ (local.get $4) (i32.const 2) ) - (i32.const 0) - (i32.sub - (local.get $2) - (i32.load offset=4 - (local.get $1) + (then + (i32.const 0) + ) + (else + (i32.sub + (local.get $2) + (i32.load offset=4 + (local.get $1) + ) ) ) ) @@ -2296,7 +2422,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (local.set $5 (i32.add @@ -2361,198 +2489,216 @@ ) (i32.const 0) ) - (i32.const -1) - (block (result i32) - (local.set $14 - (if (result i32) - (i32.gt_s - (i32.load offset=76 - (local.get $0) + (then + (i32.const -1) + ) + (else + (block (result i32) + (local.set $14 + (if (result i32) + (i32.gt_s + (i32.load offset=76 + (local.get $0) + ) + (i32.const -1) ) - (i32.const -1) - ) - (call $___lockfile - (local.get $0) - ) - (i32.const 0) - ) - ) - (local.set $10 - (i32.load - (local.get $0) - ) - ) - (if - (i32.lt_s - (i32.load8_s offset=74 - (local.get $0) - ) - (i32.const 1) - ) - (i32.store - (local.get $0) - (i32.and - (local.get $10) - (i32.const -33) - ) - ) - ) - (if - (i32.load - (local.tee $11 - (i32.add - (local.get $0) - (i32.const 48) + (then + (call $___lockfile + (local.get $0) + ) + ) + (else + (i32.const 0) ) ) ) - (local.set $1 - (call $_printf_core + (local.set $10 + (i32.load (local.get $0) - (local.get $1) - (local.get $5) - (local.get $7) - (local.get $8) ) ) - (block - (local.set $13 - (i32.load - (local.tee $12 - (i32.add - (local.get $0) - (i32.const 44) - ) - ) + (if + (i32.lt_s + (i32.load8_s offset=74 + (local.get $0) ) + (i32.const 1) ) - (i32.store - (local.get $12) - (local.get $6) - ) - (i32.store - (local.tee $9 - (i32.add - (local.get $0) - (i32.const 28) + (then + (i32.store + (local.get $0) + (i32.and + (local.get $10) + (i32.const -33) ) ) - (local.get $6) ) - (i32.store - (local.tee $3 + ) + (if + (i32.load + (local.tee $11 (i32.add (local.get $0) - (i32.const 20) + (i32.const 48) ) ) - (local.get $6) ) - (i32.store - (local.get $11) - (i32.const 80) - ) - (i32.store - (local.tee $2 - (i32.add + (then + (local.set $1 + (call $_printf_core (local.get $0) - (i32.const 16) + (local.get $1) + (local.get $5) + (local.get $7) + (local.get $8) ) ) - (i32.add - (local.get $6) - (i32.const 80) - ) ) - (local.set $1 - (call $_printf_core - (local.get $0) - (local.get $1) - (local.get $5) - (local.get $7) - (local.get $8) - ) - ) - (if - (local.get $13) + (else (block - (drop - (call_indirect (type $FUNCSIG$iiii) - (local.get $0) - (i32.const 0) - (i32.const 0) - (i32.add - (i32.and - (i32.load offset=36 - (local.get $0) - ) - (i32.const 7) + (local.set $13 + (i32.load + (local.tee $12 + (i32.add + (local.get $0) + (i32.const 44) ) - (i32.const 2) ) ) ) - (local.set $1 - (select - (local.get $1) - (i32.const -1) - (i32.load - (local.get $3) + (i32.store + (local.get $12) + (local.get $6) + ) + (i32.store + (local.tee $9 + (i32.add + (local.get $0) + (i32.const 28) ) ) + (local.get $6) ) (i32.store - (local.get $12) - (local.get $13) + (local.tee $3 + (i32.add + (local.get $0) + (i32.const 20) + ) + ) + (local.get $6) ) (i32.store (local.get $11) - (i32.const 0) + (i32.const 80) ) (i32.store - (local.get $2) - (i32.const 0) + (local.tee $2 + (i32.add + (local.get $0) + (i32.const 16) + ) + ) + (i32.add + (local.get $6) + (i32.const 80) + ) ) - (i32.store - (local.get $9) - (i32.const 0) + (local.set $1 + (call $_printf_core + (local.get $0) + (local.get $1) + (local.get $5) + (local.get $7) + (local.get $8) + ) ) - (i32.store - (local.get $3) - (i32.const 0) + (if + (local.get $13) + (then + (block + (drop + (call_indirect (type $FUNCSIG$iiii) + (local.get $0) + (i32.const 0) + (i32.const 0) + (i32.add + (i32.and + (i32.load offset=36 + (local.get $0) + ) + (i32.const 7) + ) + (i32.const 2) + ) + ) + ) + (local.set $1 + (select + (local.get $1) + (i32.const -1) + (i32.load + (local.get $3) + ) + ) + ) + (i32.store + (local.get $12) + (local.get $13) + ) + (i32.store + (local.get $11) + (i32.const 0) + ) + (i32.store + (local.get $2) + (i32.const 0) + ) + (i32.store + (local.get $9) + (i32.const 0) + ) + (i32.store + (local.get $3) + (i32.const 0) + ) + ) + ) ) ) ) ) - ) - (i32.store - (local.get $0) - (i32.or - (local.tee $2 - (i32.load + (i32.store + (local.get $0) + (i32.or + (local.tee $2 + (i32.load + (local.get $0) + ) + ) + (i32.and + (local.get $10) + (i32.const 32) + ) + ) + ) + (if + (local.get $14) + (then + (call $___unlockfile (local.get $0) ) ) + ) + (select + (i32.const -1) + (local.get $1) (i32.and - (local.get $10) + (local.get $2) (i32.const 32) ) ) ) - (if - (local.get $14) - (call $___unlockfile - (local.get $0) - ) - ) - (select - (i32.const -1) - (local.get $1) - (i32.and - (local.get $2) - (i32.const 32) - ) - ) ) ) ) @@ -2611,7 +2757,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.or @@ -2621,7 +2767,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store offset=8 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 0) @@ -2654,8 +2800,10 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (local.get $5) @@ -2684,7 +2832,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (call_indirect (type $FUNCSIG$iiii) ;; CHECK-NEXT: (local.get $2) @@ -2712,81 +2860,85 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $label$break$L10 (result i32) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (br_if $label$break$L10 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $label$break$L10 (result i32) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (br_if $label$break$L10 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$break$L5 - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (call_indirect (type $FUNCSIG$iiii) - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load offset=36 - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (br_if $label$break$L5 + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (call_indirect (type $FUNCSIG$iiii) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load offset=36 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -2837,16 +2989,20 @@ (call $___towrite (local.get $2) ) - (local.set $3 - (i32.const 0) - ) - (block + (then (local.set $3 - (i32.load - (local.get $4) + (i32.const 0) + ) + ) + (else + (block + (local.set $3 + (i32.load + (local.get $4) + ) ) + (br $__rjti$0) ) - (br $__rjti$0) ) ) (br $label$break$L5) @@ -2868,24 +3024,26 @@ ) (local.get $1) ) - (block - (local.set $3 - (call_indirect (type $FUNCSIG$iiii) - (local.get $2) - (local.get $0) - (local.get $1) - (i32.add - (i32.and - (i32.load offset=36 - (local.get $2) + (then + (block + (local.set $3 + (call_indirect (type $FUNCSIG$iiii) + (local.get $2) + (local.get $0) + (local.get $1) + (i32.add + (i32.and + (i32.load offset=36 + (local.get $2) + ) + (i32.const 7) ) - (i32.const 7) + (i32.const 2) ) - (i32.const 2) ) ) + (br $label$break$L5) ) - (br $label$break$L5) ) ) (local.set $2 @@ -2897,81 +3055,87 @@ ) (i32.const -1) ) - (block (result i32) - (local.set $3 - (local.get $1) - ) - (loop $while-in - (drop - (br_if $label$break$L10 - (i32.const 0) - (i32.eqz - (local.get $3) + (then + (block (result i32) + (local.set $3 + (local.get $1) + ) + (loop $while-in + (drop + (br_if $label$break$L10 + (i32.const 0) + (i32.eqz + (local.get $3) + ) ) ) - ) - (if - (i32.ne - (i32.load8_s - (i32.add - (local.get $0) - (local.tee $6 - (i32.add - (local.get $3) - (i32.const -1) + (if + (i32.ne + (i32.load8_s + (i32.add + (local.get $0) + (local.tee $6 + (i32.add + (local.get $3) + (i32.const -1) + ) ) ) ) + (i32.const 10) ) - (i32.const 10) - ) - (block - (local.set $3 - (local.get $6) + (then + (block + (local.set $3 + (local.get $6) + ) + (br $while-in) + ) ) - (br $while-in) ) ) - ) - (br_if $label$break$L5 - (i32.lt_u - (call_indirect (type $FUNCSIG$iiii) - (local.get $2) - (local.get $0) - (local.get $3) - (i32.add - (i32.and - (i32.load offset=36 - (local.get $2) + (br_if $label$break$L5 + (i32.lt_u + (call_indirect (type $FUNCSIG$iiii) + (local.get $2) + (local.get $0) + (local.get $3) + (i32.add + (i32.and + (i32.load offset=36 + (local.get $2) + ) + (i32.const 7) ) - (i32.const 7) + (i32.const 2) ) - (i32.const 2) ) + (local.get $3) ) - (local.get $3) ) - ) - (local.set $4 - (i32.load - (local.get $5) + (local.set $4 + (i32.load + (local.get $5) + ) ) - ) - (local.set $1 - (i32.sub - (local.get $1) - (local.get $3) + (local.set $1 + (i32.sub + (local.get $1) + (local.get $3) + ) ) - ) - (local.set $0 - (i32.add - (local.get $0) - (local.get $3) + (local.set $0 + (i32.add + (local.get $0) + (local.get $3) + ) ) + (local.get $3) ) - (local.get $3) ) - (i32.const 0) + (else + (i32.const 0) + ) ) ) ) @@ -3033,47 +3197,51 @@ ) (i32.const 8) ) - (block (result i32) - (i32.store - (local.get $0) - (i32.or - (local.get $1) - (i32.const 32) + (then + (block (result i32) + (i32.store + (local.get $0) + (i32.or + (local.get $1) + (i32.const 32) + ) ) + (i32.const -1) ) - (i32.const -1) ) - (block (result i32) - (i32.store offset=8 - (local.get $0) - (i32.const 0) - ) - (i32.store offset=4 - (local.get $0) - (i32.const 0) - ) - (i32.store offset=28 - (local.get $0) - (local.tee $1 - (i32.load offset=44 - (local.get $0) + (else + (block (result i32) + (i32.store offset=8 + (local.get $0) + (i32.const 0) + ) + (i32.store offset=4 + (local.get $0) + (i32.const 0) + ) + (i32.store offset=28 + (local.get $0) + (local.tee $1 + (i32.load offset=44 + (local.get $0) + ) ) ) - ) - (i32.store offset=20 - (local.get $0) - (local.get $1) - ) - (i32.store offset=16 - (local.get $0) - (i32.add + (i32.store offset=20 + (local.get $0) (local.get $1) - (i32.load offset=48 - (local.get $0) + ) + (i32.store offset=16 + (local.get $0) + (i32.add + (local.get $1) + (i32.load offset=48 + (local.get $0) + ) ) ) + (i32.const 0) ) - (i32.const 0) ) ) ) @@ -3082,361 +3250,387 @@ (block $do-once (result i32) (if (result i32) (local.get $0) - (block (result i32) - (if - (i32.lt_u - (local.get $1) - (i32.const 128) - ) - (block - (i32.store8 - (local.get $0) + (then + (block (result i32) + (if + (i32.lt_u (local.get $1) + (i32.const 128) ) - (br $do-once - (i32.const 1) - ) - ) - ) - (if - (i32.lt_u - (local.get $1) - (i32.const 2048) - ) - (block - (i32.store8 - (local.get $0) - (i32.or - (i32.shr_u + (then + (block + (i32.store8 + (local.get $0) (local.get $1) - (i32.const 6) ) - (i32.const 192) - ) - ) - (i32.store8 offset=1 - (local.get $0) - (i32.or - (i32.and - (local.get $1) - (i32.const 63) + (br $do-once + (i32.const 1) ) - (i32.const 128) ) ) - (br $do-once - (i32.const 2) - ) ) - ) - (if - (i32.or + (if (i32.lt_u (local.get $1) - (i32.const 55296) + (i32.const 2048) ) - (i32.eq - (i32.and - (local.get $1) - (i32.const -8192) + (then + (block + (i32.store8 + (local.get $0) + (i32.or + (i32.shr_u + (local.get $1) + (i32.const 6) + ) + (i32.const 192) + ) + ) + (i32.store8 offset=1 + (local.get $0) + (i32.or + (i32.and + (local.get $1) + (i32.const 63) + ) + (i32.const 128) + ) + ) + (br $do-once + (i32.const 2) + ) ) - (i32.const 57344) ) ) - (block - (i32.store8 - (local.get $0) - (i32.or - (i32.shr_u + (if + (i32.or + (i32.lt_u + (local.get $1) + (i32.const 55296) + ) + (i32.eq + (i32.and (local.get $1) - (i32.const 12) + (i32.const -8192) ) - (i32.const 224) + (i32.const 57344) ) ) - (i32.store8 offset=1 - (local.get $0) - (i32.or - (i32.and - (i32.shr_u - (local.get $1) - (i32.const 6) + (then + (block + (i32.store8 + (local.get $0) + (i32.or + (i32.shr_u + (local.get $1) + (i32.const 12) + ) + (i32.const 224) ) - (i32.const 63) ) - (i32.const 128) - ) - ) - (i32.store8 offset=2 - (local.get $0) - (i32.or - (i32.and - (local.get $1) - (i32.const 63) + (i32.store8 offset=1 + (local.get $0) + (i32.or + (i32.and + (i32.shr_u + (local.get $1) + (i32.const 6) + ) + (i32.const 63) + ) + (i32.const 128) + ) + ) + (i32.store8 offset=2 + (local.get $0) + (i32.or + (i32.and + (local.get $1) + (i32.const 63) + ) + (i32.const 128) + ) + ) + (br $do-once + (i32.const 3) ) - (i32.const 128) ) ) - (br $do-once - (i32.const 3) - ) ) - ) - (if (result i32) - (i32.lt_u - (i32.add - (local.get $1) - (i32.const -65536) - ) - (i32.const 1048576) - ) - (block (result i32) - (i32.store8 - (local.get $0) - (i32.or - (i32.shr_u - (local.get $1) - (i32.const 18) - ) - (i32.const 240) + (if (result i32) + (i32.lt_u + (i32.add + (local.get $1) + (i32.const -65536) ) + (i32.const 1048576) ) - (i32.store8 offset=1 - (local.get $0) - (i32.or - (i32.and - (i32.shr_u - (local.get $1) - (i32.const 12) + (then + (block (result i32) + (i32.store8 + (local.get $0) + (i32.or + (i32.shr_u + (local.get $1) + (i32.const 18) + ) + (i32.const 240) ) - (i32.const 63) ) - (i32.const 128) - ) - ) - (i32.store8 offset=2 - (local.get $0) - (i32.or - (i32.and - (i32.shr_u - (local.get $1) - (i32.const 6) + (i32.store8 offset=1 + (local.get $0) + (i32.or + (i32.and + (i32.shr_u + (local.get $1) + (i32.const 12) + ) + (i32.const 63) + ) + (i32.const 128) ) - (i32.const 63) ) - (i32.const 128) + (i32.store8 offset=2 + (local.get $0) + (i32.or + (i32.and + (i32.shr_u + (local.get $1) + (i32.const 6) + ) + (i32.const 63) + ) + (i32.const 128) + ) + ) + (i32.store8 offset=3 + (local.get $0) + (i32.or + (i32.and + (local.get $1) + (i32.const 63) + ) + (i32.const 128) + ) + ) + (i32.const 4) ) ) - (i32.store8 offset=3 - (local.get $0) - (i32.or - (i32.and - (local.get $1) - (i32.const 63) + (else + (block (result i32) + (i32.store + (call $___errno_location) + (i32.const 84) ) - (i32.const 128) + (i32.const -1) ) ) - (i32.const 4) - ) - (block (result i32) - (i32.store - (call $___errno_location) - (i32.const 84) - ) - (i32.const -1) ) ) ) - (i32.const 1) + (else + (i32.const 1) + ) ) ) ) ;; CHECK: (func $_wctomb (param $0 i32) (param $1 i32) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (block $do-once (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 128) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 2048) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 128) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 offset=1 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 63) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 128) + ;; CHECK-NEXT: (br $do-once + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const -8192) + ;; CHECK-NEXT: (i32.const 2048) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 57344) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 55296) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store8 offset=1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 128) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 224) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 offset=1 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: (i32.const -8192) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: (i32.const 57344) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 128) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 offset=2 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: (i32.const 55296) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 224) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store8 offset=1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 128) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store8 offset=2 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 128) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 128) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 65536) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1048576) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 18) + ;; CHECK-NEXT: (i32.const 65536) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 240) + ;; CHECK-NEXT: (i32.const 1048576) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 offset=1 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 18) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 240) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 63) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 128) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 offset=2 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: (i32.store8 offset=1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 128) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 63) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 128) + ;; CHECK-NEXT: (i32.store8 offset=2 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 128) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store8 offset=3 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 128) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 offset=3 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 63) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (call $___errno_location) + ;; CHECK-NEXT: (i32.const 84) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 128) + ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (call $___errno_location) - ;; CHECK-NEXT: (i32.const 84) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $_wctomb (param $0 i32) (param $1 i32) (result i32) (if (result i32) (local.get $0) - (call $_wcrtomb - (local.get $0) - (local.get $1) + (then + (call $_wcrtomb + (local.get $0) + (local.get $1) + (i32.const 0) + ) + ) + (else (i32.const 0) ) - (i32.const 0) ) ) (func $_memchr (param $0 i32) (param $1 i32) (param $2 i32) (result i32) @@ -3467,69 +3661,73 @@ (i32.const 0) ) ) - (block - (local.set $4 - (i32.and - (local.get $1) - (i32.const 255) + (then + (block + (local.set $4 + (i32.and + (local.get $1) + (i32.const 255) + ) ) - ) - (local.set $3 - (local.get $2) - ) - (local.set $2 - (local.get $0) - ) - (loop $while-in - (br_if $__rjti$2 - (i32.eq - (i32.load8_u - (local.get $2) - ) - (i32.and - (local.get $4) - (i32.const 255) + (local.set $3 + (local.get $2) + ) + (local.set $2 + (local.get $0) + ) + (loop $while-in + (br_if $__rjti$2 + (i32.eq + (i32.load8_u + (local.get $2) + ) + (i32.and + (local.get $4) + (i32.const 255) + ) ) ) - ) - (br_if $while-in - (i32.and - (local.tee $0 - (i32.ne - (local.tee $3 - (i32.add - (local.get $3) - (i32.const -1) + (br_if $while-in + (i32.and + (local.tee $0 + (i32.ne + (local.tee $3 + (i32.add + (local.get $3) + (i32.const -1) + ) ) + (i32.const 0) ) - (i32.const 0) ) - ) - (i32.ne - (i32.and - (local.tee $2 - (i32.add - (local.get $2) - (i32.const 1) + (i32.ne + (i32.and + (local.tee $2 + (i32.add + (local.get $2) + (i32.const 1) + ) ) + (i32.const 3) ) - (i32.const 3) + (i32.const 0) ) - (i32.const 0) ) ) ) ) ) - (block - (local.set $3 - (local.get $2) - ) - (local.set $2 - (local.get $0) - ) - (local.set $0 - (local.get $4) + (else + (block + (local.set $3 + (local.get $2) + ) + (local.set $2 + (local.get $0) + ) + (local.set $0 + (local.get $4) + ) ) ) ) @@ -3556,109 +3754,115 @@ ) ) ) - (block - (local.set $3 - (i32.mul - (local.get $5) - (i32.const 16843009) + (then + (block + (local.set $3 + (i32.mul + (local.get $5) + (i32.const 16843009) + ) ) - ) - (block $__rjto$0 - (block $__rjti$0 - (br_if $__rjti$0 - (i32.le_u - (local.get $0) - (i32.const 3) + (block $__rjto$0 + (block $__rjti$0 + (br_if $__rjti$0 + (i32.le_u + (local.get $0) + (i32.const 3) + ) ) - ) - (loop $while-in3 - (if - (i32.eqz - (i32.and - (i32.xor - (i32.and - (local.tee $4 - (i32.xor - (i32.load - (local.get $2) + (loop $while-in3 + (if + (i32.eqz + (i32.and + (i32.xor + (i32.and + (local.tee $4 + (i32.xor + (i32.load + (local.get $2) + ) + (local.get $3) ) - (local.get $3) ) + (i32.const -2139062144) ) (i32.const -2139062144) ) - (i32.const -2139062144) - ) - (i32.add - (local.get $4) - (i32.const -16843009) - ) - ) - ) - (block - (local.set $2 - (i32.add - (local.get $2) - (i32.const 4) + (i32.add + (local.get $4) + (i32.const -16843009) + ) ) ) - (br_if $while-in3 - (i32.gt_u - (local.tee $0 + (then + (block + (local.set $2 (i32.add - (local.get $0) - (i32.const -4) + (local.get $2) + (i32.const 4) ) ) - (i32.const 3) + (br_if $while-in3 + (i32.gt_u + (local.tee $0 + (i32.add + (local.get $0) + (i32.const -4) + ) + ) + (i32.const 3) + ) + ) + (br $__rjti$0) ) ) - (br $__rjti$0) ) ) + (br $__rjto$0) ) - (br $__rjto$0) - ) - (if - (i32.eqz - (local.get $0) - ) - (block - (local.set $0 - (i32.const 0) - ) - (br $label$break$L8) - ) - ) - ) - (loop $while-in5 - (br_if $label$break$L8 - (i32.eq - (i32.load8_u - (local.get $2) + (if + (i32.eqz + (local.get $0) ) - (i32.and - (local.get $1) - (i32.const 255) + (then + (block + (local.set $0 + (i32.const 0) + ) + (br $label$break$L8) + ) ) ) ) - (local.set $2 - (i32.add - (local.get $2) - (i32.const 1) + (loop $while-in5 + (br_if $label$break$L8 + (i32.eq + (i32.load8_u + (local.get $2) + ) + (i32.and + (local.get $1) + (i32.const 255) + ) + ) ) - ) - (br_if $while-in5 - (local.tee $0 + (local.set $2 (i32.add - (local.get $0) - (i32.const -1) + (local.get $2) + (i32.const 1) ) ) - ) - (local.set $0 - (i32.const 0) + (br_if $while-in5 + (local.tee $0 + (i32.add + (local.get $0) + (i32.const -1) + ) + ) + ) + (local.set $0 + (i32.const 0) + ) ) ) ) @@ -3676,7 +3880,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const -4096) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (call $___errno_location) ;; CHECK-NEXT: (i32.sub @@ -3686,7 +3890,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $___syscall_ret (param $0 i32) (result i32) @@ -3695,17 +3901,21 @@ (local.get $0) (i32.const -4096) ) - (block (result i32) - (i32.store - (call $___errno_location) - (i32.sub - (i32.const 0) - (local.get $0) + (then + (block (result i32) + (i32.store + (call $___errno_location) + (i32.sub + (i32.const 0) + (local.get $0) + ) ) + (i32.const -1) ) - (i32.const -1) ) - (local.get $0) + (else + (local.get $0) + ) ) ) ;; CHECK: (func $___fflush_unlocked (param $0 i32) (result i32) @@ -3786,22 +3996,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call_indirect (type $FUNCSIG$iiii) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load offset=40 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call_indirect (type $FUNCSIG$iiii) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load offset=40 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -3908,22 +4120,24 @@ ) ) ) - (drop - (call_indirect (type $FUNCSIG$iiii) - (local.get $0) - (i32.sub - (local.get $4) - (local.get $6) - ) - (i32.const 1) - (i32.add - (i32.and - (i32.load offset=40 - (local.get $0) + (then + (drop + (call_indirect (type $FUNCSIG$iiii) + (local.get $0) + (i32.sub + (local.get $4) + (local.get $6) + ) + (i32.const 1) + (i32.add + (i32.and + (i32.load offset=40 + (local.get $0) + ) + (i32.const 7) ) - (i32.const 7) + (i32.const 2) ) - (i32.const 2) ) ) ) @@ -3966,8 +4180,10 @@ (local.get $0) ) ) - (call $___unlockfile - (local.get $0) + (then + (call $___unlockfile + (local.get $0) + ) ) ) ) @@ -3977,21 +4193,33 @@ (local.get $0) (local.get $0) ) - (i32.const -2147483648) - (if (result i32) - (f64.ge - (local.get $0) - (f64.const 2147483648) - ) + (then (i32.const -2147483648) + ) + (else (if (result i32) - (f64.le + (f64.ge (local.get $0) - (f64.const -2147483649) + (f64.const 2147483648) ) - (i32.const -2147483648) - (i32.trunc_f64_s - (local.get $0) + (then + (i32.const -2147483648) + ) + (else + (if (result i32) + (f64.le + (local.get $0) + (f64.const -2147483649) + ) + (then + (i32.const -2147483648) + ) + (else + (i32.trunc_f64_s + (local.get $0) + ) + ) + ) ) ) ) @@ -4000,44 +4228,60 @@ (func $i32s-div (param $0 i32) (param $1 i32) (result i32) (if (result i32) (local.get $1) - (if (result i32) - (i32.and - (i32.eq - (local.get $0) - (i32.const -2147483648) + (then + (if (result i32) + (i32.and + (i32.eq + (local.get $0) + (i32.const -2147483648) + ) + (i32.eq + (local.get $1) + (i32.const -1) + ) ) - (i32.eq - (local.get $1) - (i32.const -1) + (then + (i32.const 0) + ) + (else + (i32.div_s + (local.get $0) + (local.get $1) + ) ) ) + ) + (else (i32.const 0) - (i32.div_s - (local.get $0) - (local.get $1) - ) ) - (i32.const 0) ) ) (func $i32u-rem (param $0 i32) (param $1 i32) (result i32) (if (result i32) (local.get $1) - (i32.rem_u - (local.get $0) - (local.get $1) + (then + (i32.rem_u + (local.get $0) + (local.get $1) + ) + ) + (else + (i32.const 0) ) - (i32.const 0) ) ) (func $i32u-div (param $0 i32) (param $1 i32) (result i32) (if (result i32) (local.get $1) - (i32.div_u - (local.get $0) - (local.get $1) + (then + (i32.div_u + (local.get $0) + (local.get $1) + ) + ) + (else + (i32.const 0) ) - (i32.const 0) ) ) ;; CHECK: (func $_printf_core (param $0 i32) (param $1 i32) (param $2 i32) (param $3 i32) (param $4 i32) (result i32) @@ -4096,7 +4340,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $21 ;; CHECK-NEXT: (i32.add @@ -4222,25 +4468,29 @@ ;; CHECK-NEXT: (local.get $17) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 2147483647) - ;; CHECK-NEXT: (local.get $17) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 2147483647) + ;; CHECK-NEXT: (local.get $17) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (call $___errno_location) - ;; CHECK-NEXT: (i32.const 75) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (call $___errno_location) + ;; CHECK-NEXT: (i32.const 75) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (local.get $17) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (local.get $17) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -4333,20 +4583,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $29) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -4356,7 +4610,7 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) @@ -4386,7 +4640,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (i32.load8_s ;; CHECK-NEXT: (local.tee $10 @@ -4421,7 +4675,7 @@ ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) @@ -4445,77 +4699,81 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $label$break$L25 (result i32) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in4 (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $label$break$L25 (result i32) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in4 (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 75913) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 75913) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L25 - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L25 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.extend8_s - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.extend8_s + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in4 - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.tee $10 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (br_if $while-in4 + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.tee $10 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -32) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $1 @@ -4527,243 +4785,249 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 42) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once5 (result i32) - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (block $__rjto$0 (result i32) - ;; CHECK-NEXT: (block $__rjti$0 - ;; CHECK-NEXT: (br_if $__rjti$0 - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.tee $9 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once5 (result i32) + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (block $__rjto$0 (result i32) + ;; CHECK-NEXT: (block $__rjti$0 + ;; CHECK-NEXT: (br_if $__rjti$0 + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.tee $9 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $__rjti$0 - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (i32.load8_s offset=2 - ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (br_if $__rjti$0 + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (i32.load8_s offset=2 + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 36) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 36) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.load offset=4 - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.load offset=4 + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $16 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__rjto$0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (local.set $16 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: (br $__rjto$0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $29) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $16 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $29) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once5 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $16 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once5 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $16 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $10 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.set $16 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $10 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (i32.const -4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $16) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $16 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $16 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 8192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 8192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.extend8_s - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.extend8_s + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in8 - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in8 + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $11 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.tee $10 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.tee $10 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.set $16 + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in8) + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $16 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.set $16 + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $16 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -4775,201 +5039,207 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 46) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $label$break$L46 (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $label$break$L46 (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 42) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 42) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $11 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L46 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in11 + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (br_if $label$break$L46 + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.tee $10 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L46 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in11 - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (br_if $label$break$L46 - ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.load8_s offset=3 + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 36) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.shl ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.tee $10 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.load offset=4 + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (local.set $10 ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L46 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.load8_s offset=3 - ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 36) + ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.load offset=4 - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (local.get $29) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $10 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L46 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.get $29) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $10 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $8 @@ -4991,7 +5261,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 57) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $17 ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) @@ -5030,7 +5300,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: ) @@ -5048,7 +5318,7 @@ ;; CHECK-NEXT: (i32.const 255) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $17 ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) @@ -5071,20 +5341,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 19) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $18) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $__rjti$2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__rjti$2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $18) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $4) @@ -5125,7 +5399,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $29) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $17 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -5145,7 +5419,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $29) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: ) @@ -5426,7 +5700,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (local.get $23) ;; CHECK-NEXT: ) @@ -5462,8 +5736,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (local.get $23) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (local.get $23) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -5471,7 +5747,7 @@ ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) @@ -5494,8 +5770,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $5 @@ -5523,7 +5801,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $tempRet0 ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (i32.sub @@ -5566,19 +5844,21 @@ ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: (i32.const 2048) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 4092) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.const 4093) - ;; CHECK-NEXT: (i32.const 4091) - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.const 4093) + ;; CHECK-NEXT: (i32.const 4091) + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -5652,7 +5932,7 @@ ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (br_if $while-in2 ;; CHECK-NEXT: (i32.ne ;; CHECK-NEXT: (local.tee $9 @@ -5695,13 +5975,15 @@ ;; CHECK-NEXT: (i32.load8_s ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $while-in3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -5756,13 +6038,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $__rjti$6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (call $_pad ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 32) @@ -5802,7 +6084,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $28 ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -5813,30 +6095,32 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 4108) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 2048) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $28 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 2048) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4111) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $28 - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $28 + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 4111) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.const 4114) - ;; CHECK-NEXT: (i32.const 4109) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $28 + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.const 4114) + ;; CHECK-NEXT: (i32.const 4109) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -5862,2298 +6146,2416 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2146435072) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once49 (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (f64.ne - ;; CHECK-NEXT: (local.tee $25 - ;; CHECK-NEXT: (f64.mul - ;; CHECK-NEXT: (call $_frexp - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once49 (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (f64.ne + ;; CHECK-NEXT: (local.tee $25 + ;; CHECK-NEXT: (f64.mul + ;; CHECK-NEXT: (call $_frexp + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f64.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.const 2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f64.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $21) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.tee $26 - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.tee $26 + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 97) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 97) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $30) + ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $30) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $30) - ;; CHECK-NEXT: (local.tee $18 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (local.tee $18 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (if (result f64) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 12) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.set $14 + ;; CHECK-NEXT: (if (result f64) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 11) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $25) - ;; CHECK-NEXT: (block (result f64) - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (f64.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $25) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in54 + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (f64.mul - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.const 16) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f64.const 8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in54 - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (loop $while-in54 + ;; CHECK-NEXT: (local.set $14 + ;; CHECK-NEXT: (f64.mul + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.const 16) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (f64.neg - ;; CHECK-NEXT: (f64.add - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.sub - ;; CHECK-NEXT: (f64.neg - ;; CHECK-NEXT: (local.get $25) + ;; CHECK-NEXT: (br_if $while-in54 + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $14) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.sub - ;; CHECK-NEXT: (f64.add - ;; CHECK-NEXT: (local.get $25) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (f64.neg + ;; CHECK-NEXT: (f64.add + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.sub + ;; CHECK-NEXT: (f64.neg + ;; CHECK-NEXT: (local.get $25) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f64.sub + ;; CHECK-NEXT: (f64.add + ;; CHECK-NEXT: (local.get $25) + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $14) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 45) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 45) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $28) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $28) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (call $_fmt_u - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (call $_fmt_u + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.lt_s ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: (local.get $24) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $24) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $24) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $24) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $38) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $38) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.get $38) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $38) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 43) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.store8 ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 43) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $15 - ;; CHECK-NEXT: (i32.le_s - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.set $15 + ;; CHECK-NEXT: (i32.le_s + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $20 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (local.set $20 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $22) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in56 - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.load8_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (f64.ne - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -2147483648) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in56 + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.load8_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $7 ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (f64.ge + ;; CHECK-NEXT: (f64.ne + ;; CHECK-NEXT: (local.get $14) ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.const 2147483648) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -2147483648) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (f64.le - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.const -2147483649) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.const -2147483648) - ;; CHECK-NEXT: (i32.trunc_f64_s - ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (f64.ge + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.const 2147483648) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const -2147483648) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (f64.le + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.const -2147483649) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const -2147483648) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.trunc_f64_s + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 4075) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4075) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $18) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $18) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (f64.mul - ;; CHECK-NEXT: (f64.sub - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.convert_i32_s - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.set $14 + ;; CHECK-NEXT: (f64.mul + ;; CHECK-NEXT: (f64.sub + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.convert_i32_s + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f64.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $22) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $20) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (f64.eq - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (f64.eq + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 46) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 46) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in56 - ;; CHECK-NEXT: (f64.ne - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: (br_if $while-in56 + ;; CHECK-NEXT: (f64.ne + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 32) - ;; CHECK-NEXT: (local.get $16) - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $42) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (select ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $40) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $42) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $40) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $41) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $41) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: (local.get $16) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.xor - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 65536) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $22) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.xor + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 65536) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $22) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $24) - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $24) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 32) - ;; CHECK-NEXT: (local.get $16) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.xor - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 8192) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once49 - ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: (local.get $16) ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.xor + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 8192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once49 + ;; CHECK-NEXT: (select ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (if (result f64) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block (result f64) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $21) - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (local.set $14 + ;; CHECK-NEXT: (if (result f64) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 28) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 28) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f64.mul + ;; CHECK-NEXT: (local.get $25) + ;; CHECK-NEXT: (f64.const 268435456) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.mul - ;; CHECK-NEXT: (local.get $25) - ;; CHECK-NEXT: (f64.const 268435456) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result f64) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $25) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $25) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $43) - ;; CHECK-NEXT: (local.get $44) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $43) + ;; CHECK-NEXT: (local.get $44) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in60 - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (f64.ne - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -2147483648) + ;; CHECK-NEXT: (loop $while-in60 + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.tee $5 ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (f64.ge + ;; CHECK-NEXT: (f64.ne + ;; CHECK-NEXT: (local.get $14) ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.const 2147483648) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -2147483648) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (f64.le - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.const -2147483649) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.const -2147483648) - ;; CHECK-NEXT: (i32.trunc_f64_s - ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (f64.ge + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.const 2147483648) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const -2147483648) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (f64.le + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.const -2147483649) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const -2147483648) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.trunc_f64_s + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in60 - ;; CHECK-NEXT: (f64.ne - ;; CHECK-NEXT: (local.tee $14 - ;; CHECK-NEXT: (f64.mul - ;; CHECK-NEXT: (f64.sub - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (f64.convert_i32_u - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (br_if $while-in60 + ;; CHECK-NEXT: (f64.ne + ;; CHECK-NEXT: (local.tee $14 + ;; CHECK-NEXT: (f64.mul + ;; CHECK-NEXT: (f64.sub + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (f64.convert_i32_u + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f64.const 1e9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.const 1e9) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (f64.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.tee $11 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in62 - ;; CHECK-NEXT: (local.set $18 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.const 29) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.const 29) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.tee $11 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (loop $while-in62 + ;; CHECK-NEXT: (local.set $18 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.const 29) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.const 29) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once63 - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in66 - ;; CHECK-NEXT: (global.set $tempRet0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.tee $20 - ;; CHECK-NEXT: (call $_bitshift64Shl - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once63 + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in66 + ;; CHECK-NEXT: (global.set $tempRet0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.tee $20 + ;; CHECK-NEXT: (call $_bitshift64Shl + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.tee $12 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $18) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (global.get $tempRet0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $12 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (call $___uremdi3 + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (local.tee $20 + ;; CHECK-NEXT: (global.get $tempRet0) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1000000000) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.get $tempRet0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (call $___uremdi3 - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (local.tee $20 - ;; CHECK-NEXT: (global.get $tempRet0) + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (call $___udivmoddi4 + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: (i32.const 1000000000) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in66 + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1000000000) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (call $___udivmoddi4 - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (local.get $20) - ;; CHECK-NEXT: (i32.const 1000000000) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (br_if $do-once63 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in66 - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.tee $5 ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once63 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in68 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in68 ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $11 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in68) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $21) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in68) + ;; CHECK-NEXT: (local.get $18) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $21) - ;; CHECK-NEXT: (local.tee $11 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $21) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (br_if $while-in62 + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in62 - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.set $19 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $19 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.const 6) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $20 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.div_s - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $19) - ;; CHECK-NEXT: (i32.const 25) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $20 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.div_s + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $19) + ;; CHECK-NEXT: (i32.const 25) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $31 - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $26) - ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: (local.set $31 + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $26) + ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (loop $while-in70 (result i32) - ;; CHECK-NEXT: (local.set $18 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (loop $while-in70 (result i32) + ;; CHECK-NEXT: (local.set $18 + ;; CHECK-NEXT: (select ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once71 - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $34 - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.const 1000000000) - ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in74 - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.tee $11 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once71 + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.get $18) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $34 + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.const 1000000000) ;; CHECK-NEXT: (local.get $18) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in74 + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $34) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in74 + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $34) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in74 - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $do-once71 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (select ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once71 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.set $12 ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $31) + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $20) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (local.tee $11 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $21) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (local.get $18) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $20) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $21) - ;; CHECK-NEXT: (local.tee $11 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $21) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in70) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in70) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $20 - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.set $20 + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once75 - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once75 + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once75 - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (br_if $do-once75 + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in78 - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in78 - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (loop $while-in78 + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in78 + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $19) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $26) - ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $19) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.get $26) + ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.tee $31 - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $19) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.tee $31 + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.get $19) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $34 - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $26) - ;; CHECK-NEXT: (i32.const 103) + ;; CHECK-NEXT: (local.tee $34 + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $26) + ;; CHECK-NEXT: (i32.const 103) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $20) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.div_s - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 9216) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.rem_s + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.div_s + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: (i32.const 9216) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.rem_s + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in80 + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in80 - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (loop $while-in80 + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in80 + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (local.tee $18 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $20) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (local.tee $18 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 4092) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4092) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (i32.rem_u - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.tee $26 - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.rem_u + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once81 - ;; CHECK-NEXT: (local.set $35 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (i32.div_u - ;; CHECK-NEXT: (local.get $18) - ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.tee $26 + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (if (result f64) - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.tee $45 - ;; CHECK-NEXT: (i32.div_s - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once81 + ;; CHECK-NEXT: (local.set $35 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.div_u + ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.const 0.5) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (f64.const 1) - ;; CHECK-NEXT: (f64.const 1.5) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $26) - ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.set $14 + ;; CHECK-NEXT: (if (result f64) + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.get $45) + ;; CHECK-NEXT: (local.tee $45 + ;; CHECK-NEXT: (i32.div_s + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (f64.const 0.5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: (f64.const 1.5) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $26) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $45) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $25 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (f64.const 9007199254740994) - ;; CHECK-NEXT: (f64.const 9007199254740992) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $35) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.set $25 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (f64.const 9007199254740994) + ;; CHECK-NEXT: (f64.const 9007199254740992) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $35) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $28) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.load8_s - ;; CHECK-NEXT: (local.get $30) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $28) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.load8_s + ;; CHECK-NEXT: (local.get $30) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 45) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $25 + ;; CHECK-NEXT: (f64.neg + ;; CHECK-NEXT: (local.get $25) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $14 + ;; CHECK-NEXT: (f64.neg + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 45) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $25 - ;; CHECK-NEXT: (f64.neg - ;; CHECK-NEXT: (local.get $25) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (f64.neg + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $do-once81 + ;; CHECK-NEXT: (f64.eq + ;; CHECK-NEXT: (f64.add + ;; CHECK-NEXT: (local.get $25) ;; CHECK-NEXT: (local.get $14) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $25) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $18) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once81 - ;; CHECK-NEXT: (f64.eq - ;; CHECK-NEXT: (f64.add - ;; CHECK-NEXT: (local.get $25) - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $25) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 999999999) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in86 ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 999999999) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $while-in86 + ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in86 + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 999999999) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (i32.shr_s ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $20) ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (br_if $do-once81 + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $8 ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in86 - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 999999999) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $20) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once81 - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (loop $while-in88 + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in88 - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in88 - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.tee $12 - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (br_if $while-in88 + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.tee $12 + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.set $12 ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $35 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.set $35 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (loop $while-in90 (result i32) - ;; CHECK-NEXT: (block $while-out89 (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.le_u - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $26 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out89 + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (loop $while-in90 (result i32) + ;; CHECK-NEXT: (block $while-out89 (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.le_u ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $26 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-out89 ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $26 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $26 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in90) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in90) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 32) - ;; CHECK-NEXT: (local.get $16) - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: (local.tee $8 ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.get $34) - ;; CHECK-NEXT: (block $do-once91 (result i32) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $31) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (local.get $34) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once91 (result i32) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $19) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $19) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.const -5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const -5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $19 - ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $19 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $15) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $19 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (br_if $do-once91 - ;; CHECK-NEXT: (local.get $19) - ;; CHECK-NEXT: (local.tee $18 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $26) - ;; CHECK-NEXT: (block $do-once93 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.tee $15 - ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $19 ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (br_if $do-once91 + ;; CHECK-NEXT: (local.get $19) + ;; CHECK-NEXT: (local.tee $18 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once93) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.rem_u - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $26) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $do-once93 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.tee $15 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once93) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.rem_u + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once93) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once93) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (loop $while-in96 + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in96 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.rem_u + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in96 - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in96 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.rem_u - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $20) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (i32.const 102) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 32) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 102) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $18 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $19) - ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $18 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $19) ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.ge_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.ge_s + ;; CHECK-NEXT: (i32.gt_s ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $19) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $19) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $18 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $19) - ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $18 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $19) ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.ge_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.ge_s + ;; CHECK-NEXT: (i32.gt_s ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $19) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $19) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $18 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $18 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $19) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $19) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $28) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.tee $19 - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $28) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.tee $31 - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.tee $19 + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $15 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (local.tee $31 + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 102) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $15 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (select ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $24) - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (call $_fmt_u - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $35) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $24) + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (call $_fmt_u + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $35) ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: (local.get $24) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $24) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in98 - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $while-in98 + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in98 + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $24) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in98 - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $24) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 43) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.tee $15 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 43) + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.tee $15 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $24) + ;; CHECK-NEXT: (local.get $15) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $24) - ;; CHECK-NEXT: (local.get $15) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $30) - ;; CHECK-NEXT: (local.get $28) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $30) + ;; CHECK-NEXT: (local.get $28) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: (local.get $16) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.xor - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 65536) + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.xor + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 65536) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $31) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.tee $12 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $20) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $31) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.tee $12 + ;; CHECK-NEXT: (select ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in102 - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (call $_fmt_u - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (loop $while-in102 + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (call $_fmt_u + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $27) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $27) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once103 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br_if $do-once103 - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $27) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $32) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $32) + ;; CHECK-NEXT: (block $do-once103 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br_if $do-once103 - ;; CHECK-NEXT: (i32.le_u - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $do-once103 + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $27) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in106 ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $32) ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in106 - ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br_if $do-once103 + ;; CHECK-NEXT: (i32.le_u ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: (local.get $22) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in106 + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in106 + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $27) - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $27) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.le_u - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.le_u + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $20) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $20) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in102) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in102) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $19) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $19) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (i32.const 4143) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (i32.const 4143) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in110 (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (call $_fmt_u - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $while-in110 (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (call $_fmt_u + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $27) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $27) + ;; CHECK-NEXT: (local.get $22) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $22) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in112 - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $while-in112 + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in112 + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in112 - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.gt_s ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in110) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in110) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once99 - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.ge_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $20 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $26) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $18 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $do-once99 + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.ge_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in114 (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (call $_fmt_u - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $27) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $20 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $26) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $27) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.get $32) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $32) + ;; CHECK-NEXT: (local.set $18 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $18) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once115 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in114 (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (call $_fmt_u ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once115 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $18) - ;; CHECK-NEXT: (i32.le_s - ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $27) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $27) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once115 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.get $32) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (i32.const 4143) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (br_if $do-once115 - ;; CHECK-NEXT: (i32.le_u - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: (block $do-once115 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in118 - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: (br_if $do-once115 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (i32.le_s + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $do-once115 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (i32.const 4143) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in118 - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br_if $do-once115 + ;; CHECK-NEXT: (i32.le_u + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in118 + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $while-in118 + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $22) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $27) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $27) + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.gt_s - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in114 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.gt_s + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $20) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.ge_s - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (br_if $while-in114 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $20) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.ge_s + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 18) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 18) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 18) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 18) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once99 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (br_if $do-once99 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 32) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $24) - ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $24) + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_pad - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 32) - ;; CHECK-NEXT: (local.get $16) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.xor - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 8192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $16) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (call $_pad + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 32) + ;; CHECK-NEXT: (local.get $16) ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.xor + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 8192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (select ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $16) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (call $_pad ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 32) @@ -8188,7 +8590,7 @@ ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (call $___fwritex ;; CHECK-NEXT: (local.get $30) @@ -8233,11 +8635,13 @@ ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -8299,7 +8703,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $11 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.get $15) @@ -8368,13 +8772,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $11 ;; CHECK-NEXT: (i32.const 4091) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $11 ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.shr_s @@ -8389,7 +8793,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $23) ;; CHECK-NEXT: ) @@ -8433,7 +8837,7 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) @@ -8477,7 +8881,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) @@ -8501,7 +8905,7 @@ ;; CHECK-NEXT: (i32.load8_u ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $__rjto$06 ;; CHECK-NEXT: (block $__rjti$07 ;; CHECK-NEXT: (br_if $__rjti$07 @@ -8531,7 +8935,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $8) @@ -8559,7 +8963,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $9 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -8705,7 +9109,7 @@ ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $17 ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) @@ -8721,7 +9125,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -8771,11 +9175,13 @@ ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $33) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $33) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -8794,7 +9200,9 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -8849,27 +9257,29 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $23) - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $23) + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (local.get $23) ;; CHECK-NEXT: ) @@ -8911,11 +9321,13 @@ ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -8945,11 +9357,13 @@ ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $___fwritex - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $15) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $___fwritex + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $15) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -8978,96 +9392,104 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in130 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (call $_pop_arg_336 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in130 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in130 - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_pop_arg_336 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.shl ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L343) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in132 (result i32) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (br_if $while-in130 + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L343) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in132 - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $while-in132 (result i32) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L343) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (br_if $while-in132 + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -9139,7 +9561,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (local.set $20 (i32.add @@ -9282,25 +9706,31 @@ (local.get $16) (i32.const -1) ) - (local.set $16 - (if (result i32) - (i32.gt_s - (local.get $10) - (i32.sub - (i32.const 2147483647) - (local.get $16) + (then + (local.set $16 + (if (result i32) + (i32.gt_s + (local.get $10) + (i32.sub + (i32.const 2147483647) + (local.get $16) + ) ) - ) - (block (result i32) - (i32.store - (call $___errno_location) - (i32.const 75) + (then + (block (result i32) + (i32.store + (call $___errno_location) + (i32.const 75) + ) + (i32.const -1) + ) + ) + (else + (i32.add + (local.get $10) + (local.get $16) + ) ) - (i32.const -1) - ) - (i32.add - (local.get $10) - (local.get $16) ) ) ) @@ -9397,20 +9827,24 @@ ) (if (local.get $29) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) + (then + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) ) - (i32.const 32) ) - ) - (drop - (call $___fwritex - (local.get $5) - (local.get $7) - (local.get $0) + (then + (drop + (call $___fwritex + (local.get $5) + (local.get $7) + (local.get $0) + ) + ) ) ) ) @@ -9420,14 +9854,16 @@ (local.get $10) (local.get $5) ) - (block - (local.set $5 - (local.get $6) - ) - (local.set $10 - (local.get $7) + (then + (block + (local.set $5 + (local.get $6) + ) + (local.set $10 + (local.get $7) + ) + (br $label$continue$L1) ) - (br $label$continue$L1) ) ) (local.set $8 @@ -9450,49 +9886,53 @@ ) (i32.const 10) ) - (block (result i32) - (local.set $6 - (i32.load8_s - (local.tee $10 - (select - (i32.add - (local.get $6) - (i32.const 3) - ) - (local.get $10) - (local.tee $11 - (i32.eq - (i32.load8_s offset=2 - (local.get $6) + (then + (block (result i32) + (local.set $6 + (i32.load8_s + (local.tee $10 + (select + (i32.add + (local.get $6) + (i32.const 3) + ) + (local.get $10) + (local.tee $11 + (i32.eq + (i32.load8_s offset=2 + (local.get $6) + ) + (i32.const 36) ) - (i32.const 36) ) ) ) ) ) - ) - (local.set $17 + (local.set $17 + (select + (local.get $8) + (i32.const -1) + (local.get $11) + ) + ) (select - (local.get $8) - (i32.const -1) + (i32.const 1) + (local.get $1) (local.get $11) ) ) - (select - (i32.const 1) - (local.get $1) - (local.get $11) - ) ) - (block (result i32) - (local.set $6 - (local.get $11) - ) - (local.set $17 - (i32.const -1) + (else + (block (result i32) + (local.set $6 + (local.get $11) + ) + (local.set $17 + (i32.const -1) + ) + (local.get $1) ) - (local.get $1) ) ) ) @@ -9513,88 +9953,94 @@ ) (i32.const 32) ) - (block - (local.set $1 - (local.get $6) - ) - (local.set $6 - (local.get $11) - ) - (local.set $11 - (i32.const 0) - ) - (loop $while-in4 - (if - (i32.eqz - (i32.and - (i32.shl - (i32.const 1) - (i32.add - (local.get $6) - (i32.const -32) + (then + (block + (local.set $1 + (local.get $6) + ) + (local.set $6 + (local.get $11) + ) + (local.set $11 + (i32.const 0) + ) + (loop $while-in4 + (if + (i32.eqz + (i32.and + (i32.shl + (i32.const 1) + (i32.add + (local.get $6) + (i32.const -32) + ) ) + (i32.const 75913) ) - (i32.const 75913) ) - ) - (block - (local.set $6 - (local.get $1) - ) - (local.set $1 - (local.get $11) + (then + (block + (local.set $6 + (local.get $1) + ) + (local.set $1 + (local.get $11) + ) + (br $label$break$L25) + ) ) - (br $label$break$L25) ) - ) - (local.set $11 - (i32.or - (i32.shl - (i32.const 1) - (i32.add - (i32.shr_s - (i32.shl - (local.get $1) + (local.set $11 + (i32.or + (i32.shl + (i32.const 1) + (i32.add + (i32.shr_s + (i32.shl + (local.get $1) + (i32.const 24) + ) (i32.const 24) ) - (i32.const 24) + (i32.const -32) ) - (i32.const -32) ) + (local.get $11) ) - (local.get $11) ) - ) - (br_if $while-in4 - (i32.eq - (i32.and - (local.tee $6 - (local.tee $1 - (i32.load8_s - (local.tee $10 - (i32.add - (local.get $10) - (i32.const 1) + (br_if $while-in4 + (i32.eq + (i32.and + (local.tee $6 + (local.tee $1 + (i32.load8_s + (local.tee $10 + (i32.add + (local.get $10) + (i32.const 1) + ) ) ) ) ) + (i32.const -32) ) - (i32.const -32) + (i32.const 32) ) - (i32.const 32) ) - ) - (local.set $6 - (local.get $1) - ) - (local.set $1 - (local.get $11) + (local.set $6 + (local.get $1) + ) + (local.set $1 + (local.get $11) + ) ) ) ) - (local.set $1 - (i32.const 0) + (else + (local.set $1 + (i32.const 0) + ) ) ) ) @@ -9607,230 +10053,263 @@ ) (i32.const 42) ) - (block - (local.set $10 - (block $__rjto$0 (result i32) - (block $__rjti$0 - (br_if $__rjti$0 - (i32.ge_u - (local.tee $11 - (i32.add - (i32.load8_s - (local.tee $6 - (i32.add - (local.get $10) - (i32.const 1) + (then + (block + (local.set $10 + (block $__rjto$0 (result i32) + (block $__rjti$0 + (br_if $__rjti$0 + (i32.ge_u + (local.tee $11 + (i32.add + (i32.load8_s + (local.tee $6 + (i32.add + (local.get $10) + (i32.const 1) + ) ) ) + (i32.const -48) ) - (i32.const -48) ) + (i32.const 10) ) - (i32.const 10) ) - ) - (br_if $__rjti$0 - (i32.ne - (i32.load8_s offset=2 - (local.get $10) + (br_if $__rjti$0 + (i32.ne + (i32.load8_s offset=2 + (local.get $10) + ) + (i32.const 36) ) - (i32.const 36) ) - ) - (i32.store - (i32.add - (local.get $4) - (i32.shl - (local.get $11) - (i32.const 2) + (i32.store + (i32.add + (local.get $4) + (i32.shl + (local.get $11) + (i32.const 2) + ) ) + (i32.const 10) ) - (i32.const 10) - ) - (drop - (i32.load offset=4 - (local.tee $6 - (i32.add - (local.get $3) - (i32.shl - (i32.add - (i32.load8_s - (local.get $6) + (drop + (i32.load offset=4 + (local.tee $6 + (i32.add + (local.get $3) + (i32.shl + (i32.add + (i32.load8_s + (local.get $6) + ) + (i32.const -48) ) - (i32.const -48) + (i32.const 3) ) - (i32.const 3) ) ) ) ) - ) - (local.set $8 - (i32.const 1) - ) - (local.set $14 - (i32.load - (local.get $6) + (local.set $8 + (i32.const 1) ) - ) - (br $__rjto$0 - (i32.add - (local.get $10) - (i32.const 3) + (local.set $14 + (i32.load + (local.get $6) + ) ) - ) - ) - (if - (local.get $8) - (block - (local.set $16 - (i32.const -1) + (br $__rjto$0 + (i32.add + (local.get $10) + (i32.const 3) + ) ) - (br $label$break$L1) ) - ) - (if - (i32.eqz - (local.get $29) - ) - (block - (local.set $11 - (local.get $1) - ) - (local.set $10 - (local.get $6) + (if + (local.get $8) + (then + (block + (local.set $16 + (i32.const -1) + ) + (br $label$break$L1) + ) ) - (local.set $1 - (i32.const 0) + ) + (if + (i32.eqz + (local.get $29) ) - (local.set $14 - (i32.const 0) + (then + (block + (local.set $11 + (local.get $1) + ) + (local.set $10 + (local.get $6) + ) + (local.set $1 + (i32.const 0) + ) + (local.set $14 + (i32.const 0) + ) + (br $do-once5) + ) ) - (br $do-once5) ) - ) - (local.set $14 - (i32.load - (local.tee $10 - (i32.and - (i32.add - (i32.load - (local.get $2) + (local.set $14 + (i32.load + (local.tee $10 + (i32.and + (i32.add + (i32.load + (local.get $2) + ) + (i32.const 3) ) - (i32.const 3) + (i32.const -4) ) - (i32.const -4) ) ) ) - ) - (i32.store - (local.get $2) - (i32.add - (local.get $10) - (i32.const 4) + (i32.store + (local.get $2) + (i32.add + (local.get $10) + (i32.const 4) + ) ) + (local.set $8 + (i32.const 0) + ) + (local.get $6) ) - (local.set $8 - (i32.const 0) - ) - (local.get $6) ) - ) - (local.set $11 - (if (result i32) - (i32.lt_s - (local.get $14) - (i32.const 0) - ) - (block (result i32) - (local.set $14 - (i32.sub - (i32.const 0) - (local.get $14) + (local.set $11 + (if (result i32) + (i32.lt_s + (local.get $14) + (i32.const 0) + ) + (then + (block (result i32) + (local.set $14 + (i32.sub + (i32.const 0) + (local.get $14) + ) + ) + (i32.or + (local.get $1) + (i32.const 8192) + ) ) ) - (i32.or + (else (local.get $1) - (i32.const 8192) ) ) - (local.get $1) ) - ) - (local.set $1 - (local.get $8) + (local.set $1 + (local.get $8) + ) ) ) - (if - (i32.lt_u - (local.tee $6 - (i32.add - (i32.shr_s - (i32.shl - (local.get $6) + (else + (if + (i32.lt_u + (local.tee $6 + (i32.add + (i32.shr_s + (i32.shl + (local.get $6) + (i32.const 24) + ) (i32.const 24) ) - (i32.const 24) + (i32.const -48) ) - (i32.const -48) ) + (i32.const 10) ) - (i32.const 10) - ) - (block - (local.set $11 - (i32.const 0) - ) - (loop $while-in8 - (local.set $6 - (i32.add - (i32.mul - (local.get $11) - (i32.const 10) - ) - (local.get $6) + (then + (block + (local.set $11 + (i32.const 0) ) - ) - (if - (i32.lt_u - (local.tee $9 + (loop $while-in8 + (local.set $6 (i32.add - (i32.load8_s - (local.tee $10 - (i32.add - (local.get $10) - (i32.const 1) + (i32.mul + (local.get $11) + (i32.const 10) + ) + (local.get $6) + ) + ) + (if + (i32.lt_u + (local.tee $9 + (i32.add + (i32.load8_s + (local.tee $10 + (i32.add + (local.get $10) + (i32.const 1) + ) + ) ) + (i32.const -48) ) ) - (i32.const -48) + (i32.const 10) + ) + (then + (block + (local.set $11 + (local.get $6) + ) + (local.set $6 + (local.get $9) + ) + (br $while-in8) + ) ) ) - (i32.const 10) ) - (block - (local.set $11 + (if + (i32.lt_s (local.get $6) + (i32.const 0) ) - (local.set $6 - (local.get $9) + (then + (block + (local.set $16 + (i32.const -1) + ) + (br $label$break$L1) + ) + ) + (else + (block + (local.set $11 + (local.get $1) + ) + (local.set $1 + (local.get $8) + ) + (local.set $14 + (local.get $6) + ) + ) ) - (br $while-in8) ) ) ) - (if - (i32.lt_s - (local.get $6) - (i32.const 0) - ) - (block - (local.set $16 - (i32.const -1) - ) - (br $label$break$L1) - ) + (else (block (local.set $11 (local.get $1) @@ -9839,22 +10318,11 @@ (local.get $8) ) (local.set $14 - (local.get $6) + (i32.const 0) ) ) ) ) - (block - (local.set $11 - (local.get $1) - ) - (local.set $1 - (local.get $8) - ) - (local.set $14 - (i32.const 0) - ) - ) ) ) ) @@ -9867,207 +10335,227 @@ ) (i32.const 46) ) - (block (result i32) - (if - (i32.ne - (local.tee $8 - (i32.load8_s - (local.tee $6 - (i32.add - (local.get $10) - (i32.const 1) + (then + (block (result i32) + (if + (i32.ne + (local.tee $8 + (i32.load8_s + (local.tee $6 + (i32.add + (local.get $10) + (i32.const 1) + ) ) ) ) + (i32.const 42) ) - (i32.const 42) - ) - (block - (if - (i32.lt_u - (local.tee $9 - (i32.add - (local.get $8) - (i32.const -48) - ) - ) - (i32.const 10) - ) - (block - (local.set $10 - (local.get $6) - ) - (local.set $8 - (i32.const 0) - ) - (local.set $6 - (local.get $9) - ) - ) + (then (block - (local.set $10 - (local.get $6) - ) - (br $label$break$L46 - (i32.const 0) - ) - ) - ) - (loop $while-in11 - (drop - (br_if $label$break$L46 - (local.tee $6 - (i32.add - (i32.mul + (if + (i32.lt_u + (local.tee $9 + (i32.add (local.get $8) - (i32.const 10) + (i32.const -48) ) - (local.get $6) ) + (i32.const 10) ) - (i32.ge_u - (local.tee $9 - (i32.add - (i32.load8_s - (local.tee $10 - (i32.add - (local.get $10) - (i32.const 1) + (then + (block + (local.set $10 + (local.get $6) + ) + (local.set $8 + (i32.const 0) + ) + (local.set $6 + (local.get $9) + ) + ) + ) + (else + (block + (local.set $10 + (local.get $6) + ) + (br $label$break$L46 + (i32.const 0) + ) + ) + ) + ) + (loop $while-in11 + (drop + (br_if $label$break$L46 + (local.tee $6 + (i32.add + (i32.mul + (local.get $8) + (i32.const 10) + ) + (local.get $6) + ) + ) + (i32.ge_u + (local.tee $9 + (i32.add + (i32.load8_s + (local.tee $10 + (i32.add + (local.get $10) + (i32.const 1) + ) + ) ) + (i32.const -48) ) ) - (i32.const -48) + (i32.const 10) ) ) - (i32.const 10) ) + (local.set $8 + (local.get $6) + ) + (local.set $6 + (local.get $9) + ) + (br $while-in11) ) ) - (local.set $8 - (local.get $6) - ) - (local.set $6 - (local.get $9) - ) - (br $while-in11) ) ) - ) - (if - (i32.lt_u - (local.tee $8 - (i32.add - (i32.load8_s - (local.tee $6 - (i32.add - (local.get $10) - (i32.const 2) + (if + (i32.lt_u + (local.tee $8 + (i32.add + (i32.load8_s + (local.tee $6 + (i32.add + (local.get $10) + (i32.const 2) + ) ) ) + (i32.const -48) ) - (i32.const -48) ) + (i32.const 10) ) - (i32.const 10) - ) - (if - (i32.eq - (i32.load8_s offset=3 - (local.get $10) - ) - (i32.const 36) - ) - (block - (i32.store - (i32.add - (local.get $4) - (i32.shl - (local.get $8) - (i32.const 2) + (then + (if + (i32.eq + (i32.load8_s offset=3 + (local.get $10) ) + (i32.const 36) ) - (i32.const 10) - ) - (drop - (i32.load offset=4 - (local.tee $6 - (i32.add - (local.get $3) - (i32.shl - (i32.add - (i32.load8_s - (local.get $6) + (then + (block + (i32.store + (i32.add + (local.get $4) + (i32.shl + (local.get $8) + (i32.const 2) + ) + ) + (i32.const 10) + ) + (drop + (i32.load offset=4 + (local.tee $6 + (i32.add + (local.get $3) + (i32.shl + (i32.add + (i32.load8_s + (local.get $6) + ) + (i32.const -48) + ) + (i32.const 3) + ) ) - (i32.const -48) ) - (i32.const 3) + ) + ) + (local.set $10 + (i32.add + (local.get $10) + (i32.const 4) + ) + ) + (br $label$break$L46 + (i32.load + (local.get $6) ) ) ) ) ) - (local.set $10 - (i32.add - (local.get $10) - (i32.const 4) - ) - ) - (br $label$break$L46 - (i32.load - (local.get $6) - ) - ) ) ) - ) - (if - (local.get $1) - (block - (local.set $16 - (i32.const -1) + (if + (local.get $1) + (then + (block + (local.set $16 + (i32.const -1) + ) + (br $label$break$L1) + ) ) - (br $label$break$L1) ) - ) - (if (result i32) - (local.get $29) - (block (result i32) - (local.set $8 - (i32.load - (local.tee $10 - (i32.and - (i32.add - (i32.load - (local.get $2) + (if (result i32) + (local.get $29) + (then + (block (result i32) + (local.set $8 + (i32.load + (local.tee $10 + (i32.and + (i32.add + (i32.load + (local.get $2) + ) + (i32.const 3) + ) + (i32.const -4) ) - (i32.const 3) ) - (i32.const -4) ) ) + (i32.store + (local.get $2) + (i32.add + (local.get $10) + (i32.const 4) + ) + ) + (local.set $10 + (local.get $6) + ) + (local.get $8) ) ) - (i32.store - (local.get $2) - (i32.add - (local.get $10) - (i32.const 4) + (else + (block (result i32) + (local.set $10 + (local.get $6) + ) + (i32.const 0) ) ) - (local.set $10 - (local.get $6) - ) - (local.get $8) - ) - (block (result i32) - (local.set $10 - (local.get $6) - ) - (i32.const 0) ) ) ) - (i32.const -1) + (else + (i32.const -1) + ) ) ) ) @@ -10090,11 +10578,13 @@ ) (i32.const 57) ) - (block - (local.set $16 - (i32.const -1) + (then + (block + (local.set $16 + (i32.const -1) + ) + (br $label$break$L1) ) - (br $label$break$L1) ) ) (local.set $10 @@ -10129,17 +10619,21 @@ ) (i32.const 8) ) - (block - (local.set $8 - (local.get $10) - ) - (local.set $9 - (local.get $12) + (then + (block + (local.set $8 + (local.get $10) + ) + (local.set $9 + (local.get $12) + ) + (br $while-in13) ) - (br $while-in13) ) - (local.set $18 - (local.get $8) + (else + (local.set $18 + (local.get $8) + ) ) ) ) @@ -10150,11 +10644,13 @@ (i32.const 255) ) ) - (block - (local.set $16 - (i32.const -1) + (then + (block + (local.set $16 + (i32.const -1) + ) + (br $label$break$L1) ) - (br $label$break$L1) ) ) (local.set $8 @@ -10173,74 +10669,86 @@ ) (i32.const 19) ) - (if - (local.get $8) - (block - (local.set $16 - (i32.const -1) - ) - (br $label$break$L1) - ) - (br $__rjti$2) - ) - (block + (then (if (local.get $8) - (block - (i32.store - (i32.add - (local.get $4) - (i32.shl - (local.get $17) - (i32.const 2) - ) + (then + (block + (local.set $16 + (i32.const -1) ) - (local.get $12) + (br $label$break$L1) ) - (local.set $13 - (i32.load offset=4 - (local.tee $12 + ) + (else + (br $__rjti$2) + ) + ) + ) + (else + (block + (if + (local.get $8) + (then + (block + (i32.store (i32.add - (local.get $3) + (local.get $4) (i32.shl (local.get $17) - (i32.const 3) + (i32.const 2) ) ) + (local.get $12) + ) + (local.set $13 + (i32.load offset=4 + (local.tee $12 + (i32.add + (local.get $3) + (i32.shl + (local.get $17) + (i32.const 3) + ) + ) + ) + ) + ) + (i32.store + (local.tee $8 + (local.get $19) + ) + (i32.load + (local.get $12) + ) ) + (i32.store offset=4 + (local.get $8) + (local.get $13) + ) + (br $__rjti$2) ) ) - (i32.store - (local.tee $8 - (local.get $19) - ) - (i32.load - (local.get $12) - ) + ) + (if + (i32.eqz + (local.get $29) ) - (i32.store offset=4 - (local.get $8) - (local.get $13) + (then + (block + (local.set $16 + (i32.const 0) + ) + (br $label$break$L1) + ) ) - (br $__rjti$2) ) - ) - (if - (i32.eqz - (local.get $29) - ) - (block - (local.set $16 - (i32.const 0) - ) - (br $label$break$L1) + (call $_pop_arg_336 + (local.get $19) + (local.get $12) + (local.get $2) ) ) - (call $_pop_arg_336 - (local.get $19) - (local.get $12) - (local.get $2) - ) ) ) (br $__rjto$2) @@ -10249,14 +10757,16 @@ (i32.eqz (local.get $29) ) - (block - (local.set $5 - (local.get $10) - ) - (local.set $10 - (local.get $7) + (then + (block + (local.set $5 + (local.get $10) + ) + (local.set $10 + (local.get $7) + ) + (br $label$continue$L1) ) - (br $label$continue$L1) ) ) ) @@ -10521,50 +11031,54 @@ ) ) ) - (local.set $8 - (local.get $26) - ) - (block - (local.set $5 - (local.get $7) - ) - (local.set $7 - (local.get $8) - ) + (then (local.set $8 (local.get $26) ) - (loop $while-in32 - (i32.store8 - (local.tee $8 - (i32.add - (local.get $8) - (i32.const -1) + ) + (else + (block + (local.set $5 + (local.get $7) + ) + (local.set $7 + (local.get $8) + ) + (local.set $8 + (local.get $26) + ) + (loop $while-in32 + (i32.store8 + (local.tee $8 + (i32.add + (local.get $8) + (i32.const -1) + ) ) - ) - (i32.or - (i32.and - (local.get $5) - (i32.const 7) + (i32.or + (i32.and + (local.get $5) + (i32.const 7) + ) + (i32.const 48) ) - (i32.const 48) ) - ) - (br_if $while-in32 - (i32.eqz - (i32.and - (i32.eqz - (local.tee $5 - (call $_bitshift64Lshr - (local.get $5) - (local.get $7) - (i32.const 3) + (br_if $while-in32 + (i32.eqz + (i32.and + (i32.eqz + (local.tee $5 + (call $_bitshift64Lshr + (local.get $5) + (local.get $7) + (i32.const 3) + ) ) ) - ) - (i32.eqz - (local.tee $7 - (global.get $tempRet0) + (i32.eqz + (local.tee $7 + (global.get $tempRet0) + ) ) ) ) @@ -10579,35 +11093,39 @@ (local.get $11) (i32.const 8) ) - (block (result i32) - (local.set $7 - (local.get $11) - ) - (local.set $6 - (select - (local.tee $11 - (i32.add - (i32.sub - (local.get $39) - (local.get $8) + (then + (block (result i32) + (local.set $7 + (local.get $11) + ) + (local.set $6 + (select + (local.tee $11 + (i32.add + (i32.sub + (local.get $39) + (local.get $8) + ) + (i32.const 1) ) - (i32.const 1) ) - ) - (local.get $6) - (i32.lt_s (local.get $6) - (local.get $11) + (i32.lt_s + (local.get $6) + (local.get $11) + ) ) ) + (local.get $8) ) - (local.get $8) ) - (block (result i32) - (local.set $7 - (local.get $11) + (else + (block (result i32) + (local.set $7 + (local.get $11) + ) + (local.get $8) ) - (local.get $8) ) ) ) @@ -10635,33 +11153,35 @@ ) (i32.const 0) ) - (block - (i32.store - (local.tee $8 - (local.get $19) + (then + (block + (i32.store + (local.tee $8 + (local.get $19) + ) + (local.tee $5 + (call $_i64Subtract + (i32.const 0) + (i32.const 0) + (local.get $5) + (local.get $7) + ) + ) ) - (local.tee $5 - (call $_i64Subtract - (i32.const 0) - (i32.const 0) - (local.get $5) - (local.get $7) + (i32.store offset=4 + (local.get $8) + (local.tee $7 + (global.get $tempRet0) ) ) - ) - (i32.store offset=4 - (local.get $8) - (local.tee $7 - (global.get $tempRet0) + (local.set $8 + (i32.const 1) ) + (local.set $9 + (i32.const 4091) + ) + (br $__rjti$4) ) - (local.set $8 - (i32.const 1) - ) - (local.set $9 - (i32.const 4091) - ) - (br $__rjti$4) ) ) (local.set $9 @@ -10670,25 +11190,29 @@ (local.get $11) (i32.const 2048) ) - (block (result i32) - (local.set $8 - (i32.const 1) + (then + (block (result i32) + (local.set $8 + (i32.const 1) + ) + (i32.const 4092) ) - (i32.const 4092) ) - (block (result i32) - (local.set $8 - (local.tee $9 - (i32.and - (local.get $11) - (i32.const 1) + (else + (block (result i32) + (local.set $8 + (local.tee $9 + (i32.and + (local.get $11) + (i32.const 1) + ) ) ) - ) - (select - (i32.const 4093) - (i32.const 4091) - (local.get $9) + (select + (i32.const 4093) + (i32.const 4091) + (local.get $9) + ) ) ) ) @@ -10797,24 +11321,28 @@ ) (if (local.get $6) - (block - (local.set $8 - (local.get $6) + (then + (block + (local.set $8 + (local.get $6) + ) + (br $__rjti$6) ) - (br $__rjti$6) ) - (block - (call $_pad - (local.get $0) - (i32.const 32) - (local.get $14) - (i32.const 0) - (local.get $11) - ) - (local.set $7 - (i32.const 0) + (else + (block + (call $_pad + (local.get $0) + (i32.const 32) + (local.get $14) + (i32.const 0) + (local.get $11) + ) + (local.set $7 + (i32.const 0) + ) + (br $__rjti$7) ) - (br $__rjti$7) ) ) ) @@ -10844,41 +11372,49 @@ ) (i32.const 0) ) - (block (result i32) - (local.set $27 - (i32.const 1) - ) - (local.set $15 - (f64.neg - (local.get $15) - ) - ) - (i32.const 4108) - ) - (if (result i32) - (i32.and - (local.get $11) - (i32.const 2048) - ) + (then (block (result i32) (local.set $27 (i32.const 1) ) - (i32.const 4111) + (local.set $15 + (f64.neg + (local.get $15) + ) + ) + (i32.const 4108) ) - (block (result i32) - (local.set $27 - (local.tee $5 - (i32.and - (local.get $11) + ) + (else + (if (result i32) + (i32.and + (local.get $11) + (i32.const 2048) + ) + (then + (block (result i32) + (local.set $27 (i32.const 1) ) + (i32.const 4111) ) ) - (select - (i32.const 4114) - (i32.const 4109) - (local.get $5) + (else + (block (result i32) + (local.set $27 + (local.tee $5 + (i32.and + (local.get $11) + (i32.const 1) + ) + ) + ) + (select + (i32.const 4114) + (i32.const 4109) + (local.get $5) + ) + ) ) ) ) @@ -10916,2124 +11452,2096 @@ (i32.const 0) ) ) - (block (result i32) - (if - (local.tee $5 - (f64.ne - (local.tee $23 - (f64.mul - (call $_frexp - (local.get $15) - (local.tee $5 - (local.get $20) + (then + (block (result i32) + (if + (local.tee $5 + (f64.ne + (local.tee $23 + (f64.mul + (call $_frexp + (local.get $15) + (local.tee $5 + (local.get $20) + ) ) + (f64.const 2) ) - (f64.const 2) ) + (f64.const 0) ) - (f64.const 0) ) - ) - (i32.store - (local.get $20) - (i32.add - (i32.load + (then + (i32.store (local.get $20) - ) - (i32.const -1) - ) - ) - ) - (if - (i32.eq - (local.tee $24 - (i32.or - (local.get $18) - (i32.const 32) - ) - ) - (i32.const 97) - ) - (block - (local.set $9 - (select (i32.add - (local.get $31) - (i32.const 9) - ) - (local.get $31) - (local.tee $13 - (i32.and - (local.get $18) - (i32.const 32) + (i32.load + (local.get $20) ) + (i32.const -1) ) ) ) - (local.set $15 - (if (result f64) + ) + (if + (i32.eq + (local.tee $24 (i32.or - (i32.gt_u - (local.get $6) - (i32.const 11) - ) - (i32.eqz - (local.tee $5 - (i32.sub - (i32.const 12) - (local.get $6) - ) - ) - ) + (local.get $18) + (i32.const 32) ) - (local.get $23) - (block (result f64) - (local.set $15 - (f64.const 8) - ) - (loop $while-in54 - (local.set $15 - (f64.mul - (local.get $15) - (f64.const 16) - ) + ) + (i32.const 97) + ) + (then + (block + (local.set $9 + (select + (i32.add + (local.get $31) + (i32.const 9) ) - (br_if $while-in54 - (local.tee $5 - (i32.add - (local.get $5) - (i32.const -1) - ) + (local.get $31) + (local.tee $13 + (i32.and + (local.get $18) + (i32.const 32) ) ) ) + ) + (local.set $15 (if (result f64) - (i32.eq - (i32.load8_s - (local.get $9) + (i32.or + (i32.gt_u + (local.get $6) + (i32.const 11) ) - (i32.const 45) - ) - (f64.neg - (f64.add - (local.get $15) - (f64.sub - (f64.neg - (local.get $23) + (i32.eqz + (local.tee $5 + (i32.sub + (i32.const 12) + (local.get $6) ) - (local.get $15) ) ) ) - (f64.sub - (f64.add - (local.get $23) - (local.get $15) + (then + (local.get $23) + ) + (else + (block (result f64) + (local.set $15 + (f64.const 8) + ) + (loop $while-in54 + (local.set $15 + (f64.mul + (local.get $15) + (f64.const 16) + ) + ) + (br_if $while-in54 + (local.tee $5 + (i32.add + (local.get $5) + (i32.const -1) + ) + ) + ) + ) + (if (result f64) + (i32.eq + (i32.load8_s + (local.get $9) + ) + (i32.const 45) + ) + (then + (f64.neg + (f64.add + (local.get $15) + (f64.sub + (f64.neg + (local.get $23) + ) + (local.get $15) + ) + ) + ) + ) + (else + (f64.sub + (f64.add + (local.get $23) + (local.get $15) + ) + (local.get $15) + ) + ) + ) ) - (local.get $15) ) ) ) - ) - ) - (if - (i32.eq - (local.tee $5 - (call $_fmt_u + (if + (i32.eq (local.tee $5 - (select - (i32.sub - (i32.const 0) - (local.tee $7 - (i32.load - (local.get $20) + (call $_fmt_u + (local.tee $5 + (select + (i32.sub + (i32.const 0) + (local.tee $7 + (i32.load + (local.get $20) + ) + ) + ) + (local.get $7) + (i32.lt_s + (local.get $7) + (i32.const 0) ) ) ) - (local.get $7) - (i32.lt_s - (local.get $7) - (i32.const 0) + (i32.shr_s + (i32.shl + (i32.lt_s + (local.get $5) + (i32.const 0) + ) + (i32.const 31) + ) + (i32.const 31) ) + (local.get $34) ) ) - (i32.shr_s - (i32.shl - (i32.lt_s - (local.get $5) - (i32.const 0) - ) - (i32.const 31) + (local.get $34) + ) + (then + (block + (i32.store8 + (local.get $42) + (i32.const 48) + ) + (local.set $5 + (local.get $42) ) - (i32.const 31) ) - (local.get $34) ) ) - (local.get $34) - ) - (block + (local.set $12 + (i32.or + (local.get $27) + (i32.const 2) + ) + ) (i32.store8 - (local.get $42) - (i32.const 48) + (i32.add + (local.get $5) + (i32.const -1) + ) + (i32.add + (i32.and + (i32.shr_s + (local.get $7) + (i32.const 31) + ) + (i32.const 2) + ) + (i32.const 43) + ) ) - (local.set $5 - (local.get $42) + (i32.store8 + (local.tee $8 + (i32.add + (local.get $5) + (i32.const -2) + ) + ) + (i32.add + (local.get $18) + (i32.const 15) + ) ) - ) - ) - (local.set $12 - (i32.or - (local.get $27) - (i32.const 2) - ) - ) - (i32.store8 - (i32.add - (local.get $5) - (i32.const -1) - ) - (i32.add - (i32.and - (i32.shr_s - (local.get $7) - (i32.const 31) + (local.set $18 + (i32.lt_s + (local.get $6) + (i32.const 1) ) - (i32.const 2) ) - (i32.const 43) - ) - ) - (i32.store8 - (local.tee $8 - (i32.add - (local.get $5) - (i32.const -2) + (local.set $17 + (i32.eqz + (i32.and + (local.get $11) + (i32.const 8) + ) + ) ) - ) - (i32.add - (local.get $18) - (i32.const 15) - ) - ) - (local.set $18 - (i32.lt_s - (local.get $6) - (i32.const 1) - ) - ) - (local.set $17 - (i32.eqz - (i32.and - (local.get $11) - (i32.const 8) + (local.set $5 + (local.get $22) ) - ) - ) - (local.set $5 - (local.get $22) - ) - (loop $while-in56 - (i32.store8 - (local.get $5) - (i32.or - (i32.load8_u - (i32.add - (local.tee $7 - (call $f64-to-int - (local.get $15) + (loop $while-in56 + (i32.store8 + (local.get $5) + (i32.or + (i32.load8_u + (i32.add + (local.tee $7 + (call $f64-to-int + (local.get $15) + ) + ) + (i32.const 4075) ) ) - (i32.const 4075) + (local.get $13) ) ) - (local.get $13) - ) - ) - (local.set $15 - (f64.mul - (f64.sub - (local.get $15) - (f64.convert_i32_s - (local.get $7) + (local.set $15 + (f64.mul + (f64.sub + (local.get $15) + (f64.convert_i32_s + (local.get $7) + ) + ) + (f64.const 16) ) ) - (f64.const 16) - ) - ) - (local.set $5 - (block $do-once57 (result i32) - (if (result i32) - (i32.eq - (i32.sub - (local.tee $7 - (i32.add - (local.get $5) - (i32.const 1) + (local.set $5 + (block $do-once57 (result i32) + (if (result i32) + (i32.eq + (i32.sub + (local.tee $7 + (i32.add + (local.get $5) + (i32.const 1) + ) + ) + (local.get $37) ) + (i32.const 1) + ) + (then + (block (result i32) + (drop + (br_if $do-once57 + (local.get $7) + (i32.and + (local.get $17) + (i32.and + (local.get $18) + (f64.eq + (local.get $15) + (f64.const 0) + ) + ) + ) + ) + ) + (i32.store8 + (local.get $7) + (i32.const 46) + ) + (i32.add + (local.get $5) + (i32.const 2) + ) + ) + ) + (else + (local.get $7) ) - (local.get $37) ) - (i32.const 1) ) - (block (result i32) - (drop - (br_if $do-once57 - (local.get $7) + ) + (br_if $while-in56 + (f64.ne + (local.get $15) + (f64.const 0) + ) + ) + ) + (call $_pad + (local.get $0) + (i32.const 32) + (local.get $14) + (local.tee $7 + (i32.add + (local.tee $6 + (select + (i32.sub + (i32.add + (local.get $47) + (local.get $6) + ) + (local.get $8) + ) + (i32.add + (i32.sub + (local.get $45) + (local.get $8) + ) + (local.get $5) + ) (i32.and - (local.get $17) - (i32.and - (local.get $18) - (f64.eq - (local.get $15) - (f64.const 0) + (i32.ne + (local.get $6) + (i32.const 0) + ) + (i32.lt_s + (i32.add + (local.get $46) + (local.get $5) ) + (local.get $6) ) ) ) ) - (i32.store8 - (local.get $7) - (i32.const 46) + (local.get $12) + ) + ) + (local.get $11) + ) + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) ) - (i32.add - (local.get $5) - (i32.const 2) + (i32.const 32) + ) + ) + (then + (drop + (call $___fwritex + (local.get $9) + (local.get $12) + (local.get $0) ) ) - (local.get $7) ) ) - ) - (br_if $while-in56 - (f64.ne - (local.get $15) - (f64.const 0) + (call $_pad + (local.get $0) + (i32.const 48) + (local.get $14) + (local.get $7) + (i32.xor + (local.get $11) + (i32.const 65536) + ) ) - ) - ) - (call $_pad - (local.get $0) - (i32.const 32) - (local.get $14) - (local.tee $7 - (i32.add - (local.tee $6 - (select - (i32.sub - (i32.add - (local.get $47) - (local.get $6) - ) - (local.get $8) + (local.set $5 + (i32.sub + (local.get $5) + (local.get $37) + ) + ) + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) ) - (i32.add - (i32.sub - (local.get $45) - (local.get $8) - ) + (i32.const 32) + ) + ) + (then + (drop + (call $___fwritex + (local.get $22) (local.get $5) + (local.get $0) ) - (i32.and - (i32.ne - (local.get $6) - (i32.const 0) - ) - (i32.lt_s - (i32.add - (local.get $46) - (local.get $5) - ) - (local.get $6) + ) + ) + ) + (call $_pad + (local.get $0) + (i32.const 48) + (i32.sub + (local.get $6) + (i32.add + (local.get $5) + (local.tee $5 + (i32.sub + (local.get $28) + (local.get $8) ) ) ) ) - (local.get $12) + (i32.const 0) + (i32.const 0) ) - ) - (local.get $11) - ) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) + ) ) - (i32.const 32) - ) - ) - (drop - (call $___fwritex - (local.get $9) - (local.get $12) - (local.get $0) - ) - ) - ) - (call $_pad - (local.get $0) - (i32.const 48) - (local.get $14) - (local.get $7) - (i32.xor - (local.get $11) - (i32.const 65536) - ) - ) - (local.set $5 - (i32.sub - (local.get $5) - (local.get $37) - ) - ) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) + (then + (drop + (call $___fwritex + (local.get $8) + (local.get $5) + (local.get $0) + ) + ) ) - (i32.const 32) ) - ) - (drop - (call $___fwritex - (local.get $22) - (local.get $5) + (call $_pad (local.get $0) + (i32.const 32) + (local.get $14) + (local.get $7) + (i32.xor + (local.get $11) + (i32.const 8192) + ) ) - ) - ) - (call $_pad - (local.get $0) - (i32.const 48) - (i32.sub - (local.get $6) - (i32.add - (local.get $5) - (local.tee $5 - (i32.sub - (local.get $28) - (local.get $8) + (br $do-once49 + (select + (local.get $14) + (local.get $7) + (i32.lt_s + (local.get $7) + (local.get $14) ) ) ) ) - (i32.const 0) - (i32.const 0) ) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) + ) + (local.set $15 + (if (result f64) + (local.get $5) + (then + (block (result f64) + (i32.store + (local.get $20) + (local.tee $5 + (i32.add + (i32.load + (local.get $20) + ) + (i32.const -28) + ) + ) + ) + (f64.mul + (local.get $23) + (f64.const 268435456) ) - (i32.const 32) - ) - ) - (drop - (call $___fwritex - (local.get $8) - (local.get $5) - (local.get $0) - ) - ) - ) - (call $_pad - (local.get $0) - (i32.const 32) - (local.get $14) - (local.get $7) - (i32.xor - (local.get $11) - (i32.const 8192) - ) - ) - (br $do-once49 - (select - (local.get $14) - (local.get $7) - (i32.lt_s - (local.get $7) - (local.get $14) ) ) - ) - ) - ) - (local.set $15 - (if (result f64) - (local.get $5) - (block (result f64) - (i32.store - (local.get $20) - (local.tee $5 - (i32.add + (else + (block (result f64) + (local.set $5 (i32.load (local.get $20) ) - (i32.const -28) ) + (local.get $23) ) ) - (f64.mul - (local.get $23) - (f64.const 268435456) - ) ) - (block (result f64) - (local.set $5 - (i32.load - (local.get $20) + ) + (local.set $7 + (local.tee $8 + (select + (local.get $48) + (local.get $49) + (i32.lt_s + (local.get $5) + (i32.const 0) ) ) - (local.get $23) ) ) - ) - (local.set $7 - (local.tee $8 - (select - (local.get $48) - (local.get $49) - (i32.lt_s - (local.get $5) - (i32.const 0) + (loop $while-in60 + (i32.store + (local.get $7) + (local.tee $5 + (call $f64-to-int + (local.get $15) + ) ) ) - ) - ) - (loop $while-in60 - (i32.store - (local.get $7) - (local.tee $5 - (call $f64-to-int - (local.get $15) + (local.set $7 + (i32.add + (local.get $7) + (i32.const 4) ) ) - ) - (local.set $7 - (i32.add - (local.get $7) - (i32.const 4) - ) - ) - (br_if $while-in60 - (f64.ne - (local.tee $15 - (f64.mul - (f64.sub - (local.get $15) - (f64.convert_i32_u - (local.get $5) + (br_if $while-in60 + (f64.ne + (local.tee $15 + (f64.mul + (f64.sub + (local.get $15) + (f64.convert_i32_u + (local.get $5) + ) ) + (f64.const 1e9) ) - (f64.const 1e9) ) + (f64.const 0) ) - (f64.const 0) ) ) - ) - (if - (i32.gt_s - (local.tee $9 - (i32.load - (local.get $20) + (if + (i32.gt_s + (local.tee $9 + (i32.load + (local.get $20) + ) ) + (i32.const 0) ) - (i32.const 0) - ) - (block - (local.set $5 - (local.get $8) - ) - (loop $while-in62 - (local.set $13 - (select - (i32.const 29) - (local.get $9) - (i32.gt_s - (local.get $9) - (i32.const 29) - ) + (then + (block + (local.set $5 + (local.get $8) ) - ) - (block $do-once63 - (if - (i32.ge_u - (local.tee $9 - (i32.add - (local.get $7) - (i32.const -4) + (loop $while-in62 + (local.set $13 + (select + (i32.const 29) + (local.get $9) + (i32.gt_s + (local.get $9) + (i32.const 29) ) ) - (local.get $5) ) - (block - (local.set $12 - (i32.const 0) - ) - (loop $while-in66 - (i32.store - (local.get $9) - (call $___uremdi3 - (local.tee $12 - (call $_i64Add - (call $_bitshift64Shl - (i32.load - (local.get $9) + (block $do-once63 + (if + (i32.ge_u + (local.tee $9 + (i32.add + (local.get $7) + (i32.const -4) + ) + ) + (local.get $5) + ) + (then + (block + (local.set $12 + (i32.const 0) + ) + (loop $while-in66 + (i32.store + (local.get $9) + (call $___uremdi3 + (local.tee $12 + (call $_i64Add + (call $_bitshift64Shl + (i32.load + (local.get $9) + ) + (i32.const 0) + (local.get $13) + ) + (global.get $tempRet0) + (local.get $12) + (i32.const 0) + ) ) + (local.tee $17 + (global.get $tempRet0) + ) + (i32.const 1000000000) (i32.const 0) - (local.get $13) ) - (global.get $tempRet0) - (local.get $12) - (i32.const 0) + ) + (local.set $12 + (call $___udivdi3 + (local.get $12) + (local.get $17) + (i32.const 1000000000) + (i32.const 0) + ) + ) + (br_if $while-in66 + (i32.ge_u + (local.tee $9 + (i32.add + (local.get $9) + (i32.const -4) + ) + ) + (local.get $5) + ) ) ) - (local.tee $17 - (global.get $tempRet0) + (br_if $do-once63 + (i32.eqz + (local.get $12) + ) ) - (i32.const 1000000000) - (i32.const 0) - ) - ) - (local.set $12 - (call $___udivdi3 - (local.get $12) - (local.get $17) - (i32.const 1000000000) - (i32.const 0) - ) - ) - (br_if $while-in66 - (i32.ge_u - (local.tee $9 - (i32.add - (local.get $9) - (i32.const -4) + (i32.store + (local.tee $5 + (i32.add + (local.get $5) + (i32.const -4) + ) ) + (local.get $12) ) - (local.get $5) ) ) ) - (br_if $do-once63 - (i32.eqz - (local.get $12) + ) + (loop $while-in68 + (if + (i32.gt_u + (local.get $7) + (local.get $5) ) - ) - (i32.store - (local.tee $5 - (i32.add - (local.get $5) - (i32.const -4) + (then + (if + (i32.eqz + (i32.load + (local.tee $9 + (i32.add + (local.get $7) + (i32.const -4) + ) + ) + ) + ) + (then + (block + (local.set $7 + (local.get $9) + ) + (br $while-in68) + ) + ) ) ) - (local.get $12) ) ) - ) - ) - (loop $while-in68 - (if - (i32.gt_u - (local.get $7) - (local.get $5) - ) - (if - (i32.eqz - (i32.load - (local.tee $9 - (i32.add - (local.get $7) - (i32.const -4) - ) + (i32.store + (local.get $20) + (local.tee $9 + (i32.sub + (i32.load + (local.get $20) ) + (local.get $13) ) ) - (block - (local.set $7 - (local.get $9) - ) - (br $while-in68) - ) ) - ) - ) - (i32.store - (local.get $20) - (local.tee $9 - (i32.sub - (i32.load - (local.get $20) + (br_if $while-in62 + (i32.gt_s + (local.get $9) + (i32.const 0) ) - (local.get $13) ) ) ) - (br_if $while-in62 - (i32.gt_s - (local.get $9) - (i32.const 0) - ) + ) + (else + (local.set $5 + (local.get $8) ) ) ) - (local.set $5 - (local.get $8) + (local.set $17 + (select + (i32.const 6) + (local.get $6) + (i32.lt_s + (local.get $6) + (i32.const 0) + ) + ) ) - ) - (local.set $17 - (select - (i32.const 6) - (local.get $6) + (if (i32.lt_s - (local.get $6) + (local.get $9) (i32.const 0) ) - ) - ) - (if - (i32.lt_s - (local.get $9) - (i32.const 0) - ) - (block - (local.set $21 - (i32.add - (call $i32s-div + (then + (block + (local.set $21 (i32.add - (local.get $17) - (i32.const 25) - ) - (i32.const 9) - ) - (i32.const 1) - ) - ) - (local.set $32 - (i32.eq - (local.get $24) - (i32.const 102) - ) - ) - (local.set $6 - (local.get $5) - ) - (local.set $5 - (local.get $7) - ) - (loop $while-in70 - (local.set $13 - (select - (i32.const 9) - (local.tee $7 - (i32.sub - (i32.const 0) - (local.get $9) + (call $i32s-div + (i32.add + (local.get $17) + (i32.const 25) + ) + (i32.const 9) ) - ) - (i32.gt_s - (local.get $7) - (i32.const 9) + (i32.const 1) ) ) - ) - (block $do-once71 - (if - (i32.lt_u - (local.get $6) - (local.get $5) + (local.set $32 + (i32.eq + (local.get $24) + (i32.const 102) ) - (block - (local.set $12 - (i32.add - (i32.shl - (i32.const 1) - (local.get $13) + ) + (local.set $6 + (local.get $5) + ) + (local.set $5 + (local.get $7) + ) + (loop $while-in70 + (local.set $13 + (select + (i32.const 9) + (local.tee $7 + (i32.sub + (i32.const 0) + (local.get $9) ) - (i32.const -1) ) - ) - (local.set $38 - (i32.shr_u - (i32.const 1000000000) - (local.get $13) + (i32.gt_s + (local.get $7) + (i32.const 9) ) ) - (local.set $9 - (i32.const 0) - ) - (local.set $7 - (local.get $6) - ) - (loop $while-in74 - (i32.store - (local.get $7) - (i32.add - (i32.shr_u - (local.tee $33 + ) + (block $do-once71 + (if + (i32.lt_u + (local.get $6) + (local.get $5) + ) + (then + (block + (local.set $12 + (i32.add + (i32.shl + (i32.const 1) + (local.get $13) + ) + (i32.const -1) + ) + ) + (local.set $38 + (i32.shr_u + (i32.const 1000000000) + (local.get $13) + ) + ) + (local.set $9 + (i32.const 0) + ) + (local.set $7 + (local.get $6) + ) + (loop $while-in74 + (i32.store + (local.get $7) + (i32.add + (i32.shr_u + (local.tee $33 + (i32.load + (local.get $7) + ) + ) + (local.get $13) + ) + (local.get $9) + ) + ) + (local.set $9 + (i32.mul + (i32.and + (local.get $33) + (local.get $12) + ) + (local.get $38) + ) + ) + (br_if $while-in74 + (i32.lt_u + (local.tee $7 + (i32.add + (local.get $7) + (i32.const 4) + ) + ) + (local.get $5) + ) + ) + ) + (local.set $7 + (select + (local.get $6) + (i32.add + (local.get $6) + (i32.const 4) + ) (i32.load - (local.get $7) + (local.get $6) ) ) - (local.get $13) ) - (local.get $9) - ) - ) - (local.set $9 - (i32.mul - (i32.and - (local.get $33) - (local.get $12) + (br_if $do-once71 + (i32.eqz + (local.get $9) + ) + ) + (i32.store + (local.get $5) + (local.get $9) + ) + (local.set $5 + (i32.add + (local.get $5) + (i32.const 4) + ) ) - (local.get $38) ) ) - (br_if $while-in74 - (i32.lt_u - (local.tee $7 + (else + (local.set $7 + (select + (local.get $6) (i32.add - (local.get $7) + (local.get $6) (i32.const 4) ) + (i32.load + (local.get $6) + ) ) - (local.get $5) ) ) ) - (local.set $7 - (select - (local.get $6) - (i32.add - (local.get $6) - (i32.const 4) + ) + (local.set $12 + (select + (i32.add + (local.tee $6 + (select + (local.get $8) + (local.get $7) + (local.get $32) + ) ) - (i32.load - (local.get $6) + (i32.shl + (local.get $21) + (i32.const 2) ) ) - ) - (br_if $do-once71 - (i32.eqz - (local.get $9) - ) - ) - (i32.store (local.get $5) - (local.get $9) - ) - (local.set $5 - (i32.add - (local.get $5) - (i32.const 4) + (i32.gt_s + (i32.shr_s + (i32.sub + (local.get $5) + (local.get $6) + ) + (i32.const 2) + ) + (local.get $21) ) ) ) - (local.set $7 - (select - (local.get $6) + (i32.store + (local.get $20) + (local.tee $9 (i32.add - (local.get $6) - (i32.const 4) - ) - (i32.load - (local.get $6) + (i32.load + (local.get $20) + ) + (local.get $13) ) ) ) - ) - ) - (local.set $12 - (select - (i32.add - (local.tee $6 - (select - (local.get $8) - (local.get $7) - (local.get $32) - ) - ) - (i32.shl - (local.get $21) - (i32.const 2) + (if + (i32.lt_s + (local.get $9) + (i32.const 0) ) - ) - (local.get $5) - (i32.gt_s - (i32.shr_s - (i32.sub - (local.get $5) - (local.get $6) + (then + (block + (local.set $6 + (local.get $7) + ) + (local.set $5 + (local.get $12) + ) + (br $while-in70) ) - (i32.const 2) ) - (local.get $21) - ) - ) - ) - (i32.store - (local.get $20) - (local.tee $9 - (i32.add - (i32.load - (local.get $20) + (else + (block + (local.set $5 + (local.get $7) + ) + (local.set $9 + (local.get $12) + ) + ) ) - (local.get $13) ) ) ) - (if - (i32.lt_s - (local.get $9) - (i32.const 0) - ) - (block - (local.set $6 - (local.get $7) - ) - (local.set $5 - (local.get $12) - ) - (br $while-in70) - ) - (block - (local.set $5 - (local.get $7) - ) - (local.set $9 - (local.get $12) - ) - ) + ) + (else + (local.set $9 + (local.get $7) ) ) ) - (local.set $9 - (local.get $7) + (local.set $21 + (local.get $8) ) - ) - (local.set $21 - (local.get $8) - ) - (block $do-once75 - (if - (i32.lt_u - (local.get $5) - (local.get $9) - ) - (block - (local.set $7 - (i32.mul - (i32.shr_s - (i32.sub - (local.get $21) - (local.get $5) + (block $do-once75 + (if + (i32.lt_u + (local.get $5) + (local.get $9) + ) + (then + (block + (local.set $7 + (i32.mul + (i32.shr_s + (i32.sub + (local.get $21) + (local.get $5) + ) + (i32.const 2) + ) + (i32.const 9) ) - (i32.const 2) ) - (i32.const 9) - ) - ) - (br_if $do-once75 - (i32.lt_u - (local.tee $12 - (i32.load - (local.get $5) + (br_if $do-once75 + (i32.lt_u + (local.tee $12 + (i32.load + (local.get $5) + ) + ) + (i32.const 10) ) ) - (i32.const 10) - ) - ) - (local.set $6 - (i32.const 10) - ) - (loop $while-in78 - (local.set $7 - (i32.add - (local.get $7) - (i32.const 1) + (local.set $6 + (i32.const 10) ) - ) - (br_if $while-in78 - (i32.ge_u - (local.get $12) - (local.tee $6 - (i32.mul - (local.get $6) - (i32.const 10) + (loop $while-in78 + (local.set $7 + (i32.add + (local.get $7) + (i32.const 1) + ) + ) + (br_if $while-in78 + (i32.ge_u + (local.get $12) + (local.tee $6 + (i32.mul + (local.get $6) + (i32.const 10) + ) + ) ) ) ) ) ) - ) - (local.set $7 - (i32.const 0) + (else + (local.set $7 + (i32.const 0) + ) + ) ) ) - ) - (local.set $5 - (if (result i32) - (i32.lt_s - (local.tee $6 - (i32.add - (i32.sub - (local.get $17) - (select - (local.get $7) - (i32.const 0) - (i32.ne - (local.get $24) - (i32.const 102) + (local.set $5 + (if (result i32) + (i32.lt_s + (local.tee $6 + (i32.add + (i32.sub + (local.get $17) + (select + (local.get $7) + (i32.const 0) + (i32.ne + (local.get $24) + (i32.const 102) + ) ) ) - ) - (i32.shr_s - (i32.shl - (i32.and - (local.tee $32 - (i32.ne - (local.get $17) - (i32.const 0) + (i32.shr_s + (i32.shl + (i32.and + (local.tee $32 + (i32.ne + (local.get $17) + (i32.const 0) + ) ) - ) - (local.tee $38 - (i32.eq - (local.get $24) - (i32.const 103) + (local.tee $38 + (i32.eq + (local.get $24) + (i32.const 103) + ) ) ) + (i32.const 31) ) (i32.const 31) ) - (i32.const 31) ) ) - ) - (i32.add - (i32.mul - (i32.shr_s - (i32.sub - (local.get $9) - (local.get $21) - ) - (i32.const 2) - ) - (i32.const 9) - ) - (i32.const -9) - ) - ) - (block (result i32) - (local.set $13 - (call $i32s-div - (local.tee $6 - (i32.add - (local.get $6) - (i32.const 9216) + (i32.add + (i32.mul + (i32.shr_s + (i32.sub + (local.get $9) + (local.get $21) + ) + (i32.const 2) ) + (i32.const 9) ) - (i32.const 9) + (i32.const -9) ) ) - (if - (i32.lt_s - (local.tee $6 - (i32.add - (if (result i32) - (local.tee $12 - (i32.const 9) - ) - (i32.rem_s + (then + (block (result i32) + (local.set $13 + (call $i32s-div + (local.tee $6 + (i32.add (local.get $6) - (local.get $12) + (i32.const 9216) ) - (i32.const 0) ) - (i32.const 1) + (i32.const 9) ) ) - (i32.const 9) - ) - (block - (local.set $12 - (i32.const 10) - ) - (loop $while-in80 - (local.set $12 - (i32.mul - (local.get $12) - (i32.const 10) - ) - ) - (br_if $while-in80 - (i32.ne - (local.tee $6 - (i32.add - (local.get $6) - (i32.const 1) - ) - ) - (i32.const 9) - ) - ) - ) - ) - (local.set $12 - (i32.const 10) - ) - ) - (local.set $13 - (call $i32u-rem - (local.tee $24 - (i32.load + (if + (i32.lt_s (local.tee $6 (i32.add - (i32.add - (local.get $8) - (i32.shl - (local.get $13) - (i32.const 2) + (if (result i32) + (local.tee $12 + (i32.const 9) + ) + (then + (i32.rem_s + (local.get $6) + (local.get $12) + ) + ) + (else + (i32.const 0) ) ) - (i32.const -4092) + (i32.const 1) ) ) + (i32.const 9) ) - ) - (local.get $12) - ) - ) - (block $do-once81 - (if - (i32.eqz - (i32.and - (local.tee $33 - (i32.eq - (i32.add - (local.get $6) - (i32.const 4) + (then + (block + (local.set $12 + (i32.const 10) + ) + (loop $while-in80 + (local.set $12 + (i32.mul + (local.get $12) + (i32.const 10) + ) + ) + (br_if $while-in80 + (i32.ne + (local.tee $6 + (i32.add + (local.get $6) + (i32.const 1) + ) + ) + (i32.const 9) + ) ) - (local.get $9) ) ) - (i32.eqz - (local.get $13) - ) ) - ) - (block - (local.set $50 - (call $i32u-div - (local.get $24) - (local.get $12) + (else + (local.set $12 + (i32.const 10) ) ) - (local.set $15 - (if (result f64) - (i32.lt_u - (local.get $13) - (local.tee $51 - (call $i32s-div - (local.get $12) - (i32.const 2) - ) - ) - ) - (f64.const 0.5) - (select - (f64.const 1) - (f64.const 1.5) - (i32.and - (local.get $33) - (i32.eq - (local.get $13) - (local.get $51) + ) + (local.set $13 + (call $i32u-rem + (local.tee $24 + (i32.load + (local.tee $6 + (i32.add + (i32.add + (local.get $8) + (i32.shl + (local.get $13) + (i32.const 2) + ) + ) + (i32.const -4092) ) ) ) ) + (local.get $12) ) - (local.set $23 - (select - (f64.const 9007199254740994) - (f64.const 9007199254740992) + ) + (block $do-once81 + (if + (i32.eqz (i32.and - (local.get $50) - (i32.const 1) + (local.tee $33 + (i32.eq + (i32.add + (local.get $6) + (i32.const 4) + ) + (local.get $9) + ) + ) + (i32.eqz + (local.get $13) + ) ) ) - ) - (block $do-once83 - (if - (local.get $27) + (then (block - (br_if $do-once83 - (i32.ne - (i32.load8_s - (local.get $31) + (local.set $50 + (call $i32u-div + (local.get $24) + (local.get $12) + ) + ) + (local.set $15 + (if (result f64) + (i32.lt_u + (local.get $13) + (local.tee $51 + (call $i32s-div + (local.get $12) + (i32.const 2) + ) + ) + ) + (then + (f64.const 0.5) + ) + (else + (select + (f64.const 1) + (f64.const 1.5) + (i32.and + (local.get $33) + (i32.eq + (local.get $13) + (local.get $51) + ) + ) + ) ) - (i32.const 45) ) ) (local.set $23 - (f64.neg - (local.get $23) + (select + (f64.const 9007199254740994) + (f64.const 9007199254740992) + (i32.and + (local.get $50) + (i32.const 1) + ) ) ) - (local.set $15 - (f64.neg - (local.get $15) + (block $do-once83 + (if + (local.get $27) + (then + (block + (br_if $do-once83 + (i32.ne + (i32.load8_s + (local.get $31) + ) + (i32.const 45) + ) + ) + (local.set $23 + (f64.neg + (local.get $23) + ) + ) + (local.set $15 + (f64.neg + (local.get $15) + ) + ) + ) + ) ) ) - ) - ) - ) - (i32.store - (local.get $6) - (local.tee $13 - (i32.sub - (local.get $24) - (local.get $13) - ) - ) - ) - (br_if $do-once81 - (f64.eq - (f64.add - (local.get $23) - (local.get $15) - ) - (local.get $23) - ) - ) - (i32.store - (local.get $6) - (local.tee $7 - (i32.add - (local.get $13) - (local.get $12) - ) - ) - ) - (if - (i32.gt_u - (local.get $7) - (i32.const 999999999) - ) - (loop $while-in86 - (i32.store - (local.get $6) - (i32.const 0) - ) - (if - (i32.lt_u - (local.tee $6 - (i32.add - (local.get $6) - (i32.const -4) + (i32.store + (local.get $6) + (local.tee $13 + (i32.sub + (local.get $24) + (local.get $13) ) ) - (local.get $5) + ) + (br_if $do-once81 + (f64.eq + (f64.add + (local.get $23) + (local.get $15) + ) + (local.get $23) + ) ) (i32.store - (local.tee $5 + (local.get $6) + (local.tee $7 (i32.add - (local.get $5) - (i32.const -4) + (local.get $13) + (local.get $12) ) ) - (i32.const 0) ) - ) - (i32.store - (local.get $6) - (local.tee $7 - (i32.add - (i32.load - (local.get $6) + (if + (i32.gt_u + (local.get $7) + (i32.const 999999999) + ) + (then + (loop $while-in86 + (i32.store + (local.get $6) + (i32.const 0) + ) + (if + (i32.lt_u + (local.tee $6 + (i32.add + (local.get $6) + (i32.const -4) + ) + ) + (local.get $5) + ) + (then + (i32.store + (local.tee $5 + (i32.add + (local.get $5) + (i32.const -4) + ) + ) + (i32.const 0) + ) + ) + ) + (i32.store + (local.get $6) + (local.tee $7 + (i32.add + (i32.load + (local.get $6) + ) + (i32.const 1) + ) + ) + ) + (br_if $while-in86 + (i32.gt_u + (local.get $7) + (i32.const 999999999) + ) + ) ) - (i32.const 1) ) ) - ) - (br_if $while-in86 - (i32.gt_u - (local.get $7) - (i32.const 999999999) + (local.set $7 + (i32.mul + (i32.shr_s + (i32.sub + (local.get $21) + (local.get $5) + ) + (i32.const 2) + ) + (i32.const 9) + ) ) - ) - ) - ) - (local.set $7 - (i32.mul - (i32.shr_s - (i32.sub - (local.get $21) - (local.get $5) + (br_if $do-once81 + (i32.lt_u + (local.tee $13 + (i32.load + (local.get $5) + ) + ) + (i32.const 10) + ) ) - (i32.const 2) - ) - (i32.const 9) - ) - ) - (br_if $do-once81 - (i32.lt_u - (local.tee $13 - (i32.load - (local.get $5) + (local.set $12 + (i32.const 10) ) - ) - (i32.const 10) - ) - ) - (local.set $12 - (i32.const 10) - ) - (loop $while-in88 - (local.set $7 - (i32.add - (local.get $7) - (i32.const 1) - ) - ) - (br_if $while-in88 - (i32.ge_u - (local.get $13) - (local.tee $12 - (i32.mul - (local.get $12) - (i32.const 10) + (loop $while-in88 + (local.set $7 + (i32.add + (local.get $7) + (i32.const 1) + ) + ) + (br_if $while-in88 + (i32.ge_u + (local.get $13) + (local.tee $12 + (i32.mul + (local.get $12) + (i32.const 10) + ) + ) + ) ) ) ) ) ) ) + (local.set $12 + (local.get $5) + ) + (local.set $13 + (local.get $7) + ) + (select + (local.tee $5 + (i32.add + (local.get $6) + (i32.const 4) + ) + ) + (local.get $9) + (i32.gt_u + (local.get $9) + (local.get $5) + ) + ) ) ) - (local.set $12 - (local.get $5) - ) - (local.set $13 - (local.get $7) - ) - (select - (local.tee $5 - (i32.add - (local.get $6) - (i32.const 4) + (else + (block (result i32) + (local.set $12 + (local.get $5) + ) + (local.set $13 + (local.get $7) ) - ) - (local.get $9) - (i32.gt_u (local.get $9) - (local.get $5) ) ) ) - (block (result i32) - (local.set $12 - (local.get $5) - ) - (local.set $13 - (local.get $7) - ) - (local.get $9) - ) ) - ) - (local.set $33 - (i32.sub - (i32.const 0) - (local.get $13) + (local.set $33 + (i32.sub + (i32.const 0) + (local.get $13) + ) ) - ) - (loop $while-in90 - (block $while-out89 - (if - (i32.le_u - (local.get $5) - (local.get $12) - ) - (block - (local.set $24 - (i32.const 0) - ) - (local.set $9 + (loop $while-in90 + (block $while-out89 + (if + (i32.le_u (local.get $5) + (local.get $12) ) - (br $while-out89) - ) - ) - (if - (i32.load - (local.tee $7 - (i32.add - (local.get $5) - (i32.const -4) + (then + (block + (local.set $24 + (i32.const 0) + ) + (local.set $9 + (local.get $5) + ) + (br $while-out89) ) ) ) - (block - (local.set $24 - (i32.const 1) + (if + (i32.load + (local.tee $7 + (i32.add + (local.get $5) + (i32.const -4) + ) + ) ) - (local.set $9 - (local.get $5) + (then + (block + (local.set $24 + (i32.const 1) + ) + (local.set $9 + (local.get $5) + ) + ) ) - ) - (block - (local.set $5 - (local.get $7) + (else + (block + (local.set $5 + (local.get $7) + ) + (br $while-in90) + ) ) - (br $while-in90) ) ) ) - ) - (call $_pad - (local.get $0) - (i32.const 32) - (local.get $14) - (local.tee $13 - (i32.add + (call $_pad + (local.get $0) + (i32.const 32) + (local.get $14) + (local.tee $13 (i32.add (i32.add (i32.add - (local.get $27) - (i32.const 1) - ) - (local.tee $5 - (block $do-once91 (result i32) - (if (result i32) - (local.get $38) - (block (result i32) - (local.set $7 - (if (result i32) - (i32.and - (i32.gt_s - (local.tee $5 - (i32.add - (i32.xor - (local.get $32) - (i32.const 1) + (i32.add + (local.get $27) + (i32.const 1) + ) + (local.tee $5 + (block $do-once91 (result i32) + (if (result i32) + (local.get $38) + (then + (block (result i32) + (local.set $7 + (if (result i32) + (i32.and + (i32.gt_s + (local.tee $5 + (i32.add + (i32.xor + (local.get $32) + (i32.const 1) + ) + (local.get $17) + ) ) - (local.get $17) + (local.get $13) + ) + (i32.gt_s + (local.get $13) + (i32.const -5) ) ) - (local.get $13) - ) - (i32.gt_s - (local.get $13) - (i32.const -5) - ) - ) - (block (result i32) - (local.set $17 - (i32.sub - (i32.add - (local.get $5) - (i32.const -1) + (then + (block (result i32) + (local.set $17 + (i32.sub + (i32.add + (local.get $5) + (i32.const -1) + ) + (local.get $13) + ) + ) + (i32.add + (local.get $18) + (i32.const -1) + ) + ) + ) + (else + (block (result i32) + (local.set $17 + (i32.add + (local.get $5) + (i32.const -1) + ) + ) + (i32.add + (local.get $18) + (i32.const -2) + ) ) - (local.get $13) ) - ) - (i32.add - (local.get $18) - (i32.const -1) ) ) - (block (result i32) - (local.set $17 - (i32.add - (local.get $5) - (i32.const -1) + (if + (local.tee $5 + (i32.and + (local.get $11) + (i32.const 8) ) ) - (i32.add - (local.get $18) - (i32.const -2) + (then + (block + (local.set $21 + (local.get $5) + ) + (br $do-once91 + (local.get $17) + ) + ) ) ) - ) - ) - (if - (local.tee $5 - (i32.and - (local.get $11) - (i32.const 8) - ) - ) - (block - (local.set $21 - (local.get $5) - ) - (br $do-once91 - (local.get $17) - ) - ) - ) - (block $do-once93 - (if - (local.get $24) - (block + (block $do-once93 (if - (i32.eqz - (local.tee $18 - (i32.load - (i32.add - (local.get $9) - (i32.const -4) + (local.get $24) + (then + (block + (if + (i32.eqz + (local.tee $18 + (i32.load + (i32.add + (local.get $9) + (i32.const -4) + ) + ) + ) + ) + (then + (block + (local.set $5 + (i32.const 9) + ) + (br $do-once93) + ) + ) + ) + (if + (call $i32u-rem + (local.get $18) + (i32.const 10) + ) + (then + (block + (local.set $5 + (i32.const 0) + ) + (br $do-once93) + ) + ) + (else + (block + (local.set $6 + (i32.const 10) + ) + (local.set $5 + (i32.const 0) + ) + ) + ) + ) + (loop $while-in96 + (local.set $5 + (i32.add + (local.get $5) + (i32.const 1) + ) + ) + (br_if $while-in96 + (i32.eqz + (call $i32u-rem + (local.get $18) + (local.tee $6 + (i32.mul + (local.get $6) + (i32.const 10) + ) + ) + ) + ) ) ) ) ) - (block + (else (local.set $5 (i32.const 9) ) - (br $do-once93) ) ) - (if - (call $i32u-rem - (local.get $18) - (i32.const 10) - ) - (block - (local.set $5 - (i32.const 0) + ) + (local.set $6 + (i32.add + (i32.mul + (i32.shr_s + (i32.sub + (local.get $9) + (local.get $21) + ) + (i32.const 2) ) - (br $do-once93) + (i32.const 9) ) - (block - (local.set $6 - (i32.const 10) - ) - (local.set $5 - (i32.const 0) - ) + (i32.const -9) + ) + ) + (if (result i32) + (i32.eq + (i32.or + (local.get $7) + (i32.const 32) ) + (i32.const 102) ) - (loop $while-in96 - (local.set $5 - (i32.add - (local.get $5) - (i32.const 1) + (then + (block (result i32) + (local.set $21 + (i32.const 0) ) - ) - (br_if $while-in96 - (i32.eqz - (call $i32u-rem - (local.get $18) - (local.tee $6 - (i32.mul - (local.get $6) - (i32.const 10) + (select + (local.get $17) + (local.tee $5 + (select + (i32.const 0) + (local.tee $5 + (i32.sub + (local.get $6) + (local.get $5) + ) + ) + (i32.lt_s + (local.get $5) + (i32.const 0) ) ) ) - ) - ) - ) - ) - (local.set $5 - (i32.const 9) - ) - ) - ) - (local.set $6 - (i32.add - (i32.mul - (i32.shr_s - (i32.sub - (local.get $9) - (local.get $21) - ) - (i32.const 2) - ) - (i32.const 9) - ) - (i32.const -9) - ) - ) - (if (result i32) - (i32.eq - (i32.or - (local.get $7) - (i32.const 32) - ) - (i32.const 102) - ) - (block (result i32) - (local.set $21 - (i32.const 0) - ) - (select - (local.get $17) - (local.tee $5 - (select - (i32.const 0) - (local.tee $5 - (i32.sub - (local.get $6) + (i32.lt_s + (local.get $17) (local.get $5) ) ) - (i32.lt_s - (local.get $5) - (i32.const 0) - ) ) ) - (i32.lt_s - (local.get $17) - (local.get $5) - ) - ) - ) - (block (result i32) - (local.set $21 - (i32.const 0) - ) - (select - (local.get $17) - (local.tee $5 - (select - (i32.const 0) - (local.tee $5 - (i32.sub - (i32.add - (local.get $6) - (local.get $13) + (else + (block (result i32) + (local.set $21 + (i32.const 0) + ) + (select + (local.get $17) + (local.tee $5 + (select + (i32.const 0) + (local.tee $5 + (i32.sub + (i32.add + (local.get $6) + (local.get $13) + ) + (local.get $5) + ) + ) + (i32.lt_s + (local.get $5) + (i32.const 0) + ) ) + ) + (i32.lt_s + (local.get $17) (local.get $5) ) ) - (i32.lt_s - (local.get $5) - (i32.const 0) - ) ) ) - (i32.lt_s - (local.get $17) - (local.get $5) - ) ) ) ) - ) - (block (result i32) - (local.set $21 - (i32.and - (local.get $11) - (i32.const 8) + (else + (block (result i32) + (local.set $21 + (i32.and + (local.get $11) + (i32.const 8) + ) + ) + (local.set $7 + (local.get $18) + ) + (local.get $17) ) ) - (local.set $7 - (local.get $18) - ) - (local.get $17) ) ) ) ) - ) - (i32.ne - (local.tee $32 - (i32.or - (local.get $5) - (local.get $21) + (i32.ne + (local.tee $32 + (i32.or + (local.get $5) + (local.get $21) + ) ) + (i32.const 0) ) - (i32.const 0) ) - ) - (if (result i32) - (local.tee $17 - (i32.eq - (i32.or - (local.get $7) - (i32.const 32) + (if (result i32) + (local.tee $17 + (i32.eq + (i32.or + (local.get $7) + (i32.const 32) + ) + (i32.const 102) ) - (i32.const 102) - ) - ) - (block (result i32) - (local.set $18 - (i32.const 0) ) - (select - (local.get $13) - (i32.const 0) - (i32.gt_s - (local.get $13) - (i32.const 0) + (then + (block (result i32) + (local.set $18 + (i32.const 0) + ) + (select + (local.get $13) + (i32.const 0) + (i32.gt_s + (local.get $13) + (i32.const 0) + ) + ) ) ) - ) - (block (result i32) - (if - (i32.lt_s - (i32.sub - (local.get $28) - (local.tee $6 - (call $_fmt_u + (else + (block (result i32) + (if + (i32.lt_s + (i32.sub + (local.get $28) (local.tee $6 - (select - (local.get $33) - (local.get $13) - (i32.lt_s - (local.get $13) - (i32.const 0) + (call $_fmt_u + (local.tee $6 + (select + (local.get $33) + (local.get $13) + (i32.lt_s + (local.get $13) + (i32.const 0) + ) + ) ) + (i32.shr_s + (i32.shl + (i32.lt_s + (local.get $6) + (i32.const 0) + ) + (i32.const 31) + ) + (i32.const 31) + ) + (local.get $34) ) ) - (i32.shr_s - (i32.shl - (i32.lt_s + ) + (i32.const 2) + ) + (then + (loop $while-in98 + (i32.store8 + (local.tee $6 + (i32.add (local.get $6) - (i32.const 0) + (i32.const -1) ) - (i32.const 31) ) - (i32.const 31) + (i32.const 48) + ) + (br_if $while-in98 + (i32.lt_s + (i32.sub + (local.get $28) + (local.get $6) + ) + (i32.const 2) + ) ) - (local.get $34) ) ) ) - (i32.const 2) - ) - (loop $while-in98 (i32.store8 - (local.tee $6 - (i32.add - (local.get $6) - (i32.const -1) + (i32.add + (local.get $6) + (i32.const -1) + ) + (i32.add + (i32.and + (i32.shr_s + (local.get $13) + (i32.const 31) + ) + (i32.const 2) ) + (i32.const 43) ) - (i32.const 48) ) - (br_if $while-in98 - (i32.lt_s - (i32.sub - (local.get $28) + (i32.store8 + (local.tee $6 + (i32.add (local.get $6) + (i32.const -2) ) - (i32.const 2) ) + (local.get $7) ) - ) - ) - (i32.store8 - (i32.add - (local.get $6) - (i32.const -1) - ) - (i32.add - (i32.and - (i32.shr_s - (local.get $13) - (i32.const 31) - ) - (i32.const 2) + (local.set $18 + (local.get $6) ) - (i32.const 43) - ) - ) - (i32.store8 - (local.tee $6 - (i32.add + (i32.sub + (local.get $28) (local.get $6) - (i32.const -2) ) ) - (local.get $7) - ) - (local.set $18 - (local.get $6) - ) - (i32.sub - (local.get $28) - (local.get $6) ) ) ) ) + (local.get $11) ) - (local.get $11) - ) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) ) - (i32.const 32) ) - ) - (drop - (call $___fwritex - (local.get $31) - (local.get $27) - (local.get $0) + (then + (drop + (call $___fwritex + (local.get $31) + (local.get $27) + (local.get $0) + ) + ) ) ) - ) - (call $_pad - (local.get $0) - (i32.const 48) - (local.get $14) - (local.get $13) - (i32.xor - (local.get $11) - (i32.const 65536) + (call $_pad + (local.get $0) + (i32.const 48) + (local.get $14) + (local.get $13) + (i32.xor + (local.get $11) + (i32.const 65536) + ) ) - ) - (block $do-once99 - (if - (local.get $17) - (block - (local.set $6 - (local.tee $12 - (select - (local.get $8) - (local.get $12) - (i32.gt_u - (local.get $12) - (local.get $8) - ) - ) - ) - ) - (loop $while-in102 - (local.set $7 - (call $_fmt_u - (i32.load - (local.get $6) + (block $do-once99 + (if + (local.get $17) + (then + (block + (local.set $6 + (local.tee $12 + (select + (local.get $8) + (local.get $12) + (i32.gt_u + (local.get $12) + (local.get $8) + ) + ) ) - (i32.const 0) - (local.get $30) ) - ) - (block $do-once103 - (if - (i32.eq - (local.get $6) - (local.get $12) - ) - (block - (br_if $do-once103 - (i32.ne - (local.get $7) - (local.get $30) + (loop $while-in102 + (local.set $7 + (call $_fmt_u + (i32.load + (local.get $6) ) - ) - (i32.store8 - (local.get $35) - (i32.const 48) - ) - (local.set $7 - (local.get $35) + (i32.const 0) + (local.get $30) ) ) - (block - (br_if $do-once103 - (i32.le_u - (local.get $7) - (local.get $22) + (block $do-once103 + (if + (i32.eq + (local.get $6) + (local.get $12) ) - ) - (loop $while-in106 - (i32.store8 - (local.tee $7 - (i32.add - (local.get $7) - (i32.const -1) + (then + (block + (br_if $do-once103 + (i32.ne + (local.get $7) + (local.get $30) + ) + ) + (i32.store8 + (local.get $35) + (i32.const 48) + ) + (local.set $7 + (local.get $35) ) ) - (i32.const 48) ) - (br_if $while-in106 - (i32.gt_u - (local.get $7) - (local.get $22) + (else + (block + (br_if $do-once103 + (i32.le_u + (local.get $7) + (local.get $22) + ) + ) + (loop $while-in106 + (i32.store8 + (local.tee $7 + (i32.add + (local.get $7) + (i32.const -1) + ) + ) + (i32.const 48) + ) + (br_if $while-in106 + (i32.gt_u + (local.get $7) + (local.get $22) + ) + ) + ) ) ) ) ) - ) - ) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) - ) - (i32.const 32) - ) - ) - (drop - (call $___fwritex - (local.get $7) - (i32.sub - (local.get $43) - (local.get $7) - ) - (local.get $0) - ) - ) - ) - (if - (i32.le_u - (local.tee $7 - (i32.add - (local.get $6) - (i32.const 4) - ) - ) - (local.get $8) - ) - (block - (local.set $6 - (local.get $7) - ) - (br $while-in102) - ) - ) - ) - (block $do-once107 - (if - (local.get $32) - (block - (br_if $do-once107 - (i32.and - (i32.load - (local.get $0) + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) ) - (i32.const 32) ) - ) - (drop - (call $___fwritex - (i32.const 4143) - (i32.const 1) - (local.get $0) - ) - ) - ) - ) - ) - (if - (i32.and - (i32.gt_s - (local.get $5) - (i32.const 0) - ) - (i32.lt_u - (local.get $7) - (local.get $9) - ) - ) - (loop $while-in110 - (if - (i32.gt_u - (local.tee $6 - (call $_fmt_u - (i32.load + (then + (drop + (call $___fwritex (local.get $7) + (i32.sub + (local.get $43) + (local.get $7) + ) + (local.get $0) ) - (i32.const 0) - (local.get $30) ) ) - (local.get $22) ) - (loop $while-in112 - (i32.store8 - (local.tee $6 + (if + (i32.le_u + (local.tee $7 (i32.add (local.get $6) - (i32.const -1) + (i32.const 4) ) ) - (i32.const 48) + (local.get $8) ) - (br_if $while-in112 - (i32.gt_u - (local.get $6) - (local.get $22) + (then + (block + (local.set $6 + (local.get $7) + ) + (br $while-in102) ) ) ) ) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) - ) - (i32.const 32) - ) - ) - (drop - (call $___fwritex - (local.get $6) - (select - (i32.const 9) - (local.get $5) - (i32.gt_s - (local.get $5) - (i32.const 9) + (block $do-once107 + (if + (local.get $32) + (then + (block + (br_if $do-once107 + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) + ) + ) + (drop + (call $___fwritex + (i32.const 4143) + (i32.const 1) + (local.get $0) + ) ) ) - (local.get $0) ) ) ) - (local.set $6 - (i32.add - (local.get $5) - (i32.const -9) - ) - ) (if (i32.and (i32.gt_s (local.get $5) - (i32.const 9) + (i32.const 0) ) (i32.lt_u - (local.tee $7 - (i32.add - (local.get $7) - (i32.const 4) - ) - ) + (local.get $7) (local.get $9) ) ) - (block - (local.set $5 - (local.get $6) - ) - (br $while-in110) - ) - (local.set $5 - (local.get $6) - ) - ) - ) - ) - (call $_pad - (local.get $0) - (i32.const 48) - (i32.add - (local.get $5) - (i32.const 9) - ) - (i32.const 9) - (i32.const 0) - ) - ) - (block - (local.set $9 - (select - (local.get $9) - (i32.add - (local.get $12) - (i32.const 4) - ) - (local.get $24) - ) - ) - (if - (i32.gt_s - (local.get $5) - (i32.const -1) - ) - (block - (local.set $17 - (i32.eqz - (local.get $21) - ) - ) - (local.set $6 - (local.get $12) - ) - (local.set $7 - (local.get $5) - ) - (loop $while-in114 - (if - (i32.eq - (local.tee $5 - (call $_fmt_u - (i32.load - (local.get $6) - ) - (i32.const 0) - (local.get $30) - ) - ) - (local.get $30) - ) - (block - (i32.store8 - (local.get $35) - (i32.const 48) - ) - (local.set $5 - (local.get $35) - ) - ) - ) - (block $do-once115 - (if - (i32.eq - (local.get $6) - (local.get $12) - ) - (block - (if - (i32.eqz - (i32.and + (then + (loop $while-in110 + (if + (i32.gt_u + (local.tee $6 + (call $_fmt_u (i32.load - (local.get $0) + (local.get $7) ) - (i32.const 32) - ) - ) - (drop - (call $___fwritex - (local.get $5) - (i32.const 1) - (local.get $0) + (i32.const 0) + (local.get $30) ) ) + (local.get $22) ) - (local.set $5 - (i32.add - (local.get $5) - (i32.const 1) - ) - ) - (br_if $do-once115 - (i32.and - (local.get $17) - (i32.lt_s - (local.get $7) - (i32.const 1) + (then + (loop $while-in112 + (i32.store8 + (local.tee $6 + (i32.add + (local.get $6) + (i32.const -1) + ) + ) + (i32.const 48) + ) + (br_if $while-in112 + (i32.gt_u + (local.get $6) + (local.get $22) + ) ) ) ) - (br_if $do-once115 + ) + (if + (i32.eqz (i32.and (i32.load (local.get $0) @@ -13041,256 +13549,444 @@ (i32.const 32) ) ) - (drop - (call $___fwritex - (i32.const 4143) - (i32.const 1) - (local.get $0) + (then + (drop + (call $___fwritex + (local.get $6) + (select + (i32.const 9) + (local.get $5) + (i32.gt_s + (local.get $5) + (i32.const 9) + ) + ) + (local.get $0) + ) ) ) ) - (block - (br_if $do-once115 - (i32.le_u + (local.set $6 + (i32.add + (local.get $5) + (i32.const -9) + ) + ) + (if + (i32.and + (i32.gt_s (local.get $5) - (local.get $22) + (i32.const 9) ) - ) - (loop $while-in118 - (i32.store8 - (local.tee $5 + (i32.lt_u + (local.tee $7 (i32.add - (local.get $5) - (i32.const -1) + (local.get $7) + (i32.const 4) ) ) - (i32.const 48) + (local.get $9) ) - (br_if $while-in118 - (i32.gt_u - (local.get $5) - (local.get $22) + ) + (then + (block + (local.set $5 + (local.get $6) ) + (br $while-in110) + ) + ) + (else + (local.set $5 + (local.get $6) ) ) ) ) ) - (local.set $8 - (i32.sub - (local.get $43) - (local.get $5) + ) + (call $_pad + (local.get $0) + (i32.const 48) + (i32.add + (local.get $5) + (i32.const 9) + ) + (i32.const 9) + (i32.const 0) + ) + ) + ) + (else + (block + (local.set $9 + (select + (local.get $9) + (i32.add + (local.get $12) + (i32.const 4) ) + (local.get $24) ) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) + ) + (if + (i32.gt_s + (local.get $5) + (i32.const -1) + ) + (then + (block + (local.set $17 + (i32.eqz + (local.get $21) ) - (i32.const 32) ) - ) - (drop - (call $___fwritex + (local.set $6 + (local.get $12) + ) + (local.set $7 (local.get $5) - (select - (local.get $8) - (local.get $7) - (i32.gt_s - (local.get $7) - (local.get $8) + ) + (loop $while-in114 + (if + (i32.eq + (local.tee $5 + (call $_fmt_u + (i32.load + (local.get $6) + ) + (i32.const 0) + (local.get $30) + ) + ) + (local.get $30) + ) + (then + (block + (i32.store8 + (local.get $35) + (i32.const 48) + ) + (local.set $5 + (local.get $35) + ) + ) ) ) - (local.get $0) - ) - ) - ) - (br_if $while-in114 - (i32.and - (i32.lt_u - (local.tee $6 - (i32.add - (local.get $6) - (i32.const 4) + (block $do-once115 + (if + (i32.eq + (local.get $6) + (local.get $12) + ) + (then + (block + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) + ) + ) + (then + (drop + (call $___fwritex + (local.get $5) + (i32.const 1) + (local.get $0) + ) + ) + ) + ) + (local.set $5 + (i32.add + (local.get $5) + (i32.const 1) + ) + ) + (br_if $do-once115 + (i32.and + (local.get $17) + (i32.lt_s + (local.get $7) + (i32.const 1) + ) + ) + ) + (br_if $do-once115 + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) + ) + ) + (drop + (call $___fwritex + (i32.const 4143) + (i32.const 1) + (local.get $0) + ) + ) + ) + ) + (else + (block + (br_if $do-once115 + (i32.le_u + (local.get $5) + (local.get $22) + ) + ) + (loop $while-in118 + (i32.store8 + (local.tee $5 + (i32.add + (local.get $5) + (i32.const -1) + ) + ) + (i32.const 48) + ) + (br_if $while-in118 + (i32.gt_u + (local.get $5) + (local.get $22) + ) + ) + ) + ) + ) ) ) - (local.get $9) - ) - (i32.gt_s - (local.tee $7 + (local.set $8 (i32.sub - (local.get $7) - (local.get $8) + (local.get $43) + (local.get $5) ) ) - (i32.const -1) + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) + ) + ) + (then + (drop + (call $___fwritex + (local.get $5) + (select + (local.get $8) + (local.get $7) + (i32.gt_s + (local.get $7) + (local.get $8) + ) + ) + (local.get $0) + ) + ) + ) + ) + (br_if $while-in114 + (i32.and + (i32.lt_u + (local.tee $6 + (i32.add + (local.get $6) + (i32.const 4) + ) + ) + (local.get $9) + ) + (i32.gt_s + (local.tee $7 + (i32.sub + (local.get $7) + (local.get $8) + ) + ) + (i32.const -1) + ) + ) + ) + (local.set $5 + (local.get $7) + ) ) ) ) - (local.set $5 - (local.get $7) - ) ) - ) - ) - (call $_pad - (local.get $0) - (i32.const 48) - (i32.add - (local.get $5) - (i32.const 18) - ) - (i32.const 18) - (i32.const 0) - ) - (br_if $do-once99 - (i32.and - (i32.load + (call $_pad (local.get $0) + (i32.const 48) + (i32.add + (local.get $5) + (i32.const 18) + ) + (i32.const 18) + (i32.const 0) ) - (i32.const 32) - ) - ) - (drop - (call $___fwritex - (local.get $18) - (i32.sub - (local.get $28) - (local.get $18) + (br_if $do-once99 + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) + ) + ) + (drop + (call $___fwritex + (local.get $18) + (i32.sub + (local.get $28) + (local.get $18) + ) + (local.get $0) + ) ) - (local.get $0) ) ) ) ) - ) - (call $_pad - (local.get $0) - (i32.const 32) - (local.get $14) - (local.get $13) - (i32.xor - (local.get $11) - (i32.const 8192) - ) - ) - (select - (local.get $14) - (local.get $13) - (i32.lt_s + (call $_pad + (local.get $0) + (i32.const 32) + (local.get $14) (local.get $13) + (i32.xor + (local.get $11) + (i32.const 8192) + ) + ) + (select (local.get $14) + (local.get $13) + (i32.lt_s + (local.get $13) + (local.get $14) + ) ) ) ) - (block (result i32) - (call $_pad - (local.get $0) - (i32.const 32) - (local.get $14) - (local.tee $7 - (i32.add - (local.tee $9 - (select - (i32.const 0) - (local.get $27) - (local.tee $6 - (i32.or - (f64.ne - (local.get $15) - (local.get $15) + (else + (block (result i32) + (call $_pad + (local.get $0) + (i32.const 32) + (local.get $14) + (local.tee $7 + (i32.add + (local.tee $9 + (select + (i32.const 0) + (local.get $27) + (local.tee $6 + (i32.or + (f64.ne + (local.get $15) + (local.get $15) + ) + (i32.const 0) ) - (i32.const 0) ) ) ) + (i32.const 3) ) - (i32.const 3) ) + (local.get $8) ) - (local.get $8) - ) - (if - (i32.eqz - (i32.and - (local.tee $5 - (i32.load - (local.get $0) + (if + (i32.eqz + (i32.and + (local.tee $5 + (i32.load + (local.get $0) + ) ) - ) - (i32.const 32) - ) - ) - (block - (drop - (call $___fwritex - (local.get $31) - (local.get $9) - (local.get $0) + (i32.const 32) ) ) - (local.set $5 - (i32.load - (local.get $0) + (then + (block + (drop + (call $___fwritex + (local.get $31) + (local.get $9) + (local.get $0) + ) + ) + (local.set $5 + (i32.load + (local.get $0) + ) + ) ) ) ) - ) - (local.set $6 - (select + (local.set $6 (select - (i32.const 4135) - (i32.const 4139) - (local.tee $8 - (i32.ne - (i32.and - (local.get $18) - (i32.const 32) + (select + (i32.const 4135) + (i32.const 4139) + (local.tee $8 + (i32.ne + (i32.and + (local.get $18) + (i32.const 32) + ) + (i32.const 0) ) - (i32.const 0) ) ) + (select + (i32.const 4127) + (i32.const 4131) + (local.get $8) + ) + (local.get $6) ) - (select - (i32.const 4127) - (i32.const 4131) - (local.get $8) - ) - (local.get $6) ) - ) - (if - (i32.eqz - (i32.and - (local.get $5) - (i32.const 32) + (if + (i32.eqz + (i32.and + (local.get $5) + (i32.const 32) + ) ) - ) - (drop - (call $___fwritex - (local.get $6) - (i32.const 3) - (local.get $0) + (then + (drop + (call $___fwritex + (local.get $6) + (i32.const 3) + (local.get $0) + ) + ) ) ) - ) - (call $_pad - (local.get $0) - (i32.const 32) - (local.get $14) - (local.get $7) - (i32.xor - (local.get $11) - (i32.const 8192) - ) - ) - (select - (local.get $14) - (local.get $7) - (i32.lt_s + (call $_pad + (local.get $0) + (i32.const 32) + (local.get $14) (local.get $7) + (i32.xor + (local.get $11) + (i32.const 8192) + ) + ) + (select (local.get $14) + (local.get $7) + (i32.lt_s + (local.get $7) + (local.get $14) + ) ) ) ) @@ -13346,115 +14042,123 @@ ) ) ) - (block - (local.set $5 - (local.get $26) - ) - (local.set $8 - (i32.const 0) - ) - (local.set $9 - (i32.const 4091) + (then + (block + (local.set $5 + (local.get $26) + ) + (local.set $8 + (i32.const 0) + ) + (local.set $9 + (i32.const 4091) + ) + (br $__rjti$8) ) - (br $__rjti$8) ) - (block - (local.set $5 - (local.get $8) - ) - (local.set $8 - (local.get $26) - ) - (loop $while-in123 - (i32.store8 - (local.tee $8 - (i32.add - (local.get $8) - (i32.const -1) - ) - ) - (i32.or - (i32.load8_u + (else + (block + (local.set $5 + (local.get $8) + ) + (local.set $8 + (local.get $26) + ) + (loop $while-in123 + (i32.store8 + (local.tee $8 (i32.add - (i32.and - (local.get $5) - (i32.const 15) - ) - (i32.const 4075) + (local.get $8) + (i32.const -1) ) ) - (local.get $9) - ) - ) - (br_if $while-in123 - (i32.eqz - (i32.and - (i32.eqz - (local.tee $5 - (call $_bitshift64Lshr + (i32.or + (i32.load8_u + (i32.add + (i32.and (local.get $5) - (local.get $11) - (i32.const 4) + (i32.const 15) ) + (i32.const 4075) ) ) - (i32.eqz - (local.tee $11 - (global.get $tempRet0) - ) - ) + (local.get $9) ) ) - ) - (local.set $5 - (local.get $8) - ) - ) - (local.set $8 - (if (result i32) - (i32.or + (br_if $while-in123 (i32.eqz (i32.and - (local.get $7) - (i32.const 8) - ) - ) - (i32.and - (i32.eqz - (i32.load + (i32.eqz + (local.tee $5 + (call $_bitshift64Lshr + (local.get $5) + (local.get $11) + (i32.const 4) + ) + ) + ) + (i32.eqz (local.tee $11 - (local.get $19) + (global.get $tempRet0) ) ) ) + ) + ) + (local.set $5 + (local.get $8) + ) + ) + (local.set $8 + (if (result i32) + (i32.or (i32.eqz - (i32.load offset=4 - (local.get $11) + (i32.and + (local.get $7) + (i32.const 8) + ) + ) + (i32.and + (i32.eqz + (i32.load + (local.tee $11 + (local.get $19) + ) + ) + ) + (i32.eqz + (i32.load offset=4 + (local.get $11) + ) ) ) ) - ) - (block (result i32) - (local.set $9 - (i32.const 4091) + (then + (block (result i32) + (local.set $9 + (i32.const 4091) + ) + (i32.const 0) + ) ) - (i32.const 0) - ) - (block (result i32) - (local.set $9 - (i32.add - (i32.shr_s - (local.get $18) - (i32.const 4) + (else + (block (result i32) + (local.set $9 + (i32.add + (i32.shr_s + (local.get $18) + (i32.const 4) + ) + (i32.const 4091) + ) ) - (i32.const 4091) + (i32.const 2) ) ) - (i32.const 2) ) ) + (br $__rjti$8) ) - (br $__rjti$8) ) ) ) @@ -13580,11 +14284,13 @@ (local.get $7) (i32.const 0) ) - (block - (local.set $16 - (i32.const -1) + (then + (block + (local.set $16 + (i32.const -1) + ) + (br $label$break$L1) ) - (br $label$break$L1) ) ) (call $_pad @@ -13596,89 +14302,99 @@ ) (if (local.get $5) - (block - (local.set $6 - (i32.const 0) - ) - (local.set $7 - (i32.load - (local.get $19) + (then + (block + (local.set $6 + (i32.const 0) ) - ) - (loop $while-in127 - (if - (i32.eqz - (local.tee $8 - (i32.load - (local.get $7) + (local.set $7 + (i32.load + (local.get $19) + ) + ) + (loop $while-in127 + (if + (i32.eqz + (local.tee $8 + (i32.load + (local.get $7) + ) ) ) - ) - (block - (local.set $7 - (local.get $5) + (then + (block + (local.set $7 + (local.get $5) + ) + (br $__rjti$7) + ) ) - (br $__rjti$7) ) - ) - (if - (i32.gt_s - (local.tee $6 - (i32.add - (local.tee $8 - (call $_wctomb - (local.get $36) - (local.get $8) + (if + (i32.gt_s + (local.tee $6 + (i32.add + (local.tee $8 + (call $_wctomb + (local.get $36) + (local.get $8) + ) ) + (local.get $6) ) - (local.get $6) ) - ) - (local.get $5) - ) - (block - (local.set $7 (local.get $5) ) - (br $__rjti$7) + (then + (block + (local.set $7 + (local.get $5) + ) + (br $__rjti$7) + ) + ) ) - ) - (if - (i32.eqz - (i32.and - (i32.load - (local.get $0) + (if + (i32.eqz + (i32.and + (i32.load + (local.get $0) + ) + (i32.const 32) + ) + ) + (then + (drop + (call $___fwritex + (local.get $36) + (local.get $8) + (local.get $0) + ) ) - (i32.const 32) ) ) - (drop - (call $___fwritex - (local.get $36) - (local.get $8) - (local.get $0) + (local.set $7 + (i32.add + (local.get $7) + (i32.const 4) ) ) - ) - (local.set $7 - (i32.add - (local.get $7) - (i32.const 4) + (br_if $while-in127 + (i32.lt_u + (local.get $6) + (local.get $5) + ) ) - ) - (br_if $while-in127 - (i32.lt_u - (local.get $6) + (local.set $7 (local.get $5) ) ) - (local.set $7 - (local.get $5) - ) ) ) - (local.set $7 - (i32.const 0) + (else + (local.set $7 + (i32.const 0) + ) ) ) ) @@ -13743,38 +14459,42 @@ ) ) ) - (block (result i32) - (local.set $7 - (local.get $5) - ) - (select - (local.get $6) - (local.tee $5 - (i32.add - (i32.xor - (i32.and - (local.get $12) + (then + (block (result i32) + (local.set $7 + (local.get $5) + ) + (select + (local.get $6) + (local.tee $5 + (i32.add + (i32.xor + (i32.and + (local.get $12) + (i32.const 1) + ) (i32.const 1) ) - (i32.const 1) - ) - (i32.sub - (local.get $39) - (local.get $5) + (i32.sub + (local.get $39) + (local.get $5) + ) ) ) - ) - (i32.gt_s - (local.get $6) - (local.get $5) + (i32.gt_s + (local.get $6) + (local.get $5) + ) ) ) ) - (block (result i32) - (local.set $7 - (local.get $26) + (else + (block (result i32) + (local.set $7 + (local.get $26) + ) + (i32.const 0) ) - (i32.const 0) ) ) ) @@ -13825,11 +14545,13 @@ (i32.const 32) ) ) - (drop - (call $___fwritex - (local.get $9) - (local.get $8) - (local.get $0) + (then + (drop + (call $___fwritex + (local.get $9) + (local.get $8) + (local.get $0) + ) ) ) ) @@ -13859,11 +14581,13 @@ (i32.const 32) ) ) - (drop - (call $___fwritex - (local.get $7) - (local.get $13) - (local.get $0) + (then + (drop + (call $___fwritex + (local.get $7) + (local.get $13) + (local.get $0) + ) ) ) ) @@ -13892,101 +14616,115 @@ (i32.eqz (local.get $0) ) - (if - (local.get $1) - (block - (local.set $0 - (i32.const 1) - ) - (loop $while-in130 - (if - (local.tee $1 - (i32.load - (i32.add - (local.get $4) - (i32.shl - (local.get $0) - (i32.const 2) - ) - ) - ) + (then + (if + (local.get $1) + (then + (block + (local.set $0 + (i32.const 1) ) - (block - (call $_pop_arg_336 - (i32.add - (local.get $3) - (i32.shl - (local.get $0) - (i32.const 3) + (loop $while-in130 + (if + (local.tee $1 + (i32.load + (i32.add + (local.get $4) + (i32.shl + (local.get $0) + (i32.const 2) + ) + ) ) ) - (local.get $1) - (local.get $2) - ) - (br_if $while-in130 - (i32.lt_s - (local.tee $0 - (i32.add - (local.get $0) + (then + (block + (call $_pop_arg_336 + (i32.add + (local.get $3) + (i32.shl + (local.get $0) + (i32.const 3) + ) + ) + (local.get $1) + (local.get $2) + ) + (br_if $while-in130 + (i32.lt_s + (local.tee $0 + (i32.add + (local.get $0) + (i32.const 1) + ) + ) + (i32.const 10) + ) + ) + (local.set $16 (i32.const 1) ) + (br $label$break$L343) ) - (i32.const 10) ) ) - (local.set $16 - (i32.const 1) - ) - (br $label$break$L343) ) - ) - ) - (if - (i32.lt_s - (local.get $0) - (i32.const 10) - ) - (loop $while-in132 (if - (i32.load - (i32.add - (local.get $4) - (i32.shl - (local.get $0) - (i32.const 2) + (i32.lt_s + (local.get $0) + (i32.const 10) + ) + (then + (loop $while-in132 + (if + (i32.load + (i32.add + (local.get $4) + (i32.shl + (local.get $0) + (i32.const 2) + ) + ) + ) + (then + (block + (local.set $16 + (i32.const -1) + ) + (br $label$break$L343) + ) + ) + ) + (br_if $while-in132 + (i32.lt_s + (local.tee $0 + (i32.add + (local.get $0) + (i32.const 1) + ) + ) + (i32.const 10) + ) + ) + (local.set $16 + (i32.const 1) ) ) ) - (block + (else (local.set $16 - (i32.const -1) - ) - (br $label$break$L343) - ) - ) - (br_if $while-in132 - (i32.lt_s - (local.tee $0 - (i32.add - (local.get $0) - (i32.const 1) - ) + (i32.const 1) ) - (i32.const 10) ) ) - (local.set $16 - (i32.const 1) - ) ) + ) + (else (local.set $16 - (i32.const 1) + (i32.const 0) ) ) ) - (local.set $16 - (i32.const 0) - ) ) ) ) @@ -14005,27 +14743,56 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 20) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $switch-default - ;; CHECK-NEXT: (block $switch-case9 - ;; CHECK-NEXT: (block $switch-case8 - ;; CHECK-NEXT: (block $switch-case7 - ;; CHECK-NEXT: (block $switch-case6 - ;; CHECK-NEXT: (block $switch-case5 - ;; CHECK-NEXT: (block $switch-case4 - ;; CHECK-NEXT: (block $switch-case3 - ;; CHECK-NEXT: (block $switch-case2 - ;; CHECK-NEXT: (block $switch-case1 - ;; CHECK-NEXT: (block $switch-case - ;; CHECK-NEXT: (br_table $switch-case $switch-case1 $switch-case2 $switch-case3 $switch-case4 $switch-case5 $switch-case6 $switch-case7 $switch-case8 $switch-case9 $switch-default - ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $switch-default + ;; CHECK-NEXT: (block $switch-case9 + ;; CHECK-NEXT: (block $switch-case8 + ;; CHECK-NEXT: (block $switch-case7 + ;; CHECK-NEXT: (block $switch-case6 + ;; CHECK-NEXT: (block $switch-case5 + ;; CHECK-NEXT: (block $switch-case4 + ;; CHECK-NEXT: (block $switch-case3 + ;; CHECK-NEXT: (block $switch-case2 + ;; CHECK-NEXT: (block $switch-case1 + ;; CHECK-NEXT: (block $switch-case + ;; CHECK-NEXT: (br_table $switch-case $switch-case1 $switch-case2 $switch-case3 $switch-case4 $switch-case5 $switch-case6 $switch-case7 $switch-case8 $switch-case9 $switch-default + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (local.tee $3 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.load @@ -14041,19 +14808,32 @@ ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=4 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (local.tee $1 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.load @@ -14069,97 +14849,108 @@ ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (i32.const -8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.load offset=4 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -8) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.load offset=4 - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 65535) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) @@ -14187,31 +14978,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 65535) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 65535) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) @@ -14239,14 +15013,31 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 65535) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 255) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 24) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.shr_s + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.lt_s + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) @@ -14274,45 +15065,28 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 255) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 24) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 24) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 255) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.shr_s - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.lt_s - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (f64.load ;; CHECK-NEXT: (local.tee $1 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -4) + ;; CHECK-NEXT: (i32.const -8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14321,19 +15095,12 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 255) + ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=4 + ;; CHECK-NEXT: (f64.store ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L1) ;; CHECK-NEXT: ) @@ -14363,33 +15130,6 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (f64.load - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14405,27 +15145,56 @@ (local.get $1) (i32.const 20) ) - (block $switch-default - (block $switch-case9 - (block $switch-case8 - (block $switch-case7 - (block $switch-case6 - (block $switch-case5 - (block $switch-case4 - (block $switch-case3 - (block $switch-case2 - (block $switch-case1 - (block $switch-case - (br_table $switch-case $switch-case1 $switch-case2 $switch-case3 $switch-case4 $switch-case5 $switch-case6 $switch-case7 $switch-case8 $switch-case9 $switch-default - (i32.sub + (then + (block $switch-default + (block $switch-case9 + (block $switch-case8 + (block $switch-case7 + (block $switch-case6 + (block $switch-case5 + (block $switch-case4 + (block $switch-case3 + (block $switch-case2 + (block $switch-case1 + (block $switch-case + (br_table $switch-case $switch-case1 $switch-case2 $switch-case3 $switch-case4 $switch-case5 $switch-case6 $switch-case7 $switch-case8 $switch-case9 $switch-default + (i32.sub + (local.get $1) + (i32.const 9) + ) + ) + ) + (local.set $3 + (i32.load + (local.tee $1 + (i32.and + (i32.add + (i32.load + (local.get $2) + ) + (i32.const 3) + ) + (i32.const -4) + ) + ) + ) + ) + (i32.store + (local.get $2) + (i32.add (local.get $1) - (i32.const 9) + (i32.const 4) ) ) + (i32.store + (local.get $0) + (local.get $3) + ) + (br $label$break$L1) ) - (local.set $3 + (local.set $1 (i32.load - (local.tee $1 + (local.tee $3 (i32.and (i32.add (i32.load @@ -14441,19 +15210,32 @@ (i32.store (local.get $2) (i32.add - (local.get $1) + (local.get $3) (i32.const 4) ) ) (i32.store (local.get $0) - (local.get $3) + (local.get $1) + ) + (i32.store offset=4 + (local.get $0) + (i32.shr_s + (i32.shl + (i32.lt_s + (local.get $1) + (i32.const 0) + ) + (i32.const 31) + ) + (i32.const 31) + ) ) (br $label$break$L1) ) - (local.set $1 + (local.set $3 (i32.load - (local.tee $3 + (local.tee $1 (i32.and (i32.add (i32.load @@ -14469,97 +15251,108 @@ (i32.store (local.get $2) (i32.add - (local.get $3) + (local.get $1) (i32.const 4) ) ) (i32.store (local.get $0) - (local.get $1) + (local.get $3) ) (i32.store offset=4 (local.get $0) - (i32.shr_s - (i32.shl - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (i32.const 31) - ) - (i32.const 31) - ) + (i32.const 0) ) (br $label$break$L1) ) - (local.set $3 + (local.set $5 (i32.load - (local.tee $1 - (i32.and - (i32.add - (i32.load - (local.get $2) + (local.tee $3 + (local.tee $1 + (i32.and + (i32.add + (i32.load + (local.get $2) + ) + (i32.const 7) ) - (i32.const 3) + (i32.const -8) ) - (i32.const -4) ) ) ) ) + (local.set $3 + (i32.load offset=4 + (local.get $3) + ) + ) (i32.store (local.get $2) (i32.add (local.get $1) - (i32.const 4) + (i32.const 8) ) ) (i32.store (local.get $0) - (local.get $3) + (local.get $5) ) (i32.store offset=4 (local.get $0) - (i32.const 0) + (local.get $3) ) (br $label$break$L1) ) - (local.set $5 + (local.set $3 (i32.load - (local.tee $3 - (local.tee $1 - (i32.and - (i32.add - (i32.load - (local.get $2) - ) - (i32.const 7) + (local.tee $1 + (i32.and + (i32.add + (i32.load + (local.get $2) ) - (i32.const -8) + (i32.const 3) ) + (i32.const -4) ) ) ) ) - (local.set $3 - (i32.load offset=4 - (local.get $3) - ) - ) (i32.store (local.get $2) (i32.add (local.get $1) - (i32.const 8) + (i32.const 4) ) ) (i32.store (local.get $0) - (local.get $5) + (local.tee $1 + (i32.shr_s + (i32.shl + (i32.and + (local.get $3) + (i32.const 65535) + ) + (i32.const 16) + ) + (i32.const 16) + ) + ) ) (i32.store offset=4 (local.get $0) - (local.get $3) + (i32.shr_s + (i32.shl + (i32.lt_s + (local.get $1) + (i32.const 0) + ) + (i32.const 31) + ) + (i32.const 31) + ) ) (br $label$break$L1) ) @@ -14587,31 +15380,14 @@ ) (i32.store (local.get $0) - (local.tee $1 - (i32.shr_s - (i32.shl - (i32.and - (local.get $3) - (i32.const 65535) - ) - (i32.const 16) - ) - (i32.const 16) - ) + (i32.and + (local.get $3) + (i32.const 65535) ) ) (i32.store offset=4 (local.get $0) - (i32.shr_s - (i32.shl - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (i32.const 31) - ) - (i32.const 31) - ) + (i32.const 0) ) (br $label$break$L1) ) @@ -14639,14 +15415,31 @@ ) (i32.store (local.get $0) - (i32.and - (local.get $3) - (i32.const 65535) + (local.tee $1 + (i32.shr_s + (i32.shl + (i32.and + (local.get $3) + (i32.const 255) + ) + (i32.const 24) + ) + (i32.const 24) + ) ) ) (i32.store offset=4 (local.get $0) - (i32.const 0) + (i32.shr_s + (i32.shl + (i32.lt_s + (local.get $1) + (i32.const 0) + ) + (i32.const 31) + ) + (i32.const 31) + ) ) (br $label$break$L1) ) @@ -14674,45 +15467,28 @@ ) (i32.store (local.get $0) - (local.tee $1 - (i32.shr_s - (i32.shl - (i32.and - (local.get $3) - (i32.const 255) - ) - (i32.const 24) - ) - (i32.const 24) - ) + (i32.and + (local.get $3) + (i32.const 255) ) ) (i32.store offset=4 (local.get $0) - (i32.shr_s - (i32.shl - (i32.lt_s - (local.get $1) - (i32.const 0) - ) - (i32.const 31) - ) - (i32.const 31) - ) + (i32.const 0) ) (br $label$break$L1) ) - (local.set $3 - (i32.load + (local.set $4 + (f64.load (local.tee $1 (i32.and (i32.add (i32.load (local.get $2) ) - (i32.const 3) + (i32.const 7) ) - (i32.const -4) + (i32.const -8) ) ) ) @@ -14721,19 +15497,12 @@ (local.get $2) (i32.add (local.get $1) - (i32.const 4) - ) - ) - (i32.store - (local.get $0) - (i32.and - (local.get $3) - (i32.const 255) + (i32.const 8) ) ) - (i32.store offset=4 + (f64.store (local.get $0) - (i32.const 0) + (local.get $4) ) (br $label$break$L1) ) @@ -14763,33 +15532,6 @@ (local.get $0) (local.get $4) ) - (br $label$break$L1) - ) - (local.set $4 - (f64.load - (local.tee $1 - (i32.and - (i32.add - (i32.load - (local.get $2) - ) - (i32.const 7) - ) - (i32.const -8) - ) - ) - ) - ) - (i32.store - (local.get $2) - (i32.add - (local.get $1) - (i32.const 8) - ) - ) - (f64.store - (local.get $0) - (local.get $4) ) ) ) @@ -14798,81 +15540,85 @@ ;; CHECK: (func $_fmt_u (param $0 i32) (param $1 i32) (param $2 i32) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (loop $while-in - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.tee $2 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $while-in + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.tee $2 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (call $___uremdi3 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (call $___uremdi3 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (call $___udivmoddi4 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (call $___udivmoddi4 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (global.get $tempRet0) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (global.get $tempRet0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (loop $while-in1 - ;; CHECK-NEXT: (i32.store8 - ;; CHECK-NEXT: (local.tee $2 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (loop $while-in1 + ;; CHECK-NEXT: (i32.store8 + ;; CHECK-NEXT: (local.tee $2 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.rem_u + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 48) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.rem_u + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.div_u ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 48) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.div_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14898,103 +15644,113 @@ ) ) ) - (loop $while-in - (i32.store8 - (local.tee $2 - (i32.add - (local.get $2) - (i32.const -1) + (then + (loop $while-in + (i32.store8 + (local.tee $2 + (i32.add + (local.get $2) + (i32.const -1) + ) ) - ) - (i32.or - (local.tee $3 - (call $___uremdi3 - (local.get $0) - (local.get $1) - (i32.const 10) - (i32.const 0) + (i32.or + (local.tee $3 + (call $___uremdi3 + (local.get $0) + (local.get $1) + (i32.const 10) + (i32.const 0) + ) ) + (i32.const 48) ) - (i32.const 48) ) - ) - (local.set $3 - (call $___udivdi3 - (local.get $0) - (local.get $1) - (i32.const 10) - (i32.const 0) - ) - ) - (local.set $4 - (global.get $tempRet0) - ) - (if - (i32.or - (i32.gt_u + (local.set $3 + (call $___udivdi3 + (local.get $0) (local.get $1) - (i32.const 9) + (i32.const 10) + (i32.const 0) ) - (i32.and - (i32.eq + ) + (local.set $4 + (global.get $tempRet0) + ) + (if + (i32.or + (i32.gt_u (local.get $1) (i32.const 9) ) - (i32.gt_u - (local.get $0) - (i32.const -1) + (i32.and + (i32.eq + (local.get $1) + (i32.const 9) + ) + (i32.gt_u + (local.get $0) + (i32.const -1) + ) ) ) - ) - (block - (local.set $0 - (local.get $3) + (then + (block + (local.set $0 + (local.get $3) + ) + (local.set $1 + (local.get $4) + ) + (br $while-in) + ) ) - (local.set $1 - (local.get $4) + (else + (local.set $0 + (local.get $3) + ) ) - (br $while-in) - ) - (local.set $0 - (local.get $3) ) ) ) ) (if (local.get $0) - (loop $while-in1 - (i32.store8 - (local.tee $2 - (i32.add - (local.get $2) - (i32.const -1) + (then + (loop $while-in1 + (i32.store8 + (local.tee $2 + (i32.add + (local.get $2) + (i32.const -1) + ) + ) + (i32.or + (call $i32u-rem + (local.get $0) + (i32.const 10) + ) + (i32.const 48) ) ) - (i32.or - (call $i32u-rem + (local.set $1 + (call $i32u-div (local.get $0) (i32.const 10) ) - (i32.const 48) ) - ) - (local.set $1 - (call $i32u-div - (local.get $0) - (i32.const 10) - ) - ) - (if - (i32.ge_u - (local.get $0) - (i32.const 10) - ) - (block - (local.set $0 - (local.get $1) + (if + (i32.ge_u + (local.get $0) + (i32.const 10) + ) + (then + (block + (local.set $0 + (local.get $1) + ) + (br $while-in1) + ) ) - (br $while-in1) ) ) ) @@ -15019,7 +15775,9 @@ ;; CHECK-NEXT: (global.get $STACKTOP) ;; CHECK-NEXT: (global.get $STACK_MAX) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (local.get $7) @@ -15038,7 +15796,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (call $_memset ;; CHECK-NEXT: (local.get $6) @@ -15075,11 +15833,11 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.const 255) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (loop $while-in ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (call $___fwritex ;; CHECK-NEXT: (local.get $6) @@ -15129,9 +15887,11 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br_if $do-once + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -15167,7 +15927,9 @@ (global.get $STACKTOP) (global.get $STACK_MAX) ) - (call $abort) + (then + (call $abort) + ) ) (local.set $6 (local.get $7) @@ -15186,110 +15948,118 @@ ) ) ) - (block - (drop - (call $_memset - (local.get $6) - (local.get $1) - (select - (i32.const 256) - (local.tee $5 - (i32.sub - (local.get $2) - (local.get $3) - ) - ) - (i32.gt_u - (local.get $5) + (then + (block + (drop + (call $_memset + (local.get $6) + (local.get $1) + (select (i32.const 256) + (local.tee $5 + (i32.sub + (local.get $2) + (local.get $3) + ) + ) + (i32.gt_u + (local.get $5) + (i32.const 256) + ) ) ) ) - ) - (local.set $4 - (i32.eqz - (i32.and - (local.tee $1 - (i32.load - (local.get $0) + (local.set $4 + (i32.eqz + (i32.and + (local.tee $1 + (i32.load + (local.get $0) + ) ) + (i32.const 32) ) - (i32.const 32) ) ) - ) - (if - (i32.gt_u - (local.get $5) - (i32.const 255) - ) - (block - (loop $while-in - (if - (local.get $4) - (block - (drop - (call $___fwritex - (local.get $6) - (i32.const 256) - (local.get $0) + (if + (i32.gt_u + (local.get $5) + (i32.const 255) + ) + (then + (block + (loop $while-in + (if + (local.get $4) + (then + (block + (drop + (call $___fwritex + (local.get $6) + (i32.const 256) + (local.get $0) + ) + ) + (local.set $1 + (i32.load + (local.get $0) + ) + ) + ) ) ) - (local.set $1 - (i32.load - (local.get $0) + (local.set $4 + (i32.eqz + (i32.and + (local.get $1) + (i32.const 32) + ) + ) + ) + (br_if $while-in + (i32.gt_u + (local.tee $5 + (i32.add + (local.get $5) + (i32.const -256) + ) + ) + (i32.const 255) ) ) ) - ) - (local.set $4 - (i32.eqz - (i32.and - (local.get $1) - (i32.const 32) + (br_if $do-once + (i32.eqz + (local.get $4) ) ) - ) - (br_if $while-in - (i32.gt_u - (local.tee $5 - (i32.add - (local.get $5) - (i32.const -256) + (local.set $5 + (i32.and + (i32.sub + (local.get $2) + (local.get $3) ) + (i32.const 255) ) - (i32.const 255) ) ) ) - (br_if $do-once - (i32.eqz - (local.get $4) - ) - ) - (local.set $5 - (i32.and - (i32.sub - (local.get $2) - (local.get $3) + (else + (br_if $do-once + (i32.eqz + (local.get $4) ) - (i32.const 255) ) ) ) - (br_if $do-once - (i32.eqz - (local.get $4) + (drop + (call $___fwritex + (local.get $6) + (local.get $5) + (local.get $0) ) ) ) - (drop - (call $___fwritex - (local.get $6) - (local.get $5) - (local.get $0) - ) - ) ) ) ) @@ -15323,7 +16093,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 245) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.tee $5 @@ -15358,7 +16128,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $10 ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (local.tee $1 @@ -15402,20 +16172,22 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 176) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (i32.xor - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 176) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.xor + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $10) @@ -15423,7 +16195,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -15437,7 +16211,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $2) @@ -15447,7 +16221,9 @@ ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -15494,10 +16270,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $10 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (i32.shr_u @@ -15641,7 +16417,7 @@ ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.and @@ -15659,7 +16435,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $9) @@ -15667,7 +16443,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -15681,7 +16459,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $10) @@ -15696,7 +16474,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -15736,7 +16516,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $12 ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (i32.const 196) @@ -15770,33 +16550,37 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.or @@ -15852,7 +16636,7 @@ ;; CHECK-NEXT: (i32.const 180) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (i32.shr_u @@ -15977,22 +16761,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load offset=20 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load offset=20 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $10 - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $10 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-out) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -16041,7 +16827,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ge_u @@ -16053,7 +16841,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (i32.load offset=24 @@ -16070,7 +16860,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.tee $1 @@ -16084,24 +16874,26 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -16117,7 +16909,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) @@ -16138,7 +16930,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) @@ -16154,8 +16946,10 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 0) @@ -16166,7 +16960,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.tee $7 @@ -16176,7 +16970,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ne @@ -16190,7 +16986,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -16204,7 +17002,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $0) @@ -16217,7 +17015,9 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -16225,7 +17025,7 @@ ;; CHECK-NEXT: (block $do-once8 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $5) @@ -16245,7 +17045,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $9) @@ -16254,7 +17054,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 180) ;; CHECK-NEXT: (i32.and @@ -16274,7 +17074,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $8) @@ -16282,7 +17082,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -16296,13 +17098,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $do-once8 @@ -16321,7 +17127,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=24 ;; CHECK-NEXT: (local.get $9) @@ -16333,20 +17141,24 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=16 - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=16 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -16357,22 +17169,26 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -16385,7 +17201,7 @@ ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.or @@ -16416,7 +17232,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.or @@ -16444,7 +17260,7 @@ ;; CHECK-NEXT: (i32.const 184) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (i32.const 196) @@ -16478,33 +17294,37 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.or @@ -16558,252 +17378,270 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const -65) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -8) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const -65) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $18 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 180) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $18 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 180) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $14 ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 16777215) + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.gt_u ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 14) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1048320) + ;; CHECK-NEXT: (i32.const 16777215) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 14) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1048320) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 520192) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 520192) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 245760) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 245760) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 15) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__rjto$3 - ;; CHECK-NEXT: (block $__rjti$3 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load offset=480 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (block $__rjto$3 + ;; CHECK-NEXT: (block $__rjti$3 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load offset=480 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 25) - ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 25) + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $14) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in14 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $4 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.tee $9 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load offset=4 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (loop $while-in14 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $4 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.tee $9 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load offset=4 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -8) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__rjti$3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $__rjti$3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.tee $4 - ;; CHECK-NEXT: (i32.load offset=20 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.tee $4 + ;; CHECK-NEXT: (i32.load offset=20 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.tee $9 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.tee $9 + ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 16) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -16811,134 +17649,148 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (i32.xor - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (i32.xor + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in14) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in14) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $18) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $18) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (local.get $14) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (i32.load offset=480 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (i32.load offset=480 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.tee $4 + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.tee $1 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (i32.shr_u ;; CHECK-NEXT: (local.tee $4 ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.tee $1 ;; CHECK-NEXT: (i32.and @@ -16949,9 +17801,9 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -16966,887 +17818,814 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.tee $4 - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $__rjti$3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__rjti$3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $__rjto$3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__rjto$3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in16 - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $4 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load offset=4 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (loop $while-in16 + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $4 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load offset=4 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -8) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $4 - ;; CHECK-NEXT: (i32.load offset=16 + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (select ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $4 + ;; CHECK-NEXT: (i32.load offset=16 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-in16 - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.load offset=20 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (br_if $while-in16 + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.load offset=20 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 184) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.tee $12 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: (i32.const 184) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.tee $6 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.tee $12 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (i32.load offset=24 - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once17 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load offset=12 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.tee $6 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (i32.load offset=24 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block $do-once17 ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 20) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load offset=12 + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.const 20) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once17) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once17) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (loop $while-in20 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $10 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 20) + ;; CHECK-NEXT: (loop $while-in20 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $10 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 20) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $10) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in20) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $10 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in20) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $11 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in20) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.tee $10 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: (i32.load offset=8 + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $10) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in20) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $10 - ;; CHECK-NEXT: (i32.load offset=8 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: (i32.const 12) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.set $11 ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $10) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $11 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once21 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block $do-once21 ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load offset=28 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load offset=28 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 480) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 480) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 180) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 180) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 180) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.xor + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.xor - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (br $do-once21) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br_if $do-once21 + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once21) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load offset=16 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=16 + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $do-once21 - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load offset=20 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block $do-once25 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load offset=16 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=16 - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load offset=20 + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $do-once25 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 16) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=4 - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.store offset=4 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=4 - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=4 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 256) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 216) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 176) + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 256) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 216) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 176) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $13 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $13 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 176) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $13 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 176) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $13) + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $13 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 8) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=12 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $5 + ;; CHECK-NEXT: (i32.store offset=8 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=12 + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once25) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $13) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=12 - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=8 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=12 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once25) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 8) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 16777215) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (local.tee $0 ;; CHECK-NEXT: (i32.shr_u ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 14) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.tee $2 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 16777215) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 14) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shl ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1048320) + ;; CHECK-NEXT: (local.tee $2 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1048320) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (i32.const 520192) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 520192) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 245760) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 245760) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: (i32.const 15) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 15) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 480) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 480) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=28 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=4 - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.store offset=28 ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 180) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 180) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=12 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=8 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once25) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 25) - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__rjto$1 - ;; CHECK-NEXT: (block $__rjti$1 - ;; CHECK-NEXT: (loop $while-in28 - ;; CHECK-NEXT: (br_if $__rjti$1 - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.load offset=4 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 180) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $7 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 16) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 180) + ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-in28) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=24 ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=12 ;; CHECK-NEXT: (local.get $6) @@ -17859,79 +18638,194 @@ ;; CHECK-NEXT: (br $do-once25) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__rjto$1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.tee $2 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 8) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 25) + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 31) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=12 - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=8 - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=12 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (block $__rjto$1 + ;; CHECK-NEXT: (block $__rjti$1 + ;; CHECK-NEXT: (loop $while-in28 + ;; CHECK-NEXT: (br_if $__rjti$1 + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.load offset=4 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $7 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-in28) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=12 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=8 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once25) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $__rjto$1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.tee $2 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.ge_u + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store offset=12 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=8 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=12 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -17946,7 +18840,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (i32.const 196) @@ -17962,7 +18856,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 15) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 196) ;; CHECK-NEXT: (local.tee $1 @@ -17998,7 +18892,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 184) ;; CHECK-NEXT: (i32.const 0) @@ -18057,54 +18951,58 @@ ;; CHECK-NEXT: (i32.const 648) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (call $_sysconf - ;; CHECK-NEXT: (i32.const 30) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (call $_sysconf + ;; CHECK-NEXT: (i32.const 30) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 656) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 652) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 660) - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 664) - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 668) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 620) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 648) - ;; CHECK-NEXT: (i32.xor - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (call $_time - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 656) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 652) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 660) + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 664) + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 668) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 620) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 648) + ;; CHECK-NEXT: (i32.xor + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (call $_time + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -16) + ;; CHECK-NEXT: (i32.const 1431655768) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1431655768) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -18139,8 +19037,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if @@ -18149,29 +19049,33 @@ ;; CHECK-NEXT: (i32.const 616) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.le_u - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 608) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.le_u + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 608) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $11 @@ -18191,7 +19095,7 @@ ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (block $label$break$L279 ;; CHECK-NEXT: (block $__rjti$5 ;; CHECK-NEXT: (block $__rjti$4 @@ -18218,26 +19122,28 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $2 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $2 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $while-out33) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $while-out33) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -18266,33 +19172,37 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2147483647) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (call $_sbrk - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (call $_sbrk + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $__rjti$13 - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $__rjti$13 + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $__rjti$5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__rjti$5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -18307,7 +19217,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.and @@ -18325,23 +19235,27 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $9 @@ -18365,22 +19279,24 @@ ;; CHECK-NEXT: (i32.const 2147483647) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.tee $2 ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (i32.const 616) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $label$break$L279 - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.le_u - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $9) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $label$break$L279 + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.le_u + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -18428,65 +19344,75 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 656) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 656) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 2147483647) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2147483647) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eq - ;; CHECK-NEXT: (call $_sbrk - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $_sbrk - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eq + ;; CHECK-NEXT: (call $_sbrk + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $_sbrk + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $label$break$L279) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$break$L279) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ne ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) @@ -18510,42 +19436,46 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.const 2147483647) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (call $_sbrk - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (call $_sbrk + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (call $_sbrk - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (call $_sbrk + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.ne - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const -1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $__rjti$13 - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.ne ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.ne + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 40) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $__rjti$13 + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 40) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -18571,9 +19501,11 @@ ;; CHECK-NEXT: (i32.const 612) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 612) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 612) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block $do-once40 @@ -18583,7 +19515,7 @@ ;; CHECK-NEXT: (i32.const 200) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.const 624) ;; CHECK-NEXT: ) @@ -18631,91 +19563,93 @@ ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.ge_u - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $11) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.ge_u ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (local.get $11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 188) + ;; CHECK-NEXT: (local.set $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 188) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 200) - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 188) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=4 - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 200) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 188) ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=4 - ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.store offset=4 ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 40) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 204) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 664) + ;; CHECK-NEXT: (i32.store offset=4 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 40) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 204) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 664) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once40) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once40) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -18729,7 +19663,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: (local.get $1) @@ -18758,7 +19692,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) @@ -18785,10 +19719,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (i32.const 624) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (i32.const 624) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (local.get $1) @@ -18881,7 +19817,7 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 188) ;; CHECK-NEXT: (local.tee $0 @@ -18905,7 +19841,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $5) @@ -18913,7 +19849,7 @@ ;; CHECK-NEXT: (i32.const 196) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 184) ;; CHECK-NEXT: (local.tee $0 @@ -18962,7 +19898,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $11 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.get $0) @@ -18981,7 +19917,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 256) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.load offset=12 ;; CHECK-NEXT: (local.get $5) @@ -19005,13 +19941,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $do-once51 ;; CHECK-NEXT: (i32.eq @@ -19030,7 +19968,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.and @@ -19055,19 +19993,23 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $15 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $15 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -19081,7 +20023,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $15 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -19101,7 +20043,7 @@ ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (i32.load offset=24 ;; CHECK-NEXT: (local.get $5) @@ -19117,7 +20059,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.tee $1 @@ -19136,20 +20078,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $12 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $12 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once55) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once55) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -19165,7 +20111,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) @@ -19186,7 +20132,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) @@ -19202,8 +20148,10 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 0) @@ -19214,7 +20162,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.tee $2 @@ -19224,7 +20172,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ne @@ -19238,7 +20188,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -19252,7 +20204,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (local.get $0) @@ -19265,7 +20217,9 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -19295,7 +20249,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $12) @@ -19320,7 +20274,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $label$break$L331) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $6) @@ -19328,7 +20282,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -19342,13 +20298,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $label$break$L331 @@ -19368,7 +20328,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=24 ;; CHECK-NEXT: (local.get $12) @@ -19385,20 +20347,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=16 - ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=16 + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -19419,8 +20385,10 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store offset=20 ;; CHECK-NEXT: (local.get $12) ;; CHECK-NEXT: (local.get $0) @@ -19445,7 +20413,9 @@ ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 4) @@ -19483,7 +20453,7 @@ ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: (i32.const 256) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.shl @@ -19508,7 +20478,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ge_u ;; CHECK-NEXT: (local.tee $0 @@ -19525,7 +20495,7 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $16 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -19537,7 +20507,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.or @@ -19588,7 +20558,7 @@ ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (br_if $do-once65 ;; CHECK-NEXT: (i32.const 31) @@ -19678,7 +20648,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -19720,7 +20692,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 180) ;; CHECK-NEXT: (i32.or @@ -19811,7 +20783,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) @@ -19829,8 +20801,10 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $8) @@ -19876,7 +20850,7 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store offset=12 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $8) @@ -19898,7 +20872,9 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -19924,17 +20900,19 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $while-out69 - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.tee $2 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.load offset=4 - ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $while-out69 + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.tee $2 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.load offset=4 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -20136,7 +21114,7 @@ ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.and @@ -20173,7 +21151,7 @@ ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.const 256) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.shl @@ -20197,33 +21175,37 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $17 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $7 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $17 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $7 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.or @@ -20272,93 +21254,101 @@ ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.const 16777215) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (i32.const 16777215) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 14) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.tee $2 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 1048320) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 14) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.tee $2 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1048320) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 520192) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 520192) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 245760) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 245760) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 15) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2) @@ -20394,7 +21384,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 180) ;; CHECK-NEXT: (i32.or @@ -20485,7 +21475,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) @@ -20503,8 +21493,10 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (local.get $6) @@ -20550,7 +21542,7 @@ ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store offset=12 ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (local.get $6) @@ -20572,13 +21564,15 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.eqz @@ -20593,9 +21587,11 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store @@ -20802,198 +21798,220 @@ (local.get $0) (i32.const 245) ) - (block - (if - (i32.and - (local.tee $5 - (i32.shr_u - (local.tee $11 - (i32.load - (i32.const 176) + (then + (block + (if + (i32.and + (local.tee $5 + (i32.shr_u + (local.tee $11 + (i32.load + (i32.const 176) + ) ) - ) - (local.tee $13 - (i32.shr_u - (local.tee $4 - (select - (i32.const 16) - (i32.and - (i32.add + (local.tee $13 + (i32.shr_u + (local.tee $4 + (select + (i32.const 16) + (i32.and + (i32.add + (local.get $0) + (i32.const 11) + ) + (i32.const -8) + ) + (i32.lt_u (local.get $0) (i32.const 11) ) - (i32.const -8) - ) - (i32.lt_u - (local.get $0) - (i32.const 11) ) ) + (i32.const 3) ) - (i32.const 3) ) ) ) + (i32.const 3) ) - (i32.const 3) - ) - (block - (local.set $10 - (i32.load - (local.tee $1 - (i32.add - (local.tee $7 - (i32.load - (local.tee $3 - (i32.add - (local.tee $2 + (then + (block + (local.set $10 + (i32.load + (local.tee $1 + (i32.add + (local.tee $7 + (i32.load + (local.tee $3 (i32.add - (i32.shl - (local.tee $4 - (i32.add - (i32.xor - (i32.and - (local.get $5) - (i32.const 1) + (local.tee $2 + (i32.add + (i32.shl + (local.tee $4 + (i32.add + (i32.xor + (i32.and + (local.get $5) + (i32.const 1) + ) + (i32.const 1) + ) + (local.get $13) ) - (i32.const 1) ) - (local.get $13) + (i32.const 3) ) + (i32.const 216) ) - (i32.const 3) ) - (i32.const 216) + (i32.const 8) ) ) - (i32.const 8) ) ) + (i32.const 8) ) ) - (i32.const 8) - ) - ) - ) - ) - (if - (i32.eq - (local.get $2) - (local.get $10) - ) - (i32.store - (i32.const 176) - (i32.and - (local.get $11) - (i32.xor - (i32.shl - (i32.const 1) - (local.get $4) - ) - (i32.const -1) ) ) - ) - (block (if - (i32.lt_u + (i32.eq + (local.get $2) (local.get $10) - (i32.load - (i32.const 192) - ) ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $0 - (i32.add - (local.get $10) - (i32.const 12) + (then + (i32.store + (i32.const 176) + (i32.and + (local.get $11) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $4) + ) + (i32.const -1) ) ) ) - (local.get $7) ) - (block - (i32.store - (local.get $0) - (local.get $2) - ) - (i32.store - (local.get $3) - (local.get $10) + (else + (block + (if + (i32.lt_u + (local.get $10) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $0 + (i32.add + (local.get $10) + (i32.const 12) + ) + ) + ) + (local.get $7) + ) + (then + (block + (i32.store + (local.get $0) + (local.get $2) + ) + (i32.store + (local.get $3) + (local.get $10) + ) + ) + ) + (else + (call $_abort) + ) + ) ) ) - (call $_abort) ) - ) - ) - (i32.store offset=4 - (local.get $7) - (i32.or - (local.tee $0 - (i32.shl - (local.get $4) + (i32.store offset=4 + (local.get $7) + (i32.or + (local.tee $0 + (i32.shl + (local.get $4) + (i32.const 3) + ) + ) (i32.const 3) ) ) - (i32.const 3) - ) - ) - (i32.store - (local.tee $0 - (i32.add - (i32.add - (local.get $7) - (local.get $0) + (i32.store + (local.tee $0 + (i32.add + (i32.add + (local.get $7) + (local.get $0) + ) + (i32.const 4) + ) + ) + (i32.or + (i32.load + (local.get $0) + ) + (i32.const 1) ) - (i32.const 4) ) - ) - (i32.or - (i32.load - (local.get $0) + (return + (local.get $1) ) - (i32.const 1) ) ) - (return - (local.get $1) - ) ) - ) - (if - (i32.gt_u - (local.get $4) - (local.tee $0 - (i32.load - (i32.const 184) + (if + (i32.gt_u + (local.get $4) + (local.tee $0 + (i32.load + (i32.const 184) + ) ) ) - ) - (block - (if - (local.get $5) + (then (block - (local.set $10 - (i32.and - (i32.shr_u - (local.tee $3 - (i32.add - (i32.and + (if + (local.get $5) + (then + (block + (local.set $10 + (i32.and + (i32.shr_u (local.tee $3 - (i32.and - (i32.shl - (local.get $5) - (local.get $13) - ) - (i32.or + (i32.add + (i32.and (local.tee $3 - (i32.shl - (i32.const 2) - (local.get $13) + (i32.and + (i32.shl + (local.get $5) + (local.get $13) + ) + (i32.or + (local.tee $3 + (i32.shl + (i32.const 2) + (local.get $13) + ) + ) + (i32.sub + (i32.const 0) + (local.get $3) + ) + ) ) ) (i32.sub @@ -21001,2416 +22019,2652 @@ (local.get $3) ) ) + (i32.const -1) ) ) - (i32.sub - (i32.const 0) - (local.get $3) - ) + (i32.const 12) ) - (i32.const -1) + (i32.const 16) ) ) - (i32.const 12) - ) - (i32.const 16) - ) - ) - (local.set $9 - (i32.load - (local.tee $7 - (i32.add - (local.tee $12 - (i32.load - (local.tee $3 - (i32.add - (local.tee $10 - (i32.add - (i32.shl - (local.tee $5 + (local.set $9 + (i32.load + (local.tee $7 + (i32.add + (local.tee $12 + (i32.load + (local.tee $3 + (i32.add + (local.tee $10 (i32.add - (i32.or - (i32.or - (i32.or + (i32.shl + (local.tee $5 + (i32.add (i32.or - (local.tee $3 - (i32.and - (i32.shr_u - (local.tee $7 + (i32.or + (i32.or + (i32.or + (local.tee $3 + (i32.and + (i32.shr_u + (local.tee $7 + (i32.shr_u + (local.get $3) + (local.get $10) + ) + ) + (i32.const 5) + ) + (i32.const 8) + ) + ) + (local.get $10) + ) + (local.tee $3 + (i32.and (i32.shr_u - (local.get $3) - (local.get $10) + (local.tee $7 + (i32.shr_u + (local.get $7) + (local.get $3) + ) + ) + (i32.const 2) ) + (i32.const 4) ) - (i32.const 5) ) - (i32.const 8) ) - ) - (local.get $10) - ) - (local.tee $3 - (i32.and - (i32.shr_u - (local.tee $7 + (local.tee $3 + (i32.and (i32.shr_u - (local.get $7) - (local.get $3) + (local.tee $7 + (i32.shr_u + (local.get $7) + (local.get $3) + ) + ) + (i32.const 1) ) + (i32.const 2) ) - (i32.const 2) ) - (i32.const 4) ) - ) - ) - (local.tee $3 - (i32.and - (i32.shr_u - (local.tee $7 + (local.tee $3 + (i32.and (i32.shr_u - (local.get $7) - (local.get $3) + (local.tee $7 + (i32.shr_u + (local.get $7) + (local.get $3) + ) + ) + (i32.const 1) ) + (i32.const 1) ) - (i32.const 1) ) - (i32.const 2) ) - ) - ) - (local.tee $3 - (i32.and (i32.shr_u - (local.tee $7 - (i32.shr_u - (local.get $7) - (local.get $3) - ) - ) - (i32.const 1) + (local.get $7) + (local.get $3) ) - (i32.const 1) ) ) + (i32.const 3) ) - (i32.shr_u - (local.get $7) - (local.get $3) - ) + (i32.const 216) ) ) - (i32.const 3) + (i32.const 8) ) - (i32.const 216) ) ) - (i32.const 8) ) + (i32.const 8) ) ) ) - (i32.const 8) - ) - ) - ) - ) - (if - (i32.eq - (local.get $10) - (local.get $9) - ) - (block - (i32.store - (i32.const 176) - (i32.and - (local.get $11) - (i32.xor - (i32.shl - (i32.const 1) - (local.get $5) - ) - (i32.const -1) - ) - ) - ) - (local.set $8 - (local.get $0) - ) - ) - (block - (if - (i32.lt_u - (local.get $9) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $0 - (i32.add - (local.get $9) - (i32.const 12) - ) - ) - ) - (local.get $12) ) - (block - (i32.store - (local.get $0) + (if + (i32.eq (local.get $10) - ) - (i32.store - (local.get $3) (local.get $9) ) - (local.set $8 - (i32.load - (i32.const 184) - ) - ) - ) - (call $_abort) - ) - ) - ) - (i32.store offset=4 - (local.get $12) - (i32.or - (local.get $4) - (i32.const 3) - ) - ) - (i32.store offset=4 - (local.tee $10 - (i32.add - (local.get $12) - (local.get $4) - ) - ) - (i32.or - (local.tee $5 - (i32.sub - (i32.shl - (local.get $5) - (i32.const 3) - ) - (local.get $4) - ) - ) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (local.get $10) - (local.get $5) - ) - (local.get $5) - ) - (if - (local.get $8) - (block - (local.set $12 - (i32.load - (i32.const 196) - ) - ) - (local.set $4 - (i32.add - (i32.shl - (local.tee $0 - (i32.shr_u - (local.get $8) - (i32.const 3) + (then + (block + (i32.store + (i32.const 176) + (i32.and + (local.get $11) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $5) + ) + (i32.const -1) + ) + ) + ) + (local.set $8 + (local.get $0) ) - ) - (i32.const 3) - ) - (i32.const 216) - ) - ) - (if - (i32.and - (local.tee $3 - (i32.load - (i32.const 176) - ) - ) - (local.tee $0 - (i32.shl - (i32.const 1) - (local.get $0) ) ) - ) - (if - (i32.lt_u - (local.tee $0 - (i32.load - (local.tee $3 - (i32.add - (local.get $4) - (i32.const 8) + (else + (block + (if + (i32.lt_u + (local.get $9) + (i32.load + (i32.const 192) ) ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $0 + (i32.add + (local.get $9) + (i32.const 12) + ) + ) + ) + (local.get $12) + ) + (then + (block + (i32.store + (local.get $0) + (local.get $10) + ) + (i32.store + (local.get $3) + (local.get $9) + ) + (local.set $8 + (i32.load + (i32.const 184) + ) + ) + ) + ) + (else + (call $_abort) + ) ) - ) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (local.set $2 - (local.get $3) - ) - (local.set $1 - (local.get $0) ) ) ) - (block - (i32.store - (i32.const 176) - (i32.or - (local.get $3) - (local.get $0) - ) + (i32.store offset=4 + (local.get $12) + (i32.or + (local.get $4) + (i32.const 3) ) - (local.set $2 + ) + (i32.store offset=4 + (local.tee $10 (i32.add + (local.get $12) (local.get $4) - (i32.const 8) ) ) - (local.set $1 - (local.get $4) - ) - ) - ) - (i32.store - (local.get $2) - (local.get $12) - ) - (i32.store offset=12 - (local.get $1) - (local.get $12) - ) - (i32.store offset=8 - (local.get $12) - (local.get $1) - ) - (i32.store offset=12 - (local.get $12) - (local.get $4) - ) - ) - ) - (i32.store - (i32.const 184) - (local.get $5) - ) - (i32.store - (i32.const 196) - (local.get $10) - ) - (return - (local.get $7) - ) - ) - ) - (if - (local.tee $0 - (i32.load - (i32.const 180) - ) - ) - (block - (local.set $2 - (i32.and - (i32.shr_u - (local.tee $0 - (i32.add - (i32.and - (local.get $0) + (i32.or + (local.tee $5 (i32.sub - (i32.const 0) - (local.get $0) + (i32.shl + (local.get $5) + (i32.const 3) + ) + (local.get $4) ) ) - (i32.const -1) + (i32.const 1) ) ) - (i32.const 12) - ) - (i32.const 16) - ) - ) - (local.set $7 - (i32.sub - (i32.and - (i32.load offset=4 - (local.tee $0 - (i32.load offset=480 - (i32.shl + (i32.store + (i32.add + (local.get $10) + (local.get $5) + ) + (local.get $5) + ) + (if + (local.get $8) + (then + (block + (local.set $12 + (i32.load + (i32.const 196) + ) + ) + (local.set $4 (i32.add - (i32.or - (i32.or - (i32.or - (i32.or - (local.tee $0 - (i32.and - (i32.shr_u - (local.tee $1 - (i32.shr_u - (local.get $0) - (local.get $2) - ) - ) - (i32.const 5) - ) - (i32.const 8) - ) - ) - (local.get $2) - ) - (local.tee $0 - (i32.and - (i32.shr_u - (local.tee $1 - (i32.shr_u - (local.get $1) - (local.get $0) - ) - ) - (i32.const 2) - ) - (i32.const 4) - ) - ) + (i32.shl + (local.tee $0 + (i32.shr_u + (local.get $8) + (i32.const 3) ) + ) + (i32.const 3) + ) + (i32.const 216) + ) + ) + (if + (i32.and + (local.tee $3 + (i32.load + (i32.const 176) + ) + ) + (local.tee $0 + (i32.shl + (i32.const 1) + (local.get $0) + ) + ) + ) + (then + (if + (i32.lt_u (local.tee $0 - (i32.and - (i32.shr_u - (local.tee $1 - (i32.shr_u - (local.get $1) - (local.get $0) - ) + (i32.load + (local.tee $3 + (i32.add + (local.get $4) + (i32.const 8) ) - (i32.const 1) ) - (i32.const 2) ) ) + (i32.load + (i32.const 192) + ) ) - (local.tee $0 - (i32.and - (i32.shr_u - (local.tee $1 - (i32.shr_u - (local.get $1) - (local.get $0) - ) - ) - (i32.const 1) + (then + (call $_abort) + ) + (else + (block + (local.set $2 + (local.get $3) + ) + (local.set $1 + (local.get $0) ) - (i32.const 1) ) ) ) - (i32.shr_u - (local.get $1) - (local.get $0) + ) + (else + (block + (i32.store + (i32.const 176) + (i32.or + (local.get $3) + (local.get $0) + ) + ) + (local.set $2 + (i32.add + (local.get $4) + (i32.const 8) + ) + ) + (local.set $1 + (local.get $4) + ) ) ) - (i32.const 2) ) - ) - ) - ) - (i32.const -8) - ) - (local.get $4) - ) - ) - (local.set $1 - (local.get $0) - ) - (local.set $2 - (local.get $0) - ) - (loop $while-in - (block $while-out - (if - (i32.eqz - (local.tee $0 - (i32.load offset=16 - (local.get $1) - ) - ) - ) - (if - (i32.eqz - (local.tee $0 - (i32.load offset=20 + (i32.store + (local.get $2) + (local.get $12) + ) + (i32.store offset=12 (local.get $1) + (local.get $12) ) - ) - ) - (block - (local.set $10 - (local.get $7) - ) - (local.set $5 - (local.get $2) - ) - (br $while-out) - ) - ) - ) - (local.set $10 - (i32.lt_u - (local.tee $1 - (i32.sub - (i32.and - (i32.load offset=4 - (local.get $0) - ) - (i32.const -8) + (i32.store offset=8 + (local.get $12) + (local.get $1) + ) + (i32.store offset=12 + (local.get $12) + (local.get $4) ) - (local.get $4) ) ) - (local.get $7) ) - ) - (local.set $7 - (select - (local.get $1) - (local.get $7) - (local.get $10) + (i32.store + (i32.const 184) + (local.get $5) ) - ) - (local.set $1 - (local.get $0) - ) - (local.set $2 - (select - (local.get $0) - (local.get $2) + (i32.store + (i32.const 196) (local.get $10) ) - ) - (br $while-in) - ) - ) - (if - (i32.lt_u - (local.get $5) - (local.tee $12 - (i32.load - (i32.const 192) + (return + (local.get $7) ) ) ) - (call $_abort) ) (if - (i32.ge_u - (local.get $5) - (local.tee $11 - (i32.add - (local.get $5) - (local.get $4) - ) + (local.tee $0 + (i32.load + (i32.const 180) ) ) - (call $_abort) - ) - (local.set $8 - (i32.load offset=24 - (local.get $5) - ) - ) - (block $do-once4 - (if - (i32.eq - (local.tee $0 - (i32.load offset=12 - (local.get $5) - ) - ) - (local.get $5) - ) + (then (block - (if - (i32.eqz - (local.tee $1 - (i32.load - (local.tee $0 - (i32.add - (local.get $5) - (i32.const 20) + (local.set $2 + (i32.and + (i32.shr_u + (local.tee $0 + (i32.add + (i32.and + (local.get $0) + (i32.sub + (i32.const 0) + (local.get $0) + ) ) + (i32.const -1) ) ) + (i32.const 12) ) + (i32.const 16) ) - (if - (i32.eqz - (local.tee $1 - (i32.load - (local.tee $0 - (i32.add - (local.get $5) - (i32.const 16) + ) + (local.set $7 + (i32.sub + (i32.and + (i32.load offset=4 + (local.tee $0 + (i32.load offset=480 + (i32.shl + (i32.add + (i32.or + (i32.or + (i32.or + (i32.or + (local.tee $0 + (i32.and + (i32.shr_u + (local.tee $1 + (i32.shr_u + (local.get $0) + (local.get $2) + ) + ) + (i32.const 5) + ) + (i32.const 8) + ) + ) + (local.get $2) + ) + (local.tee $0 + (i32.and + (i32.shr_u + (local.tee $1 + (i32.shr_u + (local.get $1) + (local.get $0) + ) + ) + (i32.const 2) + ) + (i32.const 4) + ) + ) + ) + (local.tee $0 + (i32.and + (i32.shr_u + (local.tee $1 + (i32.shr_u + (local.get $1) + (local.get $0) + ) + ) + (i32.const 1) + ) + (i32.const 2) + ) + ) + ) + (local.tee $0 + (i32.and + (i32.shr_u + (local.tee $1 + (i32.shr_u + (local.get $1) + (local.get $0) + ) + ) + (i32.const 1) + ) + (i32.const 1) + ) + ) + ) + (i32.shr_u + (local.get $1) + (local.get $0) + ) + ) + (i32.const 2) ) ) ) ) + (i32.const -8) ) - (block - (local.set $9 - (i32.const 0) - ) - (br $do-once4) - ) + (local.get $4) ) ) - (loop $while-in7 - (if - (local.tee $2 - (i32.load - (local.tee $7 - (i32.add + (local.set $1 + (local.get $0) + ) + (local.set $2 + (local.get $0) + ) + (loop $while-in + (block $while-out + (if + (i32.eqz + (local.tee $0 + (i32.load offset=16 (local.get $1) - (i32.const 20) ) ) ) - ) - (block - (local.set $1 - (local.get $2) - ) - (local.set $0 - (local.get $7) + (then + (if + (i32.eqz + (local.tee $0 + (i32.load offset=20 + (local.get $1) + ) + ) + ) + (then + (block + (local.set $10 + (local.get $7) + ) + (local.set $5 + (local.get $2) + ) + (br $while-out) + ) + ) + ) ) - (br $while-in7) ) - ) - (if - (local.tee $2 - (i32.load - (local.tee $7 - (i32.add - (local.get $1) - (i32.const 16) + (local.set $10 + (i32.lt_u + (local.tee $1 + (i32.sub + (i32.and + (i32.load offset=4 + (local.get $0) + ) + (i32.const -8) + ) + (local.get $4) ) ) + (local.get $7) ) ) - (block - (local.set $1 - (local.get $2) - ) - (local.set $0 + (local.set $7 + (select + (local.get $1) (local.get $7) + (local.get $10) ) - (br $while-in7) ) - ) - ) - (if - (i32.lt_u - (local.get $0) - (local.get $12) - ) - (call $_abort) - (block - (i32.store + (local.set $1 (local.get $0) - (i32.const 0) ) - (local.set $9 - (local.get $1) + (local.set $2 + (select + (local.get $0) + (local.get $2) + (local.get $10) + ) ) + (br $while-in) ) ) - ) - (block (if (i32.lt_u - (local.tee $7 - (i32.load offset=8 - (local.get $5) + (local.get $5) + (local.tee $12 + (i32.load + (i32.const 192) ) ) - (local.get $12) ) - (call $_abort) - ) - (if - (i32.ne - (i32.load - (local.tee $2 - (i32.add - (local.get $7) - (i32.const 12) - ) - ) - ) - (local.get $5) + (then + (call $_abort) ) - (call $_abort) ) (if - (i32.eq - (i32.load - (local.tee $1 - (i32.add - (local.get $0) - (i32.const 8) - ) + (i32.ge_u + (local.get $5) + (local.tee $11 + (i32.add + (local.get $5) + (local.get $4) ) ) - (local.get $5) ) - (block - (i32.store - (local.get $2) - (local.get $0) - ) - (i32.store - (local.get $1) - (local.get $7) - ) - (local.set $9 - (local.get $0) - ) + (then + (call $_abort) ) - (call $_abort) ) - ) - ) - ) - (block $do-once8 - (if - (local.get $8) - (block - (if - (i32.eq + (local.set $8 + (i32.load offset=24 (local.get $5) - (i32.load + ) + ) + (block $do-once4 + (if + (i32.eq (local.tee $0 - (i32.add - (i32.shl + (i32.load offset=12 + (local.get $5) + ) + ) + (local.get $5) + ) + (then + (block + (if + (i32.eqz (local.tee $1 - (i32.load offset=28 - (local.get $5) + (i32.load + (local.tee $0 + (i32.add + (local.get $5) + (i32.const 20) + ) + ) + ) + ) + ) + (then + (if + (i32.eqz + (local.tee $1 + (i32.load + (local.tee $0 + (i32.add + (local.get $5) + (i32.const 16) + ) + ) + ) + ) + ) + (then + (block + (local.set $9 + (i32.const 0) + ) + (br $do-once4) + ) + ) + ) + ) + ) + (loop $while-in7 + (if + (local.tee $2 + (i32.load + (local.tee $7 + (i32.add + (local.get $1) + (i32.const 20) + ) + ) + ) + ) + (then + (block + (local.set $1 + (local.get $2) + ) + (local.set $0 + (local.get $7) + ) + (br $while-in7) + ) + ) + ) + (if + (local.tee $2 + (i32.load + (local.tee $7 + (i32.add + (local.get $1) + (i32.const 16) + ) + ) + ) + ) + (then + (block + (local.set $1 + (local.get $2) + ) + (local.set $0 + (local.get $7) + ) + (br $while-in7) + ) + ) + ) + ) + (if + (i32.lt_u + (local.get $0) + (local.get $12) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store + (local.get $0) + (i32.const 0) + ) + (local.set $9 + (local.get $1) ) ) - (i32.const 2) ) - (i32.const 480) ) ) ) - ) - (block - (i32.store - (local.get $0) - (local.get $9) - ) - (if - (i32.eqz - (local.get $9) - ) + (else (block - (i32.store - (i32.const 180) - (i32.and + (if + (i32.lt_u + (local.tee $7 + (i32.load offset=8 + (local.get $5) + ) + ) + (local.get $12) + ) + (then + (call $_abort) + ) + ) + (if + (i32.ne (i32.load - (i32.const 180) + (local.tee $2 + (i32.add + (local.get $7) + (i32.const 12) + ) + ) ) - (i32.xor - (i32.shl - (i32.const 1) + (local.get $5) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $1 + (i32.add + (local.get $0) + (i32.const 8) + ) + ) + ) + (local.get $5) + ) + (then + (block + (i32.store + (local.get $2) + (local.get $0) + ) + (i32.store (local.get $1) + (local.get $7) + ) + (local.set $9 + (local.get $0) ) - (i32.const -1) ) ) + (else + (call $_abort) + ) ) - (br $do-once8) ) ) ) - (block - (if - (i32.lt_u - (local.get $8) - (i32.load - (i32.const 192) + ) + (block $do-once8 + (if + (local.get $8) + (then + (block + (if + (i32.eq + (local.get $5) + (i32.load + (local.tee $0 + (i32.add + (i32.shl + (local.tee $1 + (i32.load offset=28 + (local.get $5) + ) + ) + (i32.const 2) + ) + (i32.const 480) + ) + ) + ) + ) + (then + (block + (i32.store + (local.get $0) + (local.get $9) + ) + (if + (i32.eqz + (local.get $9) + ) + (then + (block + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $1) + ) + (i32.const -1) + ) + ) + ) + (br $do-once8) + ) + ) + ) + ) + ) + (else + (block + (if + (i32.lt_u + (local.get $8) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $0 + (i32.add + (local.get $8) + (i32.const 16) + ) + ) + ) + (local.get $5) + ) + (then + (i32.store + (local.get $0) + (local.get $9) + ) + ) + (else + (i32.store offset=20 + (local.get $8) + (local.get $9) + ) + ) + ) + (br_if $do-once8 + (i32.eqz + (local.get $9) + ) + ) + ) + ) ) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load + (if + (i32.lt_u + (local.get $9) + (local.tee $0 + (i32.load + (i32.const 192) + ) + ) + ) + (then + (call $_abort) + ) + ) + (i32.store offset=24 + (local.get $9) + (local.get $8) + ) + (if + (local.tee $1 + (i32.load offset=16 + (local.get $5) + ) + ) + (then + (if + (i32.lt_u + (local.get $1) + (local.get $0) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=16 + (local.get $9) + (local.get $1) + ) + (i32.store offset=24 + (local.get $1) + (local.get $9) + ) + ) + ) + ) + ) + ) + (if (local.tee $0 - (i32.add - (local.get $8) - (i32.const 16) + (i32.load offset=20 + (local.get $5) + ) + ) + (then + (if + (i32.lt_u + (local.get $0) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=20 + (local.get $9) + (local.get $0) + ) + (i32.store offset=24 + (local.get $0) + (local.get $9) + ) + ) + ) ) ) ) - (local.get $5) - ) - (i32.store - (local.get $0) - (local.get $9) - ) - (i32.store offset=20 - (local.get $8) - (local.get $9) - ) - ) - (br_if $do-once8 - (i32.eqz - (local.get $9) ) ) ) ) (if (i32.lt_u - (local.get $9) - (local.tee $0 - (i32.load - (i32.const 192) - ) - ) - ) - (call $_abort) - ) - (i32.store offset=24 - (local.get $9) - (local.get $8) - ) - (if - (local.tee $1 - (i32.load offset=16 - (local.get $5) - ) - ) - (if - (i32.lt_u - (local.get $1) - (local.get $0) - ) - (call $_abort) - (block - (i32.store offset=16 - (local.get $9) - (local.get $1) - ) - (i32.store offset=24 - (local.get $1) - (local.get $9) - ) - ) - ) - ) - (if - (local.tee $0 - (i32.load offset=20 - (local.get $5) - ) + (local.get $10) + (i32.const 16) ) - (if - (i32.lt_u - (local.get $0) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) + (then (block - (i32.store offset=20 - (local.get $9) - (local.get $0) - ) - (i32.store offset=24 - (local.get $0) - (local.get $9) + (i32.store offset=4 + (local.get $5) + (i32.or + (local.tee $0 + (i32.add + (local.get $10) + (local.get $4) + ) + ) + (i32.const 3) + ) ) - ) - ) - ) - ) - ) - ) - (if - (i32.lt_u - (local.get $10) - (i32.const 16) - ) - (block - (i32.store offset=4 - (local.get $5) - (i32.or - (local.tee $0 - (i32.add - (local.get $10) - (local.get $4) - ) - ) - (i32.const 3) - ) - ) - (i32.store - (local.tee $0 - (i32.add - (i32.add - (local.get $5) - (local.get $0) - ) - (i32.const 4) - ) - ) - (i32.or - (i32.load - (local.get $0) - ) - (i32.const 1) - ) - ) - ) - (block - (i32.store offset=4 - (local.get $5) - (i32.or - (local.get $4) - (i32.const 3) - ) - ) - (i32.store offset=4 - (local.get $11) - (i32.or - (local.get $10) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (local.get $11) - (local.get $10) - ) - (local.get $10) - ) - (if - (local.tee $0 - (i32.load - (i32.const 184) - ) - ) - (block - (local.set $4 - (i32.load - (i32.const 196) - ) - ) - (local.set $2 - (i32.add - (i32.shl + (i32.store (local.tee $0 - (i32.shr_u + (i32.add + (i32.add + (local.get $5) + (local.get $0) + ) + (i32.const 4) + ) + ) + (i32.or + (i32.load (local.get $0) - (i32.const 3) ) + (i32.const 1) ) - (i32.const 3) ) - (i32.const 216) ) ) - (if - (i32.and - (local.tee $1 - (i32.load - (i32.const 176) + (else + (block + (i32.store offset=4 + (local.get $5) + (i32.or + (local.get $4) + (i32.const 3) ) ) - (local.tee $0 - (i32.shl + (i32.store offset=4 + (local.get $11) + (i32.or + (local.get $10) (i32.const 1) - (local.get $0) ) ) - ) - (if - (i32.lt_u + (i32.store + (i32.add + (local.get $11) + (local.get $10) + ) + (local.get $10) + ) + (if (local.tee $0 (i32.load - (local.tee $1 + (i32.const 184) + ) + ) + (then + (block + (local.set $4 + (i32.load + (i32.const 196) + ) + ) + (local.set $2 (i32.add - (local.get $2) - (i32.const 8) + (i32.shl + (local.tee $0 + (i32.shr_u + (local.get $0) + (i32.const 3) + ) + ) + (i32.const 3) + ) + (i32.const 216) ) ) + (if + (i32.and + (local.tee $1 + (i32.load + (i32.const 176) + ) + ) + (local.tee $0 + (i32.shl + (i32.const 1) + (local.get $0) + ) + ) + ) + (then + (if + (i32.lt_u + (local.tee $0 + (i32.load + (local.tee $1 + (i32.add + (local.get $2) + (i32.const 8) + ) + ) + ) + ) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (local.set $6 + (local.get $1) + ) + (local.set $3 + (local.get $0) + ) + ) + ) + ) + ) + (else + (block + (i32.store + (i32.const 176) + (i32.or + (local.get $1) + (local.get $0) + ) + ) + (local.set $6 + (i32.add + (local.get $2) + (i32.const 8) + ) + ) + (local.set $3 + (local.get $2) + ) + ) + ) + ) + (i32.store + (local.get $6) + (local.get $4) + ) + (i32.store offset=12 + (local.get $3) + (local.get $4) + ) + (i32.store offset=8 + (local.get $4) + (local.get $3) + ) + (i32.store offset=12 + (local.get $4) + (local.get $2) + ) ) ) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (local.set $6 - (local.get $1) - ) - (local.set $3 - (local.get $0) - ) ) - ) - (block (i32.store - (i32.const 176) - (i32.or - (local.get $1) - (local.get $0) - ) - ) - (local.set $6 - (i32.add - (local.get $2) - (i32.const 8) - ) + (i32.const 184) + (local.get $10) ) - (local.set $3 - (local.get $2) + (i32.store + (i32.const 196) + (local.get $11) ) ) ) - (i32.store - (local.get $6) - (local.get $4) - ) - (i32.store offset=12 - (local.get $3) - (local.get $4) - ) - (i32.store offset=8 - (local.get $4) - (local.get $3) - ) - (i32.store offset=12 - (local.get $4) - (local.get $2) + ) + (return + (i32.add + (local.get $5) + (i32.const 8) ) ) ) - (i32.store - (i32.const 184) - (local.get $10) - ) - (i32.store - (i32.const 196) - (local.get $11) - ) ) - ) - (return - (i32.add - (local.get $5) - (i32.const 8) + (else + (local.set $0 + (local.get $4) + ) ) ) ) + ) + (else (local.set $0 (local.get $4) ) ) ) - (local.set $0 - (local.get $4) - ) ) ) - (if - (i32.gt_u - (local.get $0) - (i32.const -65) - ) - (local.set $0 - (i32.const -1) - ) - (block - (local.set $2 - (i32.and - (local.tee $0 - (i32.add - (local.get $0) - (i32.const 11) - ) - ) - (i32.const -8) - ) + (else + (if + (i32.gt_u + (local.get $0) + (i32.const -65) ) - (if - (local.tee $18 - (i32.load - (i32.const 180) - ) + (then + (local.set $0 + (i32.const -1) ) + ) + (else (block - (local.set $14 - (if (result i32) + (local.set $2 + (i32.and (local.tee $0 - (i32.shr_u + (i32.add (local.get $0) - (i32.const 8) + (i32.const 11) ) ) - (if (result i32) - (i32.gt_u - (local.get $2) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (local.get $2) - (i32.add - (local.tee $0 - (i32.add - (i32.sub - (i32.const 14) - (i32.or - (i32.or + (i32.const -8) + ) + ) + (if + (local.tee $18 + (i32.load + (i32.const 180) + ) + ) + (then + (block + (local.set $14 + (if (result i32) + (local.tee $0 + (i32.shr_u + (local.get $0) + (i32.const 8) + ) + ) + (then + (if (result i32) + (i32.gt_u + (local.get $2) + (i32.const 16777215) + ) + (then + (i32.const 31) + ) + (else + (i32.or + (i32.and + (i32.shr_u + (local.get $2) + (i32.add (local.tee $0 - (i32.and - (i32.shr_u - (i32.add - (local.tee $1 - (i32.shl - (local.get $0) - (local.tee $3 - (i32.and - (i32.shr_u - (i32.add + (i32.add + (i32.sub + (i32.const 14) + (i32.or + (i32.or + (local.tee $0 + (i32.and + (i32.shr_u + (i32.add + (local.tee $1 + (i32.shl + (local.get $0) + (local.tee $3 + (i32.and + (i32.shr_u + (i32.add + (local.get $0) + (i32.const 1048320) + ) + (i32.const 16) + ) + (i32.const 8) + ) + ) + ) + ) + (i32.const 520192) + ) + (i32.const 16) + ) + (i32.const 4) + ) + ) + (local.get $3) + ) + (local.tee $0 + (i32.and + (i32.shr_u + (i32.add + (local.tee $1 + (i32.shl + (local.get $1) (local.get $0) - (i32.const 1048320) ) - (i32.const 16) ) - (i32.const 8) + (i32.const 245760) ) + (i32.const 16) ) + (i32.const 2) ) ) - (i32.const 520192) ) - (i32.const 16) ) - (i32.const 4) - ) - ) - (local.get $3) - ) - (local.tee $0 - (i32.and - (i32.shr_u - (i32.add - (local.tee $1 - (i32.shl - (local.get $1) - (local.get $0) - ) + (i32.shr_u + (i32.shl + (local.get $1) + (local.get $0) ) - (i32.const 245760) + (i32.const 15) ) - (i32.const 16) ) - (i32.const 2) ) + (i32.const 7) ) ) + (i32.const 1) ) - (i32.shr_u - (i32.shl - (local.get $1) - (local.get $0) - ) - (i32.const 15) + (i32.shl + (local.get $0) + (i32.const 1) ) ) ) - (i32.const 7) ) ) - (i32.const 1) - ) - (i32.shl - (local.get $0) - (i32.const 1) - ) - ) - ) - (i32.const 0) - ) - ) - (local.set $3 - (i32.sub - (i32.const 0) - (local.get $2) - ) - ) - (block $__rjto$3 - (block $__rjti$3 - (if - (local.tee $0 - (i32.load offset=480 - (i32.shl - (local.get $14) - (i32.const 2) + (else + (i32.const 0) ) ) ) - (block - (local.set $6 - (i32.const 0) - ) - (local.set $8 - (i32.shl - (local.get $2) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (local.get $14) - (i32.const 1) - ) - ) - (i32.eq - (local.get $14) - (i32.const 31) - ) - ) - ) - ) - (local.set $1 + (local.set $3 + (i32.sub (i32.const 0) + (local.get $2) ) - (loop $while-in14 + ) + (block $__rjto$3 + (block $__rjti$3 (if - (i32.lt_u - (local.tee $4 - (i32.sub - (local.tee $9 - (i32.and - (i32.load offset=4 - (local.get $0) - ) - (i32.const -8) - ) - ) - (local.get $2) + (local.tee $0 + (i32.load offset=480 + (i32.shl + (local.get $14) + (i32.const 2) ) ) - (local.get $3) ) - (if - (i32.eq - (local.get $9) - (local.get $2) - ) + (then (block - (local.set $1 - (local.get $4) - ) - (local.set $3 - (local.get $0) - ) - (br $__rjti$3) - ) - (block - (local.set $3 - (local.get $4) - ) - (local.set $1 - (local.get $0) - ) - ) - ) - ) - (local.set $0 - (select - (local.get $6) - (local.tee $4 - (i32.load offset=20 - (local.get $0) - ) - ) - (i32.or - (i32.eqz - (local.get $4) + (local.set $6 + (i32.const 0) ) - (i32.eq - (local.get $4) - (local.tee $9 - (i32.load - (i32.add - (i32.add - (local.get $0) - (i32.const 16) - ) - (i32.shl - (i32.shr_u - (local.get $8) - (i32.const 31) - ) - (i32.const 2) + (local.set $8 + (i32.shl + (local.get $2) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u + (local.get $14) + (i32.const 1) ) ) + (i32.eq + (local.get $14) + (i32.const 31) + ) ) ) ) - ) - ) - ) - (local.set $4 - (i32.shl - (local.get $8) - (i32.xor - (local.tee $6 - (i32.eqz - (local.get $9) - ) - ) - (i32.const 1) - ) - ) - ) - (if - (local.get $6) - (block - (local.set $4 - (local.get $0) - ) - (local.set $0 - (local.get $1) - ) - ) - (block - (local.set $6 - (local.get $0) - ) - (local.set $8 - (local.get $4) - ) - (local.set $0 - (local.get $9) - ) - (br $while-in14) - ) - ) - ) - ) - (block - (local.set $4 - (i32.const 0) - ) - (local.set $0 - (i32.const 0) - ) - ) - ) - (if - (i32.and - (i32.eqz - (local.get $4) - ) - (i32.eqz - (local.get $0) - ) - ) - (block - (if - (i32.eqz - (local.tee $1 - (i32.and - (local.get $18) - (i32.or - (local.tee $1 - (i32.shl - (i32.const 2) - (local.get $14) - ) - ) - (i32.sub - (i32.const 0) - (local.get $1) - ) - ) - ) - ) - ) - (block - (local.set $0 - (local.get $2) - ) - (br $do-once) - ) - ) - (local.set $9 - (i32.and - (i32.shr_u - (local.tee $1 - (i32.add - (i32.and - (local.get $1) - (i32.sub - (i32.const 0) - (local.get $1) - ) - ) - (i32.const -1) + (local.set $1 + (i32.const 0) ) - ) - (i32.const 12) - ) - (i32.const 16) - ) - ) - (local.set $4 - (i32.load offset=480 - (i32.shl - (i32.add - (i32.or - (i32.or - (i32.or - (i32.or - (local.tee $1 - (i32.and - (i32.shr_u - (local.tee $4 - (i32.shr_u - (local.get $1) - (local.get $9) - ) + (loop $while-in14 + (if + (i32.lt_u + (local.tee $4 + (i32.sub + (local.tee $9 + (i32.and + (i32.load offset=4 + (local.get $0) ) - (i32.const 5) + (i32.const -8) ) - (i32.const 8) ) + (local.get $2) ) - (local.get $9) ) - (local.tee $1 - (i32.and - (i32.shr_u - (local.tee $4 - (i32.shr_u - (local.get $4) - (local.get $1) - ) + (local.get $3) + ) + (then + (if + (i32.eq + (local.get $9) + (local.get $2) + ) + (then + (block + (local.set $1 + (local.get $4) ) - (i32.const 2) + (local.set $3 + (local.get $0) + ) + (br $__rjti$3) ) - (i32.const 4) ) - ) - ) - (local.tee $1 - (i32.and - (i32.shr_u - (local.tee $4 - (i32.shr_u + (else + (block + (local.set $3 (local.get $4) - (local.get $1) + ) + (local.set $1 + (local.get $0) ) ) - (i32.const 1) ) - (i32.const 2) ) ) ) - (local.tee $1 - (i32.and - (i32.shr_u - (local.tee $4 - (i32.shr_u - (local.get $4) - (local.get $1) - ) + (local.set $0 + (select + (local.get $6) + (local.tee $4 + (i32.load offset=20 + (local.get $0) ) - (i32.const 1) ) - (i32.const 1) - ) - ) - ) - (i32.shr_u - (local.get $4) - (local.get $1) - ) - ) - (i32.const 2) - ) - ) - ) - ) - ) - (if - (local.get $4) - (block - (local.set $1 - (local.get $3) - ) - (local.set $3 - (local.get $4) - ) - (br $__rjti$3) - ) - (local.set $4 - (local.get $0) - ) - ) - (br $__rjto$3) - ) - (loop $while-in16 - (local.set $9 - (i32.lt_u - (local.tee $4 - (i32.sub - (i32.and - (i32.load offset=4 - (local.get $3) - ) - (i32.const -8) - ) - (local.get $2) - ) - ) - (local.get $1) - ) - ) - (local.set $1 - (select - (local.get $4) - (local.get $1) - (local.get $9) - ) - ) - (local.set $0 - (select - (local.get $3) - (local.get $0) - (local.get $9) - ) - ) - (if - (local.tee $4 - (i32.load offset=16 - (local.get $3) - ) - ) - (block - (local.set $3 - (local.get $4) - ) - (br $while-in16) - ) - ) - (br_if $while-in16 - (local.tee $3 - (i32.load offset=20 - (local.get $3) - ) - ) - ) - (local.set $3 - (local.get $1) - ) - (local.set $4 - (local.get $0) - ) - ) - ) - (if - (local.get $4) - (if - (i32.lt_u - (local.get $3) - (i32.sub - (i32.load - (i32.const 184) - ) - (local.get $2) - ) - ) - (block - (if - (i32.lt_u - (local.get $4) - (local.tee $12 - (i32.load - (i32.const 192) - ) - ) - ) - (call $_abort) - ) - (if - (i32.ge_u - (local.get $4) - (local.tee $6 - (i32.add - (local.get $4) - (local.get $2) - ) - ) - ) - (call $_abort) - ) - (local.set $9 - (i32.load offset=24 - (local.get $4) - ) - ) - (block $do-once17 - (if - (i32.eq - (local.tee $0 - (i32.load offset=12 - (local.get $4) - ) - ) - (local.get $4) - ) - (block - (if - (i32.eqz - (local.tee $1 - (i32.load - (local.tee $0 - (i32.add - (local.get $4) - (i32.const 20) + (i32.or + (i32.eqz + (local.get $4) + ) + (i32.eq + (local.get $4) + (local.tee $9 + (i32.load + (i32.add + (i32.add + (local.get $0) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (local.get $8) + (i32.const 31) + ) + (i32.const 2) + ) + ) + ) + ) + ) ) ) ) - ) - ) - (if - (i32.eqz - (local.tee $1 - (i32.load - (local.tee $0 - (i32.add - (local.get $4) - (i32.const 16) + (local.set $4 + (i32.shl + (local.get $8) + (i32.xor + (local.tee $6 + (i32.eqz + (local.get $9) + ) ) + (i32.const 1) ) ) ) - ) - (block - (local.set $11 - (i32.const 0) - ) - (br $do-once17) - ) - ) - ) - (loop $while-in20 - (if - (local.tee $7 - (i32.load - (local.tee $10 - (i32.add - (local.get $1) - (i32.const 20) + (if + (local.get $6) + (then + (block + (local.set $4 + (local.get $0) + ) + (local.set $0 + (local.get $1) + ) ) ) - ) - ) - (block - (local.set $1 - (local.get $7) - ) - (local.set $0 - (local.get $10) - ) - (br $while-in20) - ) - ) - (if - (local.tee $7 - (i32.load - (local.tee $10 - (i32.add - (local.get $1) - (i32.const 16) + (else + (block + (local.set $6 + (local.get $0) + ) + (local.set $8 + (local.get $4) + ) + (local.set $0 + (local.get $9) + ) + (br $while-in14) ) ) ) ) - (block - (local.set $1 - (local.get $7) - ) - (local.set $0 - (local.get $10) - ) - (br $while-in20) - ) ) ) - (if - (i32.lt_u - (local.get $0) - (local.get $12) - ) - (call $_abort) + (else (block - (i32.store - (local.get $0) + (local.set $4 (i32.const 0) ) - (local.set $11 - (local.get $1) + (local.set $0 + (i32.const 0) ) ) ) ) - (block - (if - (i32.lt_u - (local.tee $10 - (i32.load offset=8 - (local.get $4) - ) - ) - (local.get $12) - ) - (call $_abort) - ) - (if - (i32.ne - (i32.load - (local.tee $7 - (i32.add - (local.get $10) - (i32.const 12) - ) - ) - ) - (local.get $4) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $1 - (i32.add - (local.get $0) - (i32.const 8) - ) - ) - ) + (if + (i32.and + (i32.eqz (local.get $4) ) - (block - (i32.store - (local.get $7) - (local.get $0) - ) - (i32.store - (local.get $1) - (local.get $10) - ) - (local.set $11 - (local.get $0) - ) + (i32.eqz + (local.get $0) ) - (call $_abort) ) - ) - ) - ) - (block $do-once21 - (if - (local.get $9) - (block - (if - (i32.eq - (local.get $4) - (i32.load - (local.tee $0 - (i32.add - (i32.shl - (local.tee $1 - (i32.load offset=28 - (local.get $4) - ) - ) - (i32.const 2) - ) - (i32.const 480) - ) - ) - ) - ) + (then (block - (i32.store - (local.get $0) - (local.get $11) - ) (if (i32.eqz - (local.get $11) - ) - (block - (i32.store - (i32.const 180) + (local.tee $1 (i32.and - (i32.load - (i32.const 180) - ) - (i32.xor - (i32.shl - (i32.const 1) + (local.get $18) + (i32.or + (local.tee $1 + (i32.shl + (i32.const 2) + (local.get $14) + ) + ) + (i32.sub + (i32.const 0) (local.get $1) ) - (i32.const -1) ) ) ) - (br $do-once21) ) - ) - ) - (block - (if - (i32.lt_u - (local.get $9) - (i32.load - (i32.const 192) + (then + (block + (local.set $0 + (local.get $2) + ) + (br $do-once) ) ) - (call $_abort) ) - (if - (i32.eq - (i32.load - (local.tee $0 + (local.set $9 + (i32.and + (i32.shr_u + (local.tee $1 (i32.add - (local.get $9) - (i32.const 16) + (i32.and + (local.get $1) + (i32.sub + (i32.const 0) + (local.get $1) + ) + ) + (i32.const -1) ) ) + (i32.const 12) ) - (local.get $4) - ) - (i32.store - (local.get $0) - (local.get $11) - ) - (i32.store offset=20 - (local.get $9) - (local.get $11) + (i32.const 16) ) ) - (br_if $do-once21 - (i32.eqz - (local.get $11) + (local.set $4 + (i32.load offset=480 + (i32.shl + (i32.add + (i32.or + (i32.or + (i32.or + (i32.or + (local.tee $1 + (i32.and + (i32.shr_u + (local.tee $4 + (i32.shr_u + (local.get $1) + (local.get $9) + ) + ) + (i32.const 5) + ) + (i32.const 8) + ) + ) + (local.get $9) + ) + (local.tee $1 + (i32.and + (i32.shr_u + (local.tee $4 + (i32.shr_u + (local.get $4) + (local.get $1) + ) + ) + (i32.const 2) + ) + (i32.const 4) + ) + ) + ) + (local.tee $1 + (i32.and + (i32.shr_u + (local.tee $4 + (i32.shr_u + (local.get $4) + (local.get $1) + ) + ) + (i32.const 1) + ) + (i32.const 2) + ) + ) + ) + (local.tee $1 + (i32.and + (i32.shr_u + (local.tee $4 + (i32.shr_u + (local.get $4) + (local.get $1) + ) + ) + (i32.const 1) + ) + (i32.const 1) + ) + ) + ) + (i32.shr_u + (local.get $4) + (local.get $1) + ) + ) + (i32.const 2) + ) ) ) ) ) - (if - (i32.lt_u - (local.get $11) - (local.tee $0 - (i32.load - (i32.const 192) - ) + ) + (if + (local.get $4) + (then + (block + (local.set $1 + (local.get $3) ) - ) - (call $_abort) - ) - (i32.store offset=24 - (local.get $11) - (local.get $9) - ) - (if - (local.tee $1 - (i32.load offset=16 + (local.set $3 (local.get $4) ) - ) - (if - (i32.lt_u - (local.get $1) - (local.get $0) - ) - (call $_abort) - (block - (i32.store offset=16 - (local.get $11) - (local.get $1) - ) - (i32.store offset=24 - (local.get $1) - (local.get $11) - ) - ) + (br $__rjti$3) ) ) - (if - (local.tee $0 - (i32.load offset=20 - (local.get $4) - ) - ) - (if - (i32.lt_u - (local.get $0) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (i32.store offset=20 - (local.get $11) - (local.get $0) - ) - (i32.store offset=24 - (local.get $0) - (local.get $11) - ) - ) + (else + (local.set $4 + (local.get $0) ) ) ) + (br $__rjto$3) ) - ) - (block $do-once25 - (if - (i32.lt_u - (local.get $3) - (i32.const 16) - ) - (block - (i32.store offset=4 - (local.get $4) - (i32.or - (local.tee $0 - (i32.add - (local.get $3) - (local.get $2) - ) - ) - (i32.const 3) - ) - ) - (i32.store - (local.tee $0 - (i32.add - (i32.add - (local.get $4) - (local.get $0) + (loop $while-in16 + (local.set $9 + (i32.lt_u + (local.tee $4 + (i32.sub + (i32.and + (i32.load offset=4 + (local.get $3) + ) + (i32.const -8) ) - (i32.const 4) + (local.get $2) ) ) - (i32.or - (i32.load - (local.get $0) - ) - (i32.const 1) - ) + (local.get $1) ) ) - (block - (i32.store offset=4 + (local.set $1 + (select (local.get $4) - (i32.or - (local.get $2) - (i32.const 3) - ) + (local.get $1) + (local.get $9) ) - (i32.store offset=4 - (local.get $6) - (i32.or + ) + (local.set $0 + (select + (local.get $3) + (local.get $0) + (local.get $9) + ) + ) + (if + (local.tee $4 + (i32.load offset=16 (local.get $3) - (i32.const 1) ) ) - (i32.store - (i32.add - (local.get $6) - (local.get $3) + (then + (block + (local.set $3 + (local.get $4) + ) + (br $while-in16) ) - (local.get $3) ) - (local.set $0 - (i32.shr_u + ) + (br_if $while-in16 + (local.tee $3 + (i32.load offset=20 (local.get $3) - (i32.const 3) ) ) - (if - (i32.lt_u - (local.get $3) - (i32.const 256) + ) + (local.set $3 + (local.get $1) + ) + (local.set $4 + (local.get $0) + ) + ) + ) + (if + (local.get $4) + (then + (if + (i32.lt_u + (local.get $3) + (i32.sub + (i32.load + (i32.const 184) + ) + (local.get $2) ) + ) + (then (block - (local.set $3 - (i32.add - (i32.shl - (local.get $0) - (i32.const 3) - ) - (i32.const 216) - ) - ) (if - (i32.and - (local.tee $1 + (i32.lt_u + (local.get $4) + (local.tee $12 (i32.load - (i32.const 176) + (i32.const 192) ) ) - (local.tee $0 - (i32.shl - (i32.const 1) - (local.get $0) + ) + (then + (call $_abort) + ) + ) + (if + (i32.ge_u + (local.get $4) + (local.tee $6 + (i32.add + (local.get $4) + (local.get $2) ) ) ) + (then + (call $_abort) + ) + ) + (local.set $9 + (i32.load offset=24 + (local.get $4) + ) + ) + (block $do-once17 (if - (i32.lt_u + (i32.eq (local.tee $0 - (i32.load - (local.tee $1 - (i32.add - (local.get $3) - (i32.const 8) + (i32.load offset=12 + (local.get $4) + ) + ) + (local.get $4) + ) + (then + (block + (if + (i32.eqz + (local.tee $1 + (i32.load + (local.tee $0 + (i32.add + (local.get $4) + (i32.const 20) + ) + ) + ) + ) + ) + (then + (if + (i32.eqz + (local.tee $1 + (i32.load + (local.tee $0 + (i32.add + (local.get $4) + (i32.const 16) + ) + ) + ) + ) + ) + (then + (block + (local.set $11 + (i32.const 0) + ) + (br $do-once17) + ) + ) + ) + ) + ) + (loop $while-in20 + (if + (local.tee $7 + (i32.load + (local.tee $10 + (i32.add + (local.get $1) + (i32.const 20) + ) + ) + ) + ) + (then + (block + (local.set $1 + (local.get $7) + ) + (local.set $0 + (local.get $10) + ) + (br $while-in20) + ) + ) + ) + (if + (local.tee $7 + (i32.load + (local.tee $10 + (i32.add + (local.get $1) + (i32.const 16) + ) + ) + ) + ) + (then + (block + (local.set $1 + (local.get $7) + ) + (local.set $0 + (local.get $10) + ) + (br $while-in20) + ) + ) + ) + ) + (if + (i32.lt_u + (local.get $0) + (local.get $12) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store + (local.get $0) + (i32.const 0) + ) + (local.set $11 + (local.get $1) + ) ) ) ) - ) - (i32.load - (i32.const 192) ) ) - (call $_abort) - (block - (local.set $13 - (local.get $1) - ) - (local.set $5 - (local.get $0) + (else + (block + (if + (i32.lt_u + (local.tee $10 + (i32.load offset=8 + (local.get $4) + ) + ) + (local.get $12) + ) + (then + (call $_abort) + ) + ) + (if + (i32.ne + (i32.load + (local.tee $7 + (i32.add + (local.get $10) + (i32.const 12) + ) + ) + ) + (local.get $4) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $1 + (i32.add + (local.get $0) + (i32.const 8) + ) + ) + ) + (local.get $4) + ) + (then + (block + (i32.store + (local.get $7) + (local.get $0) + ) + (i32.store + (local.get $1) + (local.get $10) + ) + (local.set $11 + (local.get $0) + ) + ) + ) + (else + (call $_abort) + ) + ) ) ) ) - (block - (i32.store - (i32.const 176) - (i32.or - (local.get $1) - (local.get $0) - ) - ) - (local.set $13 - (i32.add - (local.get $3) - (i32.const 8) + ) + (block $do-once21 + (if + (local.get $9) + (then + (block + (if + (i32.eq + (local.get $4) + (i32.load + (local.tee $0 + (i32.add + (i32.shl + (local.tee $1 + (i32.load offset=28 + (local.get $4) + ) + ) + (i32.const 2) + ) + (i32.const 480) + ) + ) + ) + ) + (then + (block + (i32.store + (local.get $0) + (local.get $11) + ) + (if + (i32.eqz + (local.get $11) + ) + (then + (block + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $1) + ) + (i32.const -1) + ) + ) + ) + (br $do-once21) + ) + ) + ) + ) + ) + (else + (block + (if + (i32.lt_u + (local.get $9) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $0 + (i32.add + (local.get $9) + (i32.const 16) + ) + ) + ) + (local.get $4) + ) + (then + (i32.store + (local.get $0) + (local.get $11) + ) + ) + (else + (i32.store offset=20 + (local.get $9) + (local.get $11) + ) + ) + ) + (br_if $do-once21 + (i32.eqz + (local.get $11) + ) + ) + ) + ) + ) + (if + (i32.lt_u + (local.get $11) + (local.tee $0 + (i32.load + (i32.const 192) + ) + ) + ) + (then + (call $_abort) + ) + ) + (i32.store offset=24 + (local.get $11) + (local.get $9) + ) + (if + (local.tee $1 + (i32.load offset=16 + (local.get $4) + ) + ) + (then + (if + (i32.lt_u + (local.get $1) + (local.get $0) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=16 + (local.get $11) + (local.get $1) + ) + (i32.store offset=24 + (local.get $1) + (local.get $11) + ) + ) + ) + ) + ) + ) + (if + (local.tee $0 + (i32.load offset=20 + (local.get $4) + ) + ) + (then + (if + (i32.lt_u + (local.get $0) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=20 + (local.get $11) + (local.get $0) + ) + (i32.store offset=24 + (local.get $0) + (local.get $11) + ) + ) + ) + ) + ) + ) ) ) - (local.set $5 - (local.get $3) - ) ) ) - (i32.store - (local.get $13) - (local.get $6) - ) - (i32.store offset=12 - (local.get $5) - (local.get $6) - ) - (i32.store offset=8 - (local.get $6) - (local.get $5) - ) - (i32.store offset=12 - (local.get $6) - (local.get $3) - ) - (br $do-once25) - ) - ) - (local.set $2 - (i32.add - (i32.shl - (local.tee $7 - (if (result i32) - (local.tee $0 - (i32.shr_u - (local.get $3) - (i32.const 8) + (block $do-once25 + (if + (i32.lt_u + (local.get $3) + (i32.const 16) + ) + (then + (block + (i32.store offset=4 + (local.get $4) + (i32.or + (local.tee $0 + (i32.add + (local.get $3) + (local.get $2) + ) + ) + (i32.const 3) + ) + ) + (i32.store + (local.tee $0 + (i32.add + (i32.add + (local.get $4) + (local.get $0) + ) + (i32.const 4) + ) + ) + (i32.or + (i32.load + (local.get $0) + ) + (i32.const 1) + ) ) ) - (if (result i32) - (i32.gt_u + ) + (else + (block + (i32.store offset=4 + (local.get $4) + (i32.or + (local.get $2) + (i32.const 3) + ) + ) + (i32.store offset=4 + (local.get $6) + (i32.or + (local.get $3) + (i32.const 1) + ) + ) + (i32.store + (i32.add + (local.get $6) + (local.get $3) + ) (local.get $3) - (i32.const 16777215) ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (local.get $3) - (i32.add - (local.tee $0 - (i32.add - (i32.sub - (i32.const 14) + (local.set $0 + (i32.shr_u + (local.get $3) + (i32.const 3) + ) + ) + (if + (i32.lt_u + (local.get $3) + (i32.const 256) + ) + (then + (block + (local.set $3 + (i32.add + (i32.shl + (local.get $0) + (i32.const 3) + ) + (i32.const 216) + ) + ) + (if + (i32.and + (local.tee $1 + (i32.load + (i32.const 176) + ) + ) + (local.tee $0 + (i32.shl + (i32.const 1) + (local.get $0) + ) + ) + ) + (then + (if + (i32.lt_u + (local.tee $0 + (i32.load + (local.tee $1 + (i32.add + (local.get $3) + (i32.const 8) + ) + ) + ) + ) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (local.set $13 + (local.get $1) + ) + (local.set $5 + (local.get $0) + ) + ) + ) + ) + ) + (else + (block + (i32.store + (i32.const 176) (i32.or + (local.get $1) + (local.get $0) + ) + ) + (local.set $13 + (i32.add + (local.get $3) + (i32.const 8) + ) + ) + (local.set $5 + (local.get $3) + ) + ) + ) + ) + (i32.store + (local.get $13) + (local.get $6) + ) + (i32.store offset=12 + (local.get $5) + (local.get $6) + ) + (i32.store offset=8 + (local.get $6) + (local.get $5) + ) + (i32.store offset=12 + (local.get $6) + (local.get $3) + ) + (br $do-once25) + ) + ) + ) + (local.set $2 + (i32.add + (i32.shl + (local.tee $7 + (if (result i32) + (local.tee $0 + (i32.shr_u + (local.get $3) + (i32.const 8) + ) + ) + (then + (if (result i32) + (i32.gt_u + (local.get $3) + (i32.const 16777215) + ) + (then + (i32.const 31) + ) + (else (i32.or - (local.tee $0 - (i32.and - (i32.shr_u - (i32.add - (local.tee $1 - (i32.shl - (local.get $0) - (local.tee $2 - (i32.and - (i32.shr_u - (i32.add - (local.get $0) - (i32.const 1048320) + (i32.and + (i32.shr_u + (local.get $3) + (i32.add + (local.tee $0 + (i32.add + (i32.sub + (i32.const 14) + (i32.or + (i32.or + (local.tee $0 + (i32.and + (i32.shr_u + (i32.add + (local.tee $1 + (i32.shl + (local.get $0) + (local.tee $2 + (i32.and + (i32.shr_u + (i32.add + (local.get $0) + (i32.const 1048320) + ) + (i32.const 16) + ) + (i32.const 8) + ) + ) + ) + ) + (i32.const 520192) + ) + (i32.const 16) + ) + (i32.const 4) ) - (i32.const 16) ) - (i32.const 8) + (local.get $2) + ) + (local.tee $0 + (i32.and + (i32.shr_u + (i32.add + (local.tee $1 + (i32.shl + (local.get $1) + (local.get $0) + ) + ) + (i32.const 245760) + ) + (i32.const 16) + ) + (i32.const 2) + ) ) ) ) + (i32.shr_u + (i32.shl + (local.get $1) + (local.get $0) + ) + (i32.const 15) + ) ) - (i32.const 520192) ) - (i32.const 16) + (i32.const 7) ) - (i32.const 4) ) + (i32.const 1) ) - (local.get $2) - ) - (local.tee $0 - (i32.and - (i32.shr_u - (i32.add - (local.tee $1 - (i32.shl - (local.get $1) - (local.get $0) - ) - ) - (i32.const 245760) - ) - (i32.const 16) - ) - (i32.const 2) + (i32.shl + (local.get $0) + (i32.const 1) ) ) ) ) - (i32.shr_u - (i32.shl - (local.get $1) - (local.get $0) - ) - (i32.const 15) - ) + ) + (else + (i32.const 0) ) ) - (i32.const 7) ) + (i32.const 2) ) - (i32.const 1) - ) - (i32.shl - (local.get $0) - (i32.const 1) + (i32.const 480) ) ) - ) - (i32.const 0) - ) - ) - (i32.const 2) - ) - (i32.const 480) - ) - ) - (i32.store offset=28 - (local.get $6) - (local.get $7) - ) - (i32.store offset=4 - (local.tee $0 - (i32.add - (local.get $6) - (i32.const 16) - ) - ) - (i32.const 0) - ) - (i32.store - (local.get $0) - (i32.const 0) - ) - (if - (i32.eqz - (i32.and - (local.tee $1 - (i32.load - (i32.const 180) - ) - ) - (local.tee $0 - (i32.shl - (i32.const 1) - (local.get $7) - ) - ) - ) - ) - (block - (i32.store - (i32.const 180) - (i32.or - (local.get $1) - (local.get $0) - ) - ) - (i32.store - (local.get $2) - (local.get $6) - ) - (i32.store offset=24 - (local.get $6) - (local.get $2) - ) - (i32.store offset=12 - (local.get $6) - (local.get $6) - ) - (i32.store offset=8 - (local.get $6) - (local.get $6) - ) - (br $do-once25) - ) - ) - (local.set $7 - (i32.shl - (local.get $3) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (local.get $7) - (i32.const 1) - ) - ) - (i32.eq - (local.get $7) - (i32.const 31) - ) - ) - ) - ) - (local.set $0 - (i32.load - (local.get $2) - ) - ) - (block $__rjto$1 - (block $__rjti$1 - (loop $while-in28 - (br_if $__rjti$1 - (i32.eq - (i32.and - (i32.load offset=4 - (local.get $0) + (i32.store offset=28 + (local.get $6) + (local.get $7) ) - (i32.const -8) - ) - (local.get $3) - ) - ) - (local.set $2 - (i32.shl - (local.get $7) - (i32.const 1) - ) - ) - (if - (local.tee $1 - (i32.load - (local.tee $7 - (i32.add + (i32.store offset=4 + (local.tee $0 (i32.add - (local.get $0) + (local.get $6) (i32.const 16) ) - (i32.shl - (i32.shr_u + ) + (i32.const 0) + ) + (i32.store + (local.get $0) + (i32.const 0) + ) + (if + (i32.eqz + (i32.and + (local.tee $1 + (i32.load + (i32.const 180) + ) + ) + (local.tee $0 + (i32.shl + (i32.const 1) + (local.get $7) + ) + ) + ) + ) + (then + (block + (i32.store + (i32.const 180) + (i32.or + (local.get $1) + (local.get $0) + ) + ) + (i32.store + (local.get $2) + (local.get $6) + ) + (i32.store offset=24 + (local.get $6) + (local.get $2) + ) + (i32.store offset=12 + (local.get $6) + (local.get $6) + ) + (i32.store offset=8 + (local.get $6) + (local.get $6) + ) + (br $do-once25) + ) + ) + ) + (local.set $7 + (i32.shl + (local.get $3) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u + (local.get $7) + (i32.const 1) + ) + ) + (i32.eq (local.get $7) (i32.const 31) ) - (i32.const 2) ) ) ) - ) - ) - (block - (local.set $7 - (local.get $2) - ) - (local.set $0 - (local.get $1) - ) - (br $while-in28) - ) - ) - ) - (if - (i32.lt_u - (local.get $7) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (i32.store - (local.get $7) - (local.get $6) - ) - (i32.store offset=24 - (local.get $6) - (local.get $0) - ) - (i32.store offset=12 - (local.get $6) - (local.get $6) - ) - (i32.store offset=8 - (local.get $6) - (local.get $6) - ) - (br $do-once25) - ) - ) - (br $__rjto$1) - ) - (if - (i32.and - (i32.ge_u - (local.tee $2 - (i32.load - (local.tee $3 - (i32.add - (local.get $0) - (i32.const 8) + (local.set $0 + (i32.load + (local.get $2) + ) + ) + (block $__rjto$1 + (block $__rjti$1 + (loop $while-in28 + (br_if $__rjti$1 + (i32.eq + (i32.and + (i32.load offset=4 + (local.get $0) + ) + (i32.const -8) + ) + (local.get $3) + ) + ) + (local.set $2 + (i32.shl + (local.get $7) + (i32.const 1) + ) + ) + (if + (local.tee $1 + (i32.load + (local.tee $7 + (i32.add + (i32.add + (local.get $0) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (local.get $7) + (i32.const 31) + ) + (i32.const 2) + ) + ) + ) + ) + ) + (then + (block + (local.set $7 + (local.get $2) + ) + (local.set $0 + (local.get $1) + ) + (br $while-in28) + ) + ) + ) + ) + (if + (i32.lt_u + (local.get $7) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store + (local.get $7) + (local.get $6) + ) + (i32.store offset=24 + (local.get $6) + (local.get $0) + ) + (i32.store offset=12 + (local.get $6) + (local.get $6) + ) + (i32.store offset=8 + (local.get $6) + (local.get $6) + ) + (br $do-once25) + ) + ) + ) + (br $__rjto$1) + ) + (if + (i32.and + (i32.ge_u + (local.tee $2 + (i32.load + (local.tee $3 + (i32.add + (local.get $0) + (i32.const 8) + ) + ) + ) + ) + (local.tee $1 + (i32.load + (i32.const 192) + ) + ) + ) + (i32.ge_u + (local.get $0) + (local.get $1) + ) + ) + (then + (block + (i32.store offset=12 + (local.get $2) + (local.get $6) + ) + (i32.store + (local.get $3) + (local.get $6) + ) + (i32.store offset=8 + (local.get $6) + (local.get $2) + ) + (i32.store offset=12 + (local.get $6) + (local.get $0) + ) + (i32.store offset=24 + (local.get $6) + (i32.const 0) + ) + ) + ) + (else + (call $_abort) + ) ) ) ) ) - (local.tee $1 - (i32.load - (i32.const 192) - ) - ) - ) - (i32.ge_u - (local.get $0) - (local.get $1) ) ) - (block - (i32.store offset=12 - (local.get $2) - (local.get $6) - ) - (i32.store - (local.get $3) - (local.get $6) - ) - (i32.store offset=8 - (local.get $6) - (local.get $2) - ) - (i32.store offset=12 - (local.get $6) - (local.get $0) - ) - (i32.store offset=24 - (local.get $6) - (i32.const 0) + (return + (i32.add + (local.get $4) + (i32.const 8) ) ) - (call $_abort) + ) + ) + (else + (local.set $0 + (local.get $2) ) ) ) ) - ) - (return - (i32.add - (local.get $4) - (i32.const 8) + (else + (local.set $0 + (local.get $2) + ) ) ) ) + ) + (else (local.set $0 (local.get $2) ) ) - (local.set $0 - (local.get $2) - ) ) ) - (local.set $0 - (local.get $2) - ) ) ) ) @@ -23425,97 +24679,103 @@ ) (local.get $0) ) - (block - (local.set $2 - (i32.load - (i32.const 196) - ) - ) - (if - (i32.gt_u - (local.tee $3 - (i32.sub - (local.get $1) - (local.get $0) - ) + (then + (block + (local.set $2 + (i32.load + (i32.const 196) ) - (i32.const 15) ) - (block - (i32.store - (i32.const 196) - (local.tee $1 - (i32.add - (local.get $2) + (if + (i32.gt_u + (local.tee $3 + (i32.sub + (local.get $1) (local.get $0) ) ) + (i32.const 15) ) - (i32.store - (i32.const 184) - (local.get $3) - ) - (i32.store offset=4 - (local.get $1) - (i32.or - (local.get $3) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (local.get $1) - (local.get $3) - ) - (local.get $3) - ) - (i32.store offset=4 - (local.get $2) - (i32.or - (local.get $0) - (i32.const 3) - ) - ) - ) - (block - (i32.store - (i32.const 184) - (i32.const 0) - ) - (i32.store - (i32.const 196) - (i32.const 0) - ) - (i32.store offset=4 - (local.get $2) - (i32.or - (local.get $1) - (i32.const 3) - ) - ) - (i32.store - (local.tee $0 - (i32.add + (then + (block + (i32.store + (i32.const 196) + (local.tee $1 + (i32.add + (local.get $2) + (local.get $0) + ) + ) + ) + (i32.store + (i32.const 184) + (local.get $3) + ) + (i32.store offset=4 + (local.get $1) + (i32.or + (local.get $3) + (i32.const 1) + ) + ) + (i32.store (i32.add - (local.get $2) (local.get $1) + (local.get $3) + ) + (local.get $3) + ) + (i32.store offset=4 + (local.get $2) + (i32.or + (local.get $0) + (i32.const 3) ) - (i32.const 4) ) ) - (i32.or - (i32.load - (local.get $0) + ) + (else + (block + (i32.store + (i32.const 184) + (i32.const 0) + ) + (i32.store + (i32.const 196) + (i32.const 0) + ) + (i32.store offset=4 + (local.get $2) + (i32.or + (local.get $1) + (i32.const 3) + ) + ) + (i32.store + (local.tee $0 + (i32.add + (i32.add + (local.get $2) + (local.get $1) + ) + (i32.const 4) + ) + ) + (i32.or + (i32.load + (local.get $0) + ) + (i32.const 1) + ) ) - (i32.const 1) ) ) ) - ) - (return - (i32.add - (local.get $2) - (i32.const 8) + (return + (i32.add + (local.get $2) + (i32.const 8) + ) ) ) ) @@ -23536,54 +24796,60 @@ (i32.const 648) ) ) - (if - (i32.and - (i32.add - (local.tee $1 - (call $_sysconf - (i32.const 30) + (then + (if + (i32.and + (i32.add + (local.tee $1 + (call $_sysconf + (i32.const 30) + ) ) + (i32.const -1) ) - (i32.const -1) - ) - (local.get $1) - ) - (call $_abort) - (block - (i32.store - (i32.const 656) - (local.get $1) - ) - (i32.store - (i32.const 652) (local.get $1) ) - (i32.store - (i32.const 660) - (i32.const -1) - ) - (i32.store - (i32.const 664) - (i32.const -1) - ) - (i32.store - (i32.const 668) - (i32.const 0) - ) - (i32.store - (i32.const 620) - (i32.const 0) + (then + (call $_abort) ) - (i32.store - (i32.const 648) - (i32.xor - (i32.and - (call $_time - (i32.const 0) + (else + (block + (i32.store + (i32.const 656) + (local.get $1) + ) + (i32.store + (i32.const 652) + (local.get $1) + ) + (i32.store + (i32.const 660) + (i32.const -1) + ) + (i32.store + (i32.const 664) + (i32.const -1) + ) + (i32.store + (i32.const 668) + (i32.const 0) + ) + (i32.store + (i32.const 620) + (i32.const 0) + ) + (i32.store + (i32.const 648) + (i32.xor + (i32.and + (call $_time + (i32.const 0) + ) + (i32.const -16) + ) + (i32.const 1431655768) ) - (i32.const -16) ) - (i32.const 1431655768) ) ) ) @@ -23618,8 +24884,10 @@ ) (local.get $0) ) - (return - (i32.const 0) + (then + (return + (i32.const 0) + ) ) ) (if @@ -23628,29 +24896,33 @@ (i32.const 616) ) ) - (if - (i32.or - (i32.le_u - (local.tee $1 - (i32.add - (local.tee $3 - (i32.load - (i32.const 608) + (then + (if + (i32.or + (i32.le_u + (local.tee $1 + (i32.add + (local.tee $3 + (i32.load + (i32.const 608) + ) ) + (local.get $5) ) - (local.get $5) ) + (local.get $3) + ) + (i32.gt_u + (local.get $1) + (local.get $2) ) - (local.get $3) ) - (i32.gt_u - (local.get $1) - (local.get $2) + (then + (return + (i32.const 0) + ) ) ) - (return - (i32.const 0) - ) ) ) (local.set $11 @@ -23670,316 +24942,352 @@ (i32.const 4) ) ) - (block - (block $label$break$L279 - (block $__rjti$5 - (block $__rjti$4 - (br_if $__rjti$4 - (i32.eqz - (local.tee $4 - (i32.load - (i32.const 200) + (then + (block + (block $label$break$L279 + (block $__rjti$5 + (block $__rjti$4 + (br_if $__rjti$4 + (i32.eqz + (local.tee $4 + (i32.load + (i32.const 200) + ) ) ) ) - ) - (local.set $1 - (i32.const 624) - ) - (loop $while-in34 - (block $while-out33 - (if - (i32.le_u - (local.tee $3 - (i32.load - (local.get $1) - ) - ) - (local.get $4) - ) + (local.set $1 + (i32.const 624) + ) + (loop $while-in34 + (block $while-out33 (if - (i32.gt_u - (i32.add - (local.get $3) + (i32.le_u + (local.tee $3 (i32.load - (local.tee $2 - (i32.add + (local.get $1) + ) + ) + (local.get $4) + ) + (then + (if + (i32.gt_u + (i32.add + (local.get $3) + (i32.load + (local.tee $2 + (i32.add + (local.get $1) + (i32.const 4) + ) + ) + ) + ) + (local.get $4) + ) + (then + (block + (local.set $4 (local.get $1) - (i32.const 4) ) + (br $while-out33) ) ) ) - (local.get $4) ) - (block - (local.set $4 + ) + (br_if $while-in34 + (local.tee $1 + (i32.load offset=8 (local.get $1) ) - (br $while-out33) ) ) + (br $__rjti$4) ) - (br_if $while-in34 - (local.tee $1 - (i32.load offset=8 - (local.get $1) + ) + (if + (i32.lt_u + (local.tee $3 + (i32.and + (i32.sub + (local.get $6) + (i32.load + (i32.const 188) + ) + ) + (local.get $9) + ) + ) + (i32.const 2147483647) + ) + (then + (if + (i32.eq + (local.tee $1 + (call $_sbrk + (local.get $3) + ) + ) + (i32.add + (i32.load + (local.get $4) + ) + (i32.load + (local.get $2) + ) + ) + ) + (then + (br_if $__rjti$13 + (i32.ne + (local.get $1) + (i32.const -1) + ) + ) + ) + (else + (block + (local.set $2 + (local.get $1) + ) + (br $__rjti$5) + ) ) ) ) - (br $__rjti$4) ) + (br $label$break$L279) ) (if - (i32.lt_u - (local.tee $3 - (i32.and - (i32.sub - (local.get $6) - (i32.load - (i32.const 188) - ) - ) - (local.get $9) + (i32.ne + (local.tee $1 + (call $_sbrk + (i32.const 0) ) ) - (i32.const 2147483647) + (i32.const -1) ) - (if - (i32.eq - (local.tee $1 - (call $_sbrk + (then + (block + (local.set $3 + (if (result i32) + (i32.and + (local.tee $2 + (i32.add + (local.tee $4 + (i32.load + (i32.const 652) + ) + ) + (i32.const -1) + ) + ) + (local.tee $3 + (local.get $1) + ) + ) + (then + (i32.add + (i32.sub + (local.get $5) + (local.get $3) + ) + (i32.and + (i32.add + (local.get $2) + (local.get $3) + ) + (i32.sub + (i32.const 0) + (local.get $4) + ) + ) + ) + ) + (else + (local.get $5) + ) + ) + ) + (local.set $9 + (i32.add + (local.tee $4 + (i32.load + (i32.const 608) + ) + ) (local.get $3) ) ) - (i32.add - (i32.load - (local.get $4) + (if + (i32.and + (i32.gt_u + (local.get $3) + (local.get $0) + ) + (i32.lt_u + (local.get $3) + (i32.const 2147483647) + ) ) - (i32.load - (local.get $2) + (then + (block + (if + (local.tee $2 + (i32.load + (i32.const 616) + ) + ) + (then + (br_if $label$break$L279 + (i32.or + (i32.le_u + (local.get $9) + (local.get $4) + ) + (i32.gt_u + (local.get $9) + (local.get $2) + ) + ) + ) + ) + ) + (br_if $__rjti$13 + (i32.eq + (local.tee $2 + (call $_sbrk + (local.get $3) + ) + ) + (local.get $1) + ) + ) + (br $__rjti$5) + ) ) ) ) - (br_if $__rjti$13 - (i32.ne - (local.get $1) - (i32.const -1) - ) - ) - (block - (local.set $2 - (local.get $1) - ) - (br $__rjti$5) - ) ) ) (br $label$break$L279) ) + (local.set $1 + (local.get $3) + ) + (local.set $4 + (i32.sub + (i32.const 0) + (local.get $1) + ) + ) (if - (i32.ne - (local.tee $1 - (call $_sbrk - (i32.const 0) + (i32.and + (i32.gt_u + (local.get $11) + (local.get $1) + ) + (i32.and + (i32.lt_u + (local.get $1) + (i32.const 2147483647) + ) + (i32.ne + (local.get $2) + (i32.const -1) ) ) - (i32.const -1) ) - (block - (local.set $3 - (if (result i32) - (i32.and - (local.tee $2 + (then + (if + (i32.lt_u + (local.tee $3 + (i32.and (i32.add - (local.tee $4 + (i32.sub + (local.get $8) + (local.get $1) + ) + (local.tee $3 (i32.load - (i32.const 652) + (i32.const 656) ) ) - (i32.const -1) - ) - ) - (local.tee $3 - (local.get $1) - ) - ) - (i32.add - (i32.sub - (local.get $5) - (local.get $3) - ) - (i32.and - (i32.add - (local.get $2) - (local.get $3) ) (i32.sub (i32.const 0) - (local.get $4) + (local.get $3) ) ) ) - (local.get $5) - ) - ) - (local.set $9 - (i32.add - (local.tee $4 - (i32.load - (i32.const 608) - ) - ) - (local.get $3) - ) - ) - (if - (i32.and - (i32.gt_u - (local.get $3) - (local.get $0) - ) - (i32.lt_u - (local.get $3) - (i32.const 2147483647) - ) + (i32.const 2147483647) ) - (block + (then (if - (local.tee $2 - (i32.load - (i32.const 616) + (i32.eq + (call $_sbrk + (local.get $3) ) + (i32.const -1) ) - (br_if $label$break$L279 - (i32.or - (i32.le_u - (local.get $9) - (local.get $4) - ) - (i32.gt_u - (local.get $9) - (local.get $2) + (then + (block + (drop + (call $_sbrk + (local.get $4) + ) ) + (br $label$break$L279) ) ) - ) - (br_if $__rjti$13 - (i32.eq - (local.tee $2 - (call $_sbrk + (else + (local.set $3 + (i32.add (local.get $3) + (local.get $1) ) ) - (local.get $1) ) ) - (br $__rjti$5) + ) + (else + (local.set $3 + (local.get $1) + ) ) ) ) - ) - (br $label$break$L279) - ) - (local.set $1 - (local.get $3) - ) - (local.set $4 - (i32.sub - (i32.const 0) - (local.get $1) - ) - ) - (if - (i32.and - (i32.gt_u - (local.get $11) - (local.get $1) - ) - (i32.and - (i32.lt_u + (else + (local.set $3 (local.get $1) - (i32.const 2147483647) - ) - (i32.ne - (local.get $2) - (i32.const -1) ) ) ) (if - (i32.lt_u - (local.tee $3 - (i32.and - (i32.add - (i32.sub - (local.get $8) - (local.get $1) - ) - (local.tee $3 - (i32.load - (i32.const 656) - ) - ) - ) - (i32.sub - (i32.const 0) - (local.get $3) - ) - ) - ) - (i32.const 2147483647) + (i32.ne + (local.get $2) + (i32.const -1) ) - (if - (i32.eq - (call $_sbrk - (local.get $3) - ) - (i32.const -1) - ) + (then (block - (drop - (call $_sbrk - (local.get $4) - ) - ) - (br $label$break$L279) - ) - (local.set $3 - (i32.add - (local.get $3) - (local.get $1) + (local.set $1 + (local.get $2) ) + (br $__rjti$13) ) ) - (local.set $3 - (local.get $1) - ) - ) - (local.set $3 - (local.get $1) ) ) - (if - (i32.ne - (local.get $2) - (i32.const -1) - ) - (block - (local.set $1 - (local.get $2) + (i32.store + (i32.const 620) + (i32.or + (i32.load + (i32.const 620) ) - (br $__rjti$13) - ) - ) - ) - (i32.store - (i32.const 620) - (i32.or - (i32.load - (i32.const 620) + (i32.const 4) ) - (i32.const 4) ) ) ) @@ -23989,42 +25297,46 @@ (local.get $5) (i32.const 2147483647) ) - (if - (i32.and - (i32.lt_u - (local.tee $1 - (call $_sbrk - (local.get $5) + (then + (if + (i32.and + (i32.lt_u + (local.tee $1 + (call $_sbrk + (local.get $5) + ) ) - ) - (local.tee $3 - (call $_sbrk - (i32.const 0) + (local.tee $3 + (call $_sbrk + (i32.const 0) + ) ) ) - ) - (i32.and - (i32.ne - (local.get $1) - (i32.const -1) - ) - (i32.ne - (local.get $3) - (i32.const -1) - ) - ) - ) - (br_if $__rjti$13 - (i32.gt_u - (local.tee $3 - (i32.sub - (local.get $3) + (i32.and + (i32.ne (local.get $1) + (i32.const -1) + ) + (i32.ne + (local.get $3) + (i32.const -1) ) ) - (i32.add - (local.get $0) - (i32.const 40) + ) + (then + (br_if $__rjti$13 + (i32.gt_u + (local.tee $3 + (i32.sub + (local.get $3) + (local.get $1) + ) + ) + (i32.add + (local.get $0) + (i32.const 40) + ) + ) ) ) ) @@ -24050,9 +25362,11 @@ (i32.const 612) ) ) - (i32.store - (i32.const 612) - (local.get $2) + (then + (i32.store + (i32.const 612) + (local.get $2) + ) ) ) (block $do-once40 @@ -24062,2134 +25376,2286 @@ (i32.const 200) ) ) - (block - (local.set $2 - (i32.const 624) - ) - (block $__rjto$10 - (block $__rjti$10 - (loop $while-in45 - (br_if $__rjti$10 - (i32.eq - (local.get $1) - (i32.add - (local.tee $11 - (i32.load - (local.get $2) + (then + (block + (local.set $2 + (i32.const 624) + ) + (block $__rjto$10 + (block $__rjti$10 + (loop $while-in45 + (br_if $__rjti$10 + (i32.eq + (local.get $1) + (i32.add + (local.tee $11 + (i32.load + (local.get $2) + ) ) - ) - (local.tee $5 - (i32.load - (local.tee $4 - (i32.add - (local.get $2) - (i32.const 4) + (local.tee $5 + (i32.load + (local.tee $4 + (i32.add + (local.get $2) + (i32.const 4) + ) ) ) ) ) ) ) - ) - (br_if $while-in45 - (local.tee $2 - (i32.load offset=8 - (local.get $2) + (br_if $while-in45 + (local.tee $2 + (i32.load offset=8 + (local.get $2) + ) ) ) ) - ) - (br $__rjto$10) - ) - (if - (i32.eqz - (i32.and - (i32.load offset=12 - (local.get $2) - ) - (i32.const 8) - ) + (br $__rjto$10) ) (if - (i32.and - (i32.lt_u - (local.get $6) - (local.get $1) - ) - (i32.ge_u - (local.get $6) - (local.get $11) + (i32.eqz + (i32.and + (i32.load offset=12 + (local.get $2) + ) + (i32.const 8) ) ) - (block - (i32.store - (local.get $4) - (i32.add - (local.get $5) - (local.get $3) + (then + (if + (i32.and + (i32.lt_u + (local.get $6) + (local.get $1) + ) + (i32.ge_u + (local.get $6) + (local.get $11) + ) ) - ) - (local.set $2 - (i32.add - (local.get $6) - (local.tee $1 - (select - (i32.and - (i32.sub - (i32.const 0) - (local.tee $1 - (i32.add - (local.get $6) - (i32.const 8) + (then + (block + (i32.store + (local.get $4) + (i32.add + (local.get $5) + (local.get $3) + ) + ) + (local.set $2 + (i32.add + (local.get $6) + (local.tee $1 + (select + (i32.and + (i32.sub + (i32.const 0) + (local.tee $1 + (i32.add + (local.get $6) + (i32.const 8) + ) + ) + ) + (i32.const 7) + ) + (i32.const 0) + (i32.and + (local.get $1) + (i32.const 7) ) ) ) - (i32.const 7) ) - (i32.const 0) - (i32.and + ) + (local.set $1 + (i32.add + (i32.sub + (local.get $3) + (local.get $1) + ) + (i32.load + (i32.const 188) + ) + ) + ) + (i32.store + (i32.const 200) + (local.get $2) + ) + (i32.store + (i32.const 188) + (local.get $1) + ) + (i32.store offset=4 + (local.get $2) + (i32.or (local.get $1) - (i32.const 7) + (i32.const 1) ) ) + (i32.store offset=4 + (i32.add + (local.get $2) + (local.get $1) + ) + (i32.const 40) + ) + (i32.store + (i32.const 204) + (i32.load + (i32.const 664) + ) + ) + (br $do-once40) ) ) ) - (local.set $1 - (i32.add - (i32.sub - (local.get $3) - (local.get $1) - ) - (i32.load - (i32.const 188) - ) - ) - ) - (i32.store - (i32.const 200) - (local.get $2) + ) + ) + ) + (if + (i32.lt_u + (local.get $1) + (local.tee $4 + (i32.load + (i32.const 192) ) + ) + ) + (then + (block (i32.store - (i32.const 188) + (i32.const 192) (local.get $1) ) - (i32.store offset=4 - (local.get $2) - (i32.or - (local.get $1) - (i32.const 1) - ) - ) - (i32.store offset=4 - (i32.add - (local.get $2) - (local.get $1) - ) - (i32.const 40) - ) - (i32.store - (i32.const 204) - (i32.load - (i32.const 664) - ) + (local.set $4 + (local.get $1) ) - (br $do-once40) ) ) ) - ) - (if - (i32.lt_u - (local.get $1) - (local.tee $4 - (i32.load - (i32.const 192) - ) - ) - ) - (block - (i32.store - (i32.const 192) - (local.get $1) - ) - (local.set $4 + (local.set $11 + (i32.add (local.get $1) + (local.get $3) ) ) - ) - (local.set $11 - (i32.add - (local.get $1) - (local.get $3) + (local.set $2 + (i32.const 624) ) - ) - (local.set $2 - (i32.const 624) - ) - (block $__rjto$11 - (block $__rjti$11 - (loop $while-in47 - (if - (i32.eq - (i32.load - (local.get $2) + (block $__rjto$11 + (block $__rjti$11 + (loop $while-in47 + (if + (i32.eq + (i32.load + (local.get $2) + ) + (local.get $11) ) - (local.get $11) - ) - (block - (local.set $5 - (local.get $2) + (then + (block + (local.set $5 + (local.get $2) + ) + (br $__rjti$11) + ) ) - (br $__rjti$11) ) - ) - (br_if $while-in47 - (local.tee $2 - (i32.load offset=8 - (local.get $2) + (br_if $while-in47 + (local.tee $2 + (i32.load offset=8 + (local.get $2) + ) ) ) + (local.set $4 + (i32.const 624) + ) ) - (local.set $4 - (i32.const 624) - ) + (br $__rjto$11) ) - (br $__rjto$11) - ) - (if - (i32.and - (i32.load offset=12 - (local.get $2) + (if + (i32.and + (i32.load offset=12 + (local.get $2) + ) + (i32.const 8) ) - (i32.const 8) - ) - (local.set $4 - (i32.const 624) - ) - (block - (i32.store - (local.get $5) - (local.get $1) + (then + (local.set $4 + (i32.const 624) + ) ) - (i32.store - (local.tee $2 - (i32.add - (local.get $2) - (i32.const 4) + (else + (block + (i32.store + (local.get $5) + (local.get $1) ) - ) - (i32.add - (i32.load - (local.get $2) + (i32.store + (local.tee $2 + (i32.add + (local.get $2) + (i32.const 4) + ) + ) + (i32.add + (i32.load + (local.get $2) + ) + (local.get $3) + ) ) - (local.get $3) - ) - ) - (local.set $8 - (i32.add - (local.tee $9 + (local.set $8 (i32.add - (local.get $1) - (select - (i32.and - (i32.sub - (i32.const 0) - (local.tee $1 - (i32.add - (local.get $1) - (i32.const 8) + (local.tee $9 + (i32.add + (local.get $1) + (select + (i32.and + (i32.sub + (i32.const 0) + (local.tee $1 + (i32.add + (local.get $1) + (i32.const 8) + ) + ) ) + (i32.const 7) + ) + (i32.const 0) + (i32.and + (local.get $1) + (i32.const 7) ) ) - (i32.const 7) - ) - (i32.const 0) - (i32.and - (local.get $1) - (i32.const 7) ) ) + (local.get $0) ) ) - (local.get $0) - ) - ) - (local.set $7 - (i32.sub - (i32.sub - (local.tee $5 - (i32.add - (local.get $11) - (select - (i32.and - (i32.sub - (i32.const 0) - (local.tee $1 - (i32.add - (local.get $11) - (i32.const 8) + (local.set $7 + (i32.sub + (i32.sub + (local.tee $5 + (i32.add + (local.get $11) + (select + (i32.and + (i32.sub + (i32.const 0) + (local.tee $1 + (i32.add + (local.get $11) + (i32.const 8) + ) + ) ) + (i32.const 7) + ) + (i32.const 0) + (i32.and + (local.get $1) + (i32.const 7) ) ) - (i32.const 7) - ) - (i32.const 0) - (i32.and - (local.get $1) - (i32.const 7) ) ) + (local.get $9) ) + (local.get $0) ) - (local.get $9) ) - (local.get $0) - ) - ) - (i32.store offset=4 - (local.get $9) - (i32.or - (local.get $0) - (i32.const 3) - ) - ) - (block $do-once48 - (if - (i32.eq - (local.get $5) - (local.get $6) - ) - (block - (i32.store - (i32.const 188) - (local.tee $0 - (i32.add - (i32.load - (i32.const 188) - ) - (local.get $7) - ) - ) - ) - (i32.store - (i32.const 200) - (local.get $8) - ) - (i32.store offset=4 - (local.get $8) - (i32.or - (local.get $0) - (i32.const 1) - ) + (i32.store offset=4 + (local.get $9) + (i32.or + (local.get $0) + (i32.const 3) ) ) - (block + (block $do-once48 (if (i32.eq (local.get $5) - (i32.load - (i32.const 196) - ) + (local.get $6) ) - (block - (i32.store - (i32.const 184) - (local.tee $0 - (i32.add - (i32.load - (i32.const 184) + (then + (block + (i32.store + (i32.const 188) + (local.tee $0 + (i32.add + (i32.load + (i32.const 188) + ) + (local.get $7) ) - (local.get $7) ) ) - ) - (i32.store - (i32.const 196) - (local.get $8) - ) - (i32.store offset=4 - (local.get $8) - (i32.or - (local.get $0) - (i32.const 1) + (i32.store + (i32.const 200) + (local.get $8) ) - ) - (i32.store - (i32.add + (i32.store offset=4 (local.get $8) - (local.get $0) + (i32.or + (local.get $0) + (i32.const 1) + ) ) - (local.get $0) ) - (br $do-once48) ) - ) - (i32.store - (local.tee $0 - (i32.add - (local.tee $0 - (if (result i32) - (i32.eq - (i32.and + (else + (block + (if + (i32.eq + (local.get $5) + (i32.load + (i32.const 196) + ) + ) + (then + (block + (i32.store + (i32.const 184) (local.tee $0 - (i32.load offset=4 - (local.get $5) + (i32.add + (i32.load + (i32.const 184) + ) + (local.get $7) ) ) - (i32.const 3) ) - (i32.const 1) - ) - (block (result i32) - (local.set $11 - (i32.and + (i32.store + (i32.const 196) + (local.get $8) + ) + (i32.store offset=4 + (local.get $8) + (i32.or (local.get $0) - (i32.const -8) + (i32.const 1) ) ) - (local.set $1 - (i32.shr_u + (i32.store + (i32.add + (local.get $8) (local.get $0) - (i32.const 3) ) + (local.get $0) ) - (block $label$break$L331 - (if - (i32.lt_u - (local.get $0) - (i32.const 256) - ) - (block - (local.set $2 - (i32.load offset=12 - (local.get $5) - ) - ) - (block $do-once51 - (if - (i32.ne - (local.tee $3 - (i32.load offset=8 - (local.get $5) - ) - ) - (local.tee $0 - (i32.add - (i32.shl - (local.get $1) - (i32.const 3) - ) - (i32.const 216) - ) - ) - ) - (block - (if - (i32.lt_u - (local.get $3) - (local.get $4) - ) - (call $_abort) - ) - (br_if $do-once51 - (i32.eq - (i32.load offset=12 - (local.get $3) - ) - (local.get $5) - ) - ) - (call $_abort) + (br $do-once48) + ) + ) + ) + (i32.store + (local.tee $0 + (i32.add + (local.tee $0 + (if (result i32) + (i32.eq + (i32.and + (local.tee $0 + (i32.load offset=4 + (local.get $5) ) ) + (i32.const 3) ) - (if - (i32.eq - (local.get $2) - (local.get $3) - ) - (block - (i32.store - (i32.const 176) - (i32.and - (i32.load - (i32.const 176) - ) - (i32.xor - (i32.shl - (i32.const 1) - (local.get $1) - ) - (i32.const -1) - ) - ) + (i32.const 1) + ) + (then + (block (result i32) + (local.set $11 + (i32.and + (local.get $0) + (i32.const -8) ) - (br $label$break$L331) ) - ) - (block $do-once53 - (if - (i32.eq - (local.get $2) + (local.set $1 + (i32.shr_u (local.get $0) + (i32.const 3) ) - (local.set $15 - (i32.add - (local.get $2) - (i32.const 8) - ) - ) - (block - (if - (i32.lt_u - (local.get $2) - (local.get $4) - ) - (call $_abort) + ) + (block $label$break$L331 + (if + (i32.lt_u + (local.get $0) + (i32.const 256) ) - (if - (i32.eq - (i32.load - (local.tee $0 - (i32.add - (local.get $2) - (i32.const 8) - ) - ) - ) - (local.get $5) - ) + (then (block - (local.set $15 - (local.get $0) + (local.set $2 + (i32.load offset=12 + (local.get $5) + ) ) - (br $do-once53) - ) - ) - (call $_abort) - ) - ) - ) - (i32.store offset=12 - (local.get $3) - (local.get $2) - ) - (i32.store - (local.get $15) - (local.get $3) - ) - ) - (block - (local.set $6 - (i32.load offset=24 - (local.get $5) - ) - ) - (block $do-once55 - (if - (i32.eq - (local.tee $0 - (i32.load offset=12 - (local.get $5) - ) - ) - (local.get $5) - ) - (block - (if - (i32.eqz - (local.tee $1 - (i32.load - (local.tee $0 - (i32.add - (local.tee $3 - (i32.add + (block $do-once51 + (if + (i32.ne + (local.tee $3 + (i32.load offset=8 + (local.get $5) + ) + ) + (local.tee $0 + (i32.add + (i32.shl + (local.get $1) + (i32.const 3) + ) + (i32.const 216) + ) + ) + ) + (then + (block + (if + (i32.lt_u + (local.get $3) + (local.get $4) + ) + (then + (call $_abort) + ) + ) + (br_if $do-once51 + (i32.eq + (i32.load offset=12 + (local.get $3) + ) (local.get $5) - (i32.const 16) ) ) - (i32.const 4) + (call $_abort) ) ) ) ) - ) - (if - (local.tee $1 - (i32.load + (if + (i32.eq + (local.get $2) (local.get $3) ) - ) - (local.set $0 - (local.get $3) - ) - (block - (local.set $12 - (i32.const 0) - ) - (br $do-once55) - ) - ) - ) - (loop $while-in58 - (if - (local.tee $3 - (i32.load - (local.tee $2 - (i32.add - (local.get $1) - (i32.const 20) + (then + (block + (i32.store + (i32.const 176) + (i32.and + (i32.load + (i32.const 176) + ) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $1) + ) + (i32.const -1) + ) + ) ) + (br $label$break$L331) ) ) ) - (block - (local.set $1 - (local.get $3) - ) - (local.set $0 - (local.get $2) - ) - (br $while-in58) - ) - ) - (if - (local.tee $3 - (i32.load - (local.tee $2 - (i32.add - (local.get $1) - (i32.const 16) + (block $do-once53 + (if + (i32.eq + (local.get $2) + (local.get $0) + ) + (then + (local.set $15 + (i32.add + (local.get $2) + (i32.const 8) + ) + ) + ) + (else + (block + (if + (i32.lt_u + (local.get $2) + (local.get $4) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $0 + (i32.add + (local.get $2) + (i32.const 8) + ) + ) + ) + (local.get $5) + ) + (then + (block + (local.set $15 + (local.get $0) + ) + (br $do-once53) + ) + ) + ) + (call $_abort) ) ) ) ) - (block - (local.set $1 - (local.get $3) - ) - (local.set $0 - (local.get $2) - ) - (br $while-in58) + (i32.store offset=12 + (local.get $3) + (local.get $2) ) - ) - ) - (if - (i32.lt_u - (local.get $0) - (local.get $4) - ) - (call $_abort) - (block (i32.store - (local.get $0) - (i32.const 0) - ) - (local.set $12 - (local.get $1) + (local.get $15) + (local.get $3) ) ) ) - ) - (block - (if - (i32.lt_u - (local.tee $2 - (i32.load offset=8 + (else + (block + (local.set $6 + (i32.load offset=24 (local.get $5) ) ) - (local.get $4) - ) - (call $_abort) - ) - (if - (i32.ne - (i32.load - (local.tee $3 - (i32.add - (local.get $2) - (i32.const 12) + (block $do-once55 + (if + (i32.eq + (local.tee $0 + (i32.load offset=12 + (local.get $5) + ) + ) + (local.get $5) ) - ) - ) - (local.get $5) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $1 - (i32.add - (local.get $0) - (i32.const 8) + (then + (block + (if + (i32.eqz + (local.tee $1 + (i32.load + (local.tee $0 + (i32.add + (local.tee $3 + (i32.add + (local.get $5) + (i32.const 16) + ) + ) + (i32.const 4) + ) + ) + ) + ) + ) + (then + (if + (local.tee $1 + (i32.load + (local.get $3) + ) + ) + (then + (local.set $0 + (local.get $3) + ) + ) + (else + (block + (local.set $12 + (i32.const 0) + ) + (br $do-once55) + ) + ) + ) + ) + ) + (loop $while-in58 + (if + (local.tee $3 + (i32.load + (local.tee $2 + (i32.add + (local.get $1) + (i32.const 20) + ) + ) + ) + ) + (then + (block + (local.set $1 + (local.get $3) + ) + (local.set $0 + (local.get $2) + ) + (br $while-in58) + ) + ) + ) + (if + (local.tee $3 + (i32.load + (local.tee $2 + (i32.add + (local.get $1) + (i32.const 16) + ) + ) + ) + ) + (then + (block + (local.set $1 + (local.get $3) + ) + (local.set $0 + (local.get $2) + ) + (br $while-in58) + ) + ) + ) + ) + (if + (i32.lt_u + (local.get $0) + (local.get $4) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store + (local.get $0) + (i32.const 0) + ) + (local.set $12 + (local.get $1) + ) + ) + ) + ) + ) + ) + (else + (block + (if + (i32.lt_u + (local.tee $2 + (i32.load offset=8 + (local.get $5) + ) + ) + (local.get $4) + ) + (then + (call $_abort) + ) + ) + (if + (i32.ne + (i32.load + (local.tee $3 + (i32.add + (local.get $2) + (i32.const 12) + ) + ) + ) + (local.get $5) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $1 + (i32.add + (local.get $0) + (i32.const 8) + ) + ) + ) + (local.get $5) + ) + (then + (block + (i32.store + (local.get $3) + (local.get $0) + ) + (i32.store + (local.get $1) + (local.get $2) + ) + (local.set $12 + (local.get $0) + ) + ) + ) + (else + (call $_abort) + ) + ) + ) ) ) ) - (local.get $5) - ) - (block - (i32.store - (local.get $3) - (local.get $0) - ) - (i32.store - (local.get $1) - (local.get $2) + (br_if $label$break$L331 + (i32.eqz + (local.get $6) + ) ) - (local.set $12 - (local.get $0) + (block $do-once59 + (if + (i32.eq + (local.get $5) + (i32.load + (local.tee $0 + (i32.add + (i32.shl + (local.tee $1 + (i32.load offset=28 + (local.get $5) + ) + ) + (i32.const 2) + ) + (i32.const 480) + ) + ) + ) + ) + (then + (block + (i32.store + (local.get $0) + (local.get $12) + ) + (br_if $do-once59 + (local.get $12) + ) + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $1) + ) + (i32.const -1) + ) + ) + ) + (br $label$break$L331) + ) + ) + (else + (block + (if + (i32.lt_u + (local.get $6) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $0 + (i32.add + (local.get $6) + (i32.const 16) + ) + ) + ) + (local.get $5) + ) + (then + (i32.store + (local.get $0) + (local.get $12) + ) + ) + (else + (i32.store offset=20 + (local.get $6) + (local.get $12) + ) + ) + ) + (br_if $label$break$L331 + (i32.eqz + (local.get $12) + ) + ) + ) + ) + ) ) - ) - (call $_abort) - ) - ) - ) - ) - (br_if $label$break$L331 - (i32.eqz - (local.get $6) - ) - ) - (block $do-once59 - (if - (i32.eq - (local.get $5) - (i32.load - (local.tee $0 - (i32.add - (i32.shl + (if + (i32.lt_u + (local.get $12) (local.tee $1 - (i32.load offset=28 - (local.get $5) + (i32.load + (i32.const 192) ) ) - (i32.const 2) ) - (i32.const 480) + (then + (call $_abort) + ) ) - ) - ) - ) - (block - (i32.store - (local.get $0) - (local.get $12) - ) - (br_if $do-once59 - (local.get $12) - ) - (i32.store - (i32.const 180) - (i32.and - (i32.load - (i32.const 180) + (i32.store offset=24 + (local.get $12) + (local.get $6) ) - (i32.xor - (i32.shl - (i32.const 1) - (local.get $1) + (if + (local.tee $3 + (i32.load + (local.tee $0 + (i32.add + (local.get $5) + (i32.const 16) + ) + ) + ) + ) + (then + (if + (i32.lt_u + (local.get $3) + (local.get $1) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=16 + (local.get $12) + (local.get $3) + ) + (i32.store offset=24 + (local.get $3) + (local.get $12) + ) + ) + ) + ) ) - (i32.const -1) ) - ) - ) - (br $label$break$L331) - ) - (block - (if - (i32.lt_u - (local.get $6) - (i32.load - (i32.const 192) + (br_if $label$break$L331 + (i32.eqz + (local.tee $0 + (i32.load offset=4 + (local.get $0) + ) + ) + ) ) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $0 - (i32.add - (local.get $6) - (i32.const 16) + (if + (i32.lt_u + (local.get $0) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=20 + (local.get $12) + (local.get $0) + ) + (i32.store offset=24 + (local.get $0) + (local.get $12) + ) ) ) ) - (local.get $5) - ) - (i32.store - (local.get $0) - (local.get $12) - ) - (i32.store offset=20 - (local.get $6) - (local.get $12) - ) - ) - (br_if $label$break$L331 - (i32.eqz - (local.get $12) ) ) ) ) - ) - (if - (i32.lt_u - (local.get $12) - (local.tee $1 - (i32.load - (i32.const 192) - ) + (local.set $7 + (i32.add + (local.get $11) + (local.get $7) ) ) - (call $_abort) + (i32.add + (local.get $5) + (local.get $11) + ) ) - (i32.store offset=24 - (local.get $12) - (local.get $6) + ) + (else + (local.get $5) + ) + ) + ) + (i32.const 4) + ) + ) + (i32.and + (i32.load + (local.get $0) + ) + (i32.const -2) + ) + ) + (i32.store offset=4 + (local.get $8) + (i32.or + (local.get $7) + (i32.const 1) + ) + ) + (i32.store + (i32.add + (local.get $8) + (local.get $7) + ) + (local.get $7) + ) + (local.set $0 + (i32.shr_u + (local.get $7) + (i32.const 3) + ) + ) + (if + (i32.lt_u + (local.get $7) + (i32.const 256) + ) + (then + (block + (local.set $3 + (i32.add + (i32.shl + (local.get $0) + (i32.const 3) + ) + (i32.const 216) + ) + ) + (block $do-once63 + (if + (i32.and + (local.tee $1 + (i32.load + (i32.const 176) + ) ) - (if - (local.tee $3 - (i32.load - (local.tee $0 - (i32.add - (local.get $5) - (i32.const 16) - ) - ) - ) + (local.tee $0 + (i32.shl + (i32.const 1) + (local.get $0) ) + ) + ) + (then + (block (if - (i32.lt_u - (local.get $3) - (local.get $1) - ) - (call $_abort) - (block - (i32.store offset=16 - (local.get $12) - (local.get $3) + (i32.ge_u + (local.tee $0 + (i32.load + (local.tee $1 + (i32.add + (local.get $3) + (i32.const 8) + ) + ) + ) ) - (i32.store offset=24 - (local.get $3) - (local.get $12) + (i32.load + (i32.const 192) ) ) - ) - ) - (br_if $label$break$L331 - (i32.eqz - (local.tee $0 - (i32.load offset=4 - (local.get $0) + (then + (block + (local.set $16 + (local.get $1) + ) + (local.set $10 + (local.get $0) + ) + (br $do-once63) ) ) ) - ) - (if - (i32.lt_u - (local.get $0) - (i32.load - (i32.const 192) - ) - ) (call $_abort) - (block - (i32.store offset=20 - (local.get $12) + ) + ) + (else + (block + (i32.store + (i32.const 176) + (i32.or + (local.get $1) (local.get $0) ) - (i32.store offset=24 - (local.get $0) - (local.get $12) + ) + (local.set $16 + (i32.add + (local.get $3) + (i32.const 8) ) ) - ) - ) - ) - ) - (local.set $7 - (i32.add - (local.get $11) - (local.get $7) - ) - ) - (i32.add - (local.get $5) - (local.get $11) - ) - ) - (local.get $5) - ) - ) - (i32.const 4) - ) - ) - (i32.and - (i32.load - (local.get $0) - ) - (i32.const -2) - ) - ) - (i32.store offset=4 - (local.get $8) - (i32.or - (local.get $7) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (local.get $8) - (local.get $7) - ) - (local.get $7) - ) - (local.set $0 - (i32.shr_u - (local.get $7) - (i32.const 3) - ) - ) - (if - (i32.lt_u - (local.get $7) - (i32.const 256) - ) - (block - (local.set $3 - (i32.add - (i32.shl - (local.get $0) - (i32.const 3) - ) - (i32.const 216) - ) - ) - (block $do-once63 - (if - (i32.and - (local.tee $1 - (i32.load - (i32.const 176) - ) - ) - (local.tee $0 - (i32.shl - (i32.const 1) - (local.get $0) - ) - ) - ) - (block - (if - (i32.ge_u - (local.tee $0 - (i32.load - (local.tee $1 - (i32.add + (local.set $10 (local.get $3) - (i32.const 8) ) ) ) ) - (i32.load - (i32.const 192) - ) ) - (block - (local.set $16 - (local.get $1) - ) - (local.set $10 - (local.get $0) - ) - (br $do-once63) + (i32.store + (local.get $16) + (local.get $8) ) - ) - (call $_abort) - ) - (block - (i32.store - (i32.const 176) - (i32.or - (local.get $1) - (local.get $0) + (i32.store offset=12 + (local.get $10) + (local.get $8) ) - ) - (local.set $16 - (i32.add + (i32.store offset=8 + (local.get $8) + (local.get $10) + ) + (i32.store offset=12 + (local.get $8) (local.get $3) - (i32.const 8) ) - ) - (local.set $10 - (local.get $3) + (br $do-once48) ) ) ) - ) - (i32.store - (local.get $16) - (local.get $8) - ) - (i32.store offset=12 - (local.get $10) - (local.get $8) - ) - (i32.store offset=8 - (local.get $8) - (local.get $10) - ) - (i32.store offset=12 - (local.get $8) - (local.get $3) - ) - (br $do-once48) - ) - ) - (local.set $3 - (i32.add - (i32.shl - (local.tee $2 - (block $do-once65 (result i32) - (if (result i32) - (local.tee $0 - (i32.shr_u - (local.get $7) - (i32.const 8) - ) - ) - (block (result i32) - (drop - (br_if $do-once65 - (i32.const 31) - (i32.gt_u - (local.get $7) - (i32.const 16777215) + (local.set $3 + (i32.add + (i32.shl + (local.tee $2 + (block $do-once65 (result i32) + (if (result i32) + (local.tee $0 + (i32.shr_u + (local.get $7) + (i32.const 8) + ) ) - ) - ) - (i32.or - (i32.and - (i32.shr_u - (local.get $7) - (i32.add - (local.tee $0 - (i32.add - (i32.sub - (i32.const 14) - (i32.or - (i32.or - (local.tee $0 - (i32.and - (i32.shr_u - (i32.add - (local.tee $1 - (i32.shl - (local.get $0) - (local.tee $3 - (i32.and - (i32.shr_u - (i32.add + (then + (block (result i32) + (drop + (br_if $do-once65 + (i32.const 31) + (i32.gt_u + (local.get $7) + (i32.const 16777215) + ) + ) + ) + (i32.or + (i32.and + (i32.shr_u + (local.get $7) + (i32.add + (local.tee $0 + (i32.add + (i32.sub + (i32.const 14) + (i32.or + (i32.or + (local.tee $0 + (i32.and + (i32.shr_u + (i32.add + (local.tee $1 + (i32.shl (local.get $0) - (i32.const 1048320) + (local.tee $3 + (i32.and + (i32.shr_u + (i32.add + (local.get $0) + (i32.const 1048320) + ) + (i32.const 16) + ) + (i32.const 8) + ) + ) ) - (i32.const 16) ) - (i32.const 8) + (i32.const 520192) ) + (i32.const 16) ) + (i32.const 4) ) ) - (i32.const 520192) + (local.get $3) + ) + (local.tee $0 + (i32.and + (i32.shr_u + (i32.add + (local.tee $1 + (i32.shl + (local.get $1) + (local.get $0) + ) + ) + (i32.const 245760) + ) + (i32.const 16) + ) + (i32.const 2) + ) ) - (i32.const 16) ) - (i32.const 4) ) - ) - (local.get $3) - ) - (local.tee $0 - (i32.and (i32.shr_u - (i32.add - (local.tee $1 - (i32.shl - (local.get $1) - (local.get $0) - ) - ) - (i32.const 245760) + (i32.shl + (local.get $1) + (local.get $0) ) - (i32.const 16) + (i32.const 15) ) - (i32.const 2) ) ) + (i32.const 7) ) ) - (i32.shr_u - (i32.shl - (local.get $1) - (local.get $0) - ) - (i32.const 15) - ) + (i32.const 1) + ) + (i32.shl + (local.get $0) + (i32.const 1) ) ) - (i32.const 7) ) ) - (i32.const 1) - ) - (i32.shl - (local.get $0) - (i32.const 1) + (else + (i32.const 0) + ) ) ) ) - (i32.const 0) + (i32.const 2) ) + (i32.const 480) ) ) - (i32.const 2) - ) - (i32.const 480) - ) - ) - (i32.store offset=28 - (local.get $8) - (local.get $2) - ) - (i32.store offset=4 - (local.tee $0 - (i32.add - (local.get $8) - (i32.const 16) - ) - ) - (i32.const 0) - ) - (i32.store - (local.get $0) - (i32.const 0) - ) - (if - (i32.eqz - (i32.and - (local.tee $1 - (i32.load - (i32.const 180) - ) + (i32.store offset=28 + (local.get $8) + (local.get $2) ) - (local.tee $0 - (i32.shl - (i32.const 1) - (local.get $2) + (i32.store offset=4 + (local.tee $0 + (i32.add + (local.get $8) + (i32.const 16) + ) ) + (i32.const 0) ) - ) - ) - (block - (i32.store - (i32.const 180) - (i32.or - (local.get $1) + (i32.store (local.get $0) + (i32.const 0) ) - ) - (i32.store - (local.get $3) - (local.get $8) - ) - (i32.store offset=24 - (local.get $8) - (local.get $3) - ) - (i32.store offset=12 - (local.get $8) - (local.get $8) - ) - (i32.store offset=8 - (local.get $8) - (local.get $8) - ) - (br $do-once48) - ) - ) - (local.set $2 - (i32.shl - (local.get $7) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (local.get $2) - (i32.const 1) - ) - ) - (i32.eq - (local.get $2) - (i32.const 31) - ) - ) - ) - ) - (local.set $0 - (i32.load - (local.get $3) - ) - ) - (block $__rjto$7 - (block $__rjti$7 - (loop $while-in68 - (br_if $__rjti$7 - (i32.eq + (if + (i32.eqz (i32.and - (i32.load offset=4 - (local.get $0) + (local.tee $1 + (i32.load + (i32.const 180) + ) + ) + (local.tee $0 + (i32.shl + (i32.const 1) + (local.get $2) + ) ) - (i32.const -8) ) - (local.get $7) + ) + (then + (block + (i32.store + (i32.const 180) + (i32.or + (local.get $1) + (local.get $0) + ) + ) + (i32.store + (local.get $3) + (local.get $8) + ) + (i32.store offset=24 + (local.get $8) + (local.get $3) + ) + (i32.store offset=12 + (local.get $8) + (local.get $8) + ) + (i32.store offset=8 + (local.get $8) + (local.get $8) + ) + (br $do-once48) + ) ) ) - (local.set $3 + (local.set $2 (i32.shl - (local.get $2) - (i32.const 1) + (local.get $7) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u + (local.get $2) + (i32.const 1) + ) + ) + (i32.eq + (local.get $2) + (i32.const 31) + ) + ) ) ) - (if - (local.tee $1 - (i32.load - (local.tee $2 - (i32.add - (i32.add - (local.get $0) - (i32.const 16) + (local.set $0 + (i32.load + (local.get $3) + ) + ) + (block $__rjto$7 + (block $__rjti$7 + (loop $while-in68 + (br_if $__rjti$7 + (i32.eq + (i32.and + (i32.load offset=4 + (local.get $0) + ) + (i32.const -8) ) - (i32.shl - (i32.shr_u - (local.get $2) - (i32.const 31) + (local.get $7) + ) + ) + (local.set $3 + (i32.shl + (local.get $2) + (i32.const 1) + ) + ) + (if + (local.tee $1 + (i32.load + (local.tee $2 + (i32.add + (i32.add + (local.get $0) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (local.get $2) + (i32.const 31) + ) + (i32.const 2) + ) + ) ) - (i32.const 2) + ) + ) + (then + (block + (local.set $2 + (local.get $3) + ) + (local.set $0 + (local.get $1) + ) + (br $while-in68) ) ) ) ) - ) - (block - (local.set $2 - (local.get $3) - ) - (local.set $0 - (local.get $1) + (if + (i32.lt_u + (local.get $2) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store + (local.get $2) + (local.get $8) + ) + (i32.store offset=24 + (local.get $8) + (local.get $0) + ) + (i32.store offset=12 + (local.get $8) + (local.get $8) + ) + (i32.store offset=8 + (local.get $8) + (local.get $8) + ) + (br $do-once48) + ) + ) ) - (br $while-in68) - ) - ) - ) - (if - (i32.lt_u - (local.get $2) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (i32.store - (local.get $2) - (local.get $8) - ) - (i32.store offset=24 - (local.get $8) - (local.get $0) - ) - (i32.store offset=12 - (local.get $8) - (local.get $8) - ) - (i32.store offset=8 - (local.get $8) - (local.get $8) + (br $__rjto$7) ) - (br $do-once48) - ) - ) - (br $__rjto$7) - ) - (if - (i32.and - (i32.ge_u - (local.tee $2 - (i32.load - (local.tee $3 - (i32.add + (if + (i32.and + (i32.ge_u + (local.tee $2 + (i32.load + (local.tee $3 + (i32.add + (local.get $0) + (i32.const 8) + ) + ) + ) + ) + (local.tee $1 + (i32.load + (i32.const 192) + ) + ) + ) + (i32.ge_u + (local.get $0) + (local.get $1) + ) + ) + (then + (block + (i32.store offset=12 + (local.get $2) + (local.get $8) + ) + (i32.store + (local.get $3) + (local.get $8) + ) + (i32.store offset=8 + (local.get $8) + (local.get $2) + ) + (i32.store offset=12 + (local.get $8) (local.get $0) - (i32.const 8) + ) + (i32.store offset=24 + (local.get $8) + (i32.const 0) ) ) ) - ) - (local.tee $1 - (i32.load - (i32.const 192) + (else + (call $_abort) ) ) ) - (i32.ge_u - (local.get $0) - (local.get $1) - ) - ) - (block - (i32.store offset=12 - (local.get $2) - (local.get $8) - ) - (i32.store - (local.get $3) - (local.get $8) - ) - (i32.store offset=8 - (local.get $8) - (local.get $2) - ) - (i32.store offset=12 - (local.get $8) - (local.get $0) - ) - (i32.store offset=24 - (local.get $8) - (i32.const 0) - ) ) - (call $_abort) ) ) ) - ) - ) - (return - (i32.add - (local.get $9) - (i32.const 8) + (return + (i32.add + (local.get $9) + (i32.const 8) + ) + ) ) ) ) ) - ) - (loop $while-in70 - (block $while-out69 - (if - (i32.le_u - (local.tee $2 - (i32.load - (local.get $4) + (loop $while-in70 + (block $while-out69 + (if + (i32.le_u + (local.tee $2 + (i32.load + (local.get $4) + ) ) + (local.get $6) ) - (local.get $6) - ) - (br_if $while-out69 - (i32.gt_u - (local.tee $2 - (i32.add - (local.get $2) - (i32.load offset=4 - (local.get $4) + (then + (br_if $while-out69 + (i32.gt_u + (local.tee $2 + (i32.add + (local.get $2) + (i32.load offset=4 + (local.get $4) + ) + ) ) + (local.get $6) ) ) - (local.get $6) ) ) - ) - (local.set $4 - (i32.load offset=8 - (local.get $4) + (local.set $4 + (i32.load offset=8 + (local.get $4) + ) ) + (br $while-in70) ) - (br $while-in70) ) - ) - (local.set $10 - (i32.add - (local.tee $4 - (i32.add - (local.get $2) - (i32.const -47) + (local.set $10 + (i32.add + (local.tee $4 + (i32.add + (local.get $2) + (i32.const -47) + ) ) + (i32.const 8) ) - (i32.const 8) ) - ) - (local.set $12 - (i32.add - (local.tee $11 - (select - (local.get $6) - (local.tee $4 - (i32.add - (local.get $4) - (select - (i32.and - (i32.sub - (i32.const 0) + (local.set $12 + (i32.add + (local.tee $11 + (select + (local.get $6) + (local.tee $4 + (i32.add + (local.get $4) + (select + (i32.and + (i32.sub + (i32.const 0) + (local.get $10) + ) + (i32.const 7) + ) + (i32.const 0) + (i32.and (local.get $10) + (i32.const 7) ) - (i32.const 7) - ) - (i32.const 0) - (i32.and - (local.get $10) - (i32.const 7) ) ) ) - ) - (i32.lt_u - (local.get $4) - (local.tee $10 - (i32.add - (local.get $6) - (i32.const 16) + (i32.lt_u + (local.get $4) + (local.tee $10 + (i32.add + (local.get $6) + (i32.const 16) + ) ) ) ) ) + (i32.const 8) ) - (i32.const 8) ) - ) - (i32.store - (i32.const 200) - (local.tee $5 - (i32.add - (local.get $1) - (local.tee $4 - (select - (i32.and - (i32.sub - (i32.const 0) - (local.tee $4 - (i32.add - (local.get $1) - (i32.const 8) + (i32.store + (i32.const 200) + (local.tee $5 + (i32.add + (local.get $1) + (local.tee $4 + (select + (i32.and + (i32.sub + (i32.const 0) + (local.tee $4 + (i32.add + (local.get $1) + (i32.const 8) + ) ) ) + (i32.const 7) + ) + (i32.const 0) + (i32.and + (local.get $4) + (i32.const 7) ) - (i32.const 7) - ) - (i32.const 0) - (i32.and - (local.get $4) - (i32.const 7) ) ) ) ) ) - ) - (i32.store - (i32.const 188) - (local.tee $4 - (i32.sub - (i32.add - (local.get $3) - (i32.const -40) + (i32.store + (i32.const 188) + (local.tee $4 + (i32.sub + (i32.add + (local.get $3) + (i32.const -40) + ) + (local.get $4) ) + ) + ) + (i32.store offset=4 + (local.get $5) + (i32.or (local.get $4) + (i32.const 1) ) ) - ) - (i32.store offset=4 - (local.get $5) - (i32.or - (local.get $4) - (i32.const 1) + (i32.store offset=4 + (i32.add + (local.get $5) + (local.get $4) + ) + (i32.const 40) ) - ) - (i32.store offset=4 - (i32.add - (local.get $5) - (local.get $4) + (i32.store + (i32.const 204) + (i32.load + (i32.const 664) + ) ) - (i32.const 40) - ) - (i32.store - (i32.const 204) - (i32.load - (i32.const 664) + (i32.store + (local.tee $4 + (i32.add + (local.get $11) + (i32.const 4) + ) + ) + (i32.const 27) ) - ) - (i32.store - (local.tee $4 - (i32.add - (local.get $11) - (i32.const 4) + (i32.store + (local.get $12) + (i32.load + (i32.const 624) ) ) - (i32.const 27) - ) - (i32.store - (local.get $12) - (i32.load + (i32.store offset=4 + (local.get $12) + (i32.load + (i32.const 628) + ) + ) + (i32.store offset=8 + (local.get $12) + (i32.load + (i32.const 632) + ) + ) + (i32.store offset=12 + (local.get $12) + (i32.load + (i32.const 636) + ) + ) + (i32.store (i32.const 624) + (local.get $1) ) - ) - (i32.store offset=4 - (local.get $12) - (i32.load + (i32.store (i32.const 628) + (local.get $3) ) - ) - (i32.store offset=8 - (local.get $12) - (i32.load - (i32.const 632) - ) - ) - (i32.store offset=12 - (local.get $12) - (i32.load + (i32.store (i32.const 636) + (i32.const 0) ) - ) - (i32.store - (i32.const 624) - (local.get $1) - ) - (i32.store - (i32.const 628) - (local.get $3) - ) - (i32.store - (i32.const 636) - (i32.const 0) - ) - (i32.store - (i32.const 632) - (local.get $12) - ) - (local.set $1 - (i32.add - (local.get $11) - (i32.const 24) - ) - ) - (loop $while-in72 (i32.store - (local.tee $1 - (i32.add - (local.get $1) - (i32.const 4) - ) - ) - (i32.const 7) + (i32.const 632) + (local.get $12) ) - (br_if $while-in72 - (i32.lt_u - (i32.add - (local.get $1) - (i32.const 4) - ) - (local.get $2) + (local.set $1 + (i32.add + (local.get $11) + (i32.const 24) ) ) - ) - (if - (i32.ne - (local.get $11) - (local.get $6) - ) - (block + (loop $while-in72 (i32.store - (local.get $4) - (i32.and - (i32.load - (local.get $4) + (local.tee $1 + (i32.add + (local.get $1) + (i32.const 4) ) - (i32.const -2) ) + (i32.const 7) ) - (i32.store offset=4 - (local.get $6) - (i32.or - (local.tee $5 - (i32.sub - (local.get $11) - (local.get $6) - ) + (br_if $while-in72 + (i32.lt_u + (i32.add + (local.get $1) + (i32.const 4) ) - (i32.const 1) + (local.get $2) ) ) - (i32.store + ) + (if + (i32.ne (local.get $11) - (local.get $5) - ) - (local.set $1 - (i32.shr_u - (local.get $5) - (i32.const 3) - ) + (local.get $6) ) - (if - (i32.lt_u - (local.get $5) - (i32.const 256) - ) + (then (block - (local.set $2 - (i32.add - (i32.shl - (local.get $1) - (i32.const 3) + (i32.store + (local.get $4) + (i32.and + (i32.load + (local.get $4) ) - (i32.const 216) + (i32.const -2) ) ) - (if - (i32.and - (local.tee $3 - (i32.load - (i32.const 176) - ) - ) - (local.tee $1 - (i32.shl - (i32.const 1) - (local.get $1) + (i32.store offset=4 + (local.get $6) + (i32.or + (local.tee $5 + (i32.sub + (local.get $11) + (local.get $6) ) ) + (i32.const 1) ) - (if - (i32.lt_u - (local.tee $1 - (i32.load + ) + (i32.store + (local.get $11) + (local.get $5) + ) + (local.set $1 + (i32.shr_u + (local.get $5) + (i32.const 3) + ) + ) + (if + (i32.lt_u + (local.get $5) + (i32.const 256) + ) + (then + (block + (local.set $2 + (i32.add + (i32.shl + (local.get $1) + (i32.const 3) + ) + (i32.const 216) + ) + ) + (if + (i32.and (local.tee $3 - (i32.add + (i32.load + (i32.const 176) + ) + ) + (local.tee $1 + (i32.shl + (i32.const 1) + (local.get $1) + ) + ) + ) + (then + (if + (i32.lt_u + (local.tee $1 + (i32.load + (local.tee $3 + (i32.add + (local.get $2) + (i32.const 8) + ) + ) + ) + ) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (local.set $17 + (local.get $3) + ) + (local.set $7 + (local.get $1) + ) + ) + ) + ) + ) + (else + (block + (i32.store + (i32.const 176) + (i32.or + (local.get $3) + (local.get $1) + ) + ) + (local.set $17 + (i32.add + (local.get $2) + (i32.const 8) + ) + ) + (local.set $7 (local.get $2) - (i32.const 8) ) ) ) ) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (local.set $17 - (local.get $3) + (i32.store + (local.get $17) + (local.get $6) ) - (local.set $7 - (local.get $1) + (i32.store offset=12 + (local.get $7) + (local.get $6) ) - ) - ) - (block - (i32.store - (i32.const 176) - (i32.or - (local.get $3) - (local.get $1) + (i32.store offset=8 + (local.get $6) + (local.get $7) ) - ) - (local.set $17 - (i32.add + (i32.store offset=12 + (local.get $6) (local.get $2) - (i32.const 8) ) - ) - (local.set $7 - (local.get $2) + (br $do-once40) ) ) ) - (i32.store - (local.get $17) - (local.get $6) - ) - (i32.store offset=12 - (local.get $7) - (local.get $6) - ) - (i32.store offset=8 - (local.get $6) - (local.get $7) - ) - (i32.store offset=12 - (local.get $6) - (local.get $2) - ) - (br $do-once40) - ) - ) - (local.set $2 - (i32.add - (i32.shl - (local.tee $4 - (if (result i32) - (local.tee $1 - (i32.shr_u - (local.get $5) - (i32.const 8) - ) - ) - (if (result i32) - (i32.gt_u - (local.get $5) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and + (local.set $2 + (i32.add + (i32.shl + (local.tee $4 + (if (result i32) + (local.tee $1 (i32.shr_u (local.get $5) - (i32.add - (local.tee $1 - (i32.add - (i32.sub - (i32.const 14) - (i32.or - (i32.or - (local.tee $1 - (i32.and - (i32.shr_u - (i32.add - (local.tee $3 - (i32.shl - (local.get $1) - (local.tee $2 - (i32.and - (i32.shr_u - (i32.add + (i32.const 8) + ) + ) + (then + (if (result i32) + (i32.gt_u + (local.get $5) + (i32.const 16777215) + ) + (then + (i32.const 31) + ) + (else + (i32.or + (i32.and + (i32.shr_u + (local.get $5) + (i32.add + (local.tee $1 + (i32.add + (i32.sub + (i32.const 14) + (i32.or + (i32.or + (local.tee $1 + (i32.and + (i32.shr_u + (i32.add + (local.tee $3 + (i32.shl (local.get $1) - (i32.const 1048320) + (local.tee $2 + (i32.and + (i32.shr_u + (i32.add + (local.get $1) + (i32.const 1048320) + ) + (i32.const 16) + ) + (i32.const 8) + ) + ) ) - (i32.const 16) ) - (i32.const 8) + (i32.const 520192) ) + (i32.const 16) ) + (i32.const 4) ) ) - (i32.const 520192) + (local.get $2) + ) + (local.tee $1 + (i32.and + (i32.shr_u + (i32.add + (local.tee $3 + (i32.shl + (local.get $3) + (local.get $1) + ) + ) + (i32.const 245760) + ) + (i32.const 16) + ) + (i32.const 2) + ) ) - (i32.const 16) ) - (i32.const 4) ) - ) - (local.get $2) - ) - (local.tee $1 - (i32.and (i32.shr_u - (i32.add - (local.tee $3 - (i32.shl - (local.get $3) - (local.get $1) - ) - ) - (i32.const 245760) + (i32.shl + (local.get $3) + (local.get $1) ) - (i32.const 16) + (i32.const 15) ) - (i32.const 2) ) ) + (i32.const 7) ) ) - (i32.shr_u - (i32.shl - (local.get $3) - (local.get $1) - ) - (i32.const 15) - ) + (i32.const 1) + ) + (i32.shl + (local.get $1) + (i32.const 1) ) ) - (i32.const 7) ) ) - (i32.const 1) ) - (i32.shl - (local.get $1) - (i32.const 1) + (else + (i32.const 0) ) ) ) - (i32.const 0) - ) - ) - (i32.const 2) - ) - (i32.const 480) - ) - ) - (i32.store offset=28 - (local.get $6) - (local.get $4) - ) - (i32.store offset=20 - (local.get $6) - (i32.const 0) - ) - (i32.store - (local.get $10) - (i32.const 0) - ) - (if - (i32.eqz - (i32.and - (local.tee $3 - (i32.load - (i32.const 180) - ) - ) - (local.tee $1 - (i32.shl - (i32.const 1) - (local.get $4) + (i32.const 2) ) + (i32.const 480) ) ) - ) - (block - (i32.store - (i32.const 180) - (i32.or - (local.get $3) - (local.get $1) - ) - ) - (i32.store - (local.get $2) - (local.get $6) - ) - (i32.store offset=24 - (local.get $6) - (local.get $2) - ) - (i32.store offset=12 - (local.get $6) + (i32.store offset=28 (local.get $6) + (local.get $4) ) - (i32.store offset=8 - (local.get $6) + (i32.store offset=20 (local.get $6) + (i32.const 0) ) - (br $do-once40) - ) - ) - (local.set $4 - (i32.shl - (local.get $5) - (select + (i32.store + (local.get $10) (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u - (local.get $4) - (i32.const 1) + ) + (if + (i32.eqz + (i32.and + (local.tee $3 + (i32.load + (i32.const 180) + ) + ) + (local.tee $1 + (i32.shl + (i32.const 1) + (local.get $4) + ) + ) ) ) - (i32.eq - (local.get $4) - (i32.const 31) - ) - ) - ) - ) - (local.set $1 - (i32.load - (local.get $2) - ) - ) - (block $__rjto$9 - (block $__rjti$9 - (loop $while-in74 - (br_if $__rjti$9 - (i32.eq - (i32.and - (i32.load offset=4 + (then + (block + (i32.store + (i32.const 180) + (i32.or + (local.get $3) (local.get $1) ) - (i32.const -8) ) - (local.get $5) + (i32.store + (local.get $2) + (local.get $6) + ) + (i32.store offset=24 + (local.get $6) + (local.get $2) + ) + (i32.store offset=12 + (local.get $6) + (local.get $6) + ) + (i32.store offset=8 + (local.get $6) + (local.get $6) + ) + (br $do-once40) ) ) - (local.set $2 - (i32.shl - (local.get $4) - (i32.const 1) + ) + (local.set $4 + (i32.shl + (local.get $5) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u + (local.get $4) + (i32.const 1) + ) + ) + (i32.eq + (local.get $4) + (i32.const 31) + ) ) ) - (if - (local.tee $3 - (i32.load - (local.tee $4 - (i32.add - (i32.add + ) + (local.set $1 + (i32.load + (local.get $2) + ) + ) + (block $__rjto$9 + (block $__rjti$9 + (loop $while-in74 + (br_if $__rjti$9 + (i32.eq + (i32.and + (i32.load offset=4 (local.get $1) - (i32.const 16) ) - (i32.shl - (i32.shr_u - (local.get $4) - (i32.const 31) + (i32.const -8) + ) + (local.get $5) + ) + ) + (local.set $2 + (i32.shl + (local.get $4) + (i32.const 1) + ) + ) + (if + (local.tee $3 + (i32.load + (local.tee $4 + (i32.add + (i32.add + (local.get $1) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (local.get $4) + (i32.const 31) + ) + (i32.const 2) + ) ) - (i32.const 2) ) ) ) + (then + (block + (local.set $4 + (local.get $2) + ) + (local.set $1 + (local.get $3) + ) + (br $while-in74) + ) + ) ) ) - (block - (local.set $4 - (local.get $2) + (if + (i32.lt_u + (local.get $4) + (i32.load + (i32.const 192) + ) ) - (local.set $1 - (local.get $3) + (then + (call $_abort) + ) + (else + (block + (i32.store + (local.get $4) + (local.get $6) + ) + (i32.store offset=24 + (local.get $6) + (local.get $1) + ) + (i32.store offset=12 + (local.get $6) + (local.get $6) + ) + (i32.store offset=8 + (local.get $6) + (local.get $6) + ) + (br $do-once40) + ) ) - (br $while-in74) - ) - ) - ) - (if - (i32.lt_u - (local.get $4) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (i32.store - (local.get $4) - (local.get $6) - ) - (i32.store offset=24 - (local.get $6) - (local.get $1) - ) - (i32.store offset=12 - (local.get $6) - (local.get $6) - ) - (i32.store offset=8 - (local.get $6) - (local.get $6) ) - (br $do-once40) + (br $__rjto$9) ) - ) - (br $__rjto$9) - ) - (if - (i32.and - (i32.ge_u - (local.tee $4 - (i32.load - (local.tee $2 - (i32.add - (local.get $1) - (i32.const 8) + (if + (i32.and + (i32.ge_u + (local.tee $4 + (i32.load + (local.tee $2 + (i32.add + (local.get $1) + (i32.const 8) + ) + ) ) ) + (local.tee $3 + (i32.load + (i32.const 192) + ) + ) + ) + (i32.ge_u + (local.get $1) + (local.get $3) ) ) - (local.tee $3 - (i32.load - (i32.const 192) + (then + (block + (i32.store offset=12 + (local.get $4) + (local.get $6) + ) + (i32.store + (local.get $2) + (local.get $6) + ) + (i32.store offset=8 + (local.get $6) + (local.get $4) + ) + (i32.store offset=12 + (local.get $6) + (local.get $1) + ) + (i32.store offset=24 + (local.get $6) + (i32.const 0) + ) ) ) - ) - (i32.ge_u - (local.get $1) - (local.get $3) - ) - ) - (block - (i32.store offset=12 - (local.get $4) - (local.get $6) - ) - (i32.store - (local.get $2) - (local.get $6) - ) - (i32.store offset=8 - (local.get $6) - (local.get $4) - ) - (i32.store offset=12 - (local.get $6) - (local.get $1) - ) - (i32.store offset=24 - (local.get $6) - (i32.const 0) + (else + (call $_abort) + ) ) ) - (call $_abort) ) ) ) ) ) - (block - (if - (i32.or - (i32.eqz - (local.tee $2 - (i32.load - (i32.const 192) + (else + (block + (if + (i32.or + (i32.eqz + (local.tee $2 + (i32.load + (i32.const 192) + ) ) ) + (i32.lt_u + (local.get $1) + (local.get $2) + ) ) - (i32.lt_u - (local.get $1) - (local.get $2) + (then + (i32.store + (i32.const 192) + (local.get $1) + ) ) ) (i32.store - (i32.const 192) + (i32.const 624) (local.get $1) ) - ) - (i32.store - (i32.const 624) - (local.get $1) - ) - (i32.store - (i32.const 628) - (local.get $3) - ) - (i32.store - (i32.const 636) - (i32.const 0) - ) - (i32.store - (i32.const 212) - (i32.load - (i32.const 648) + (i32.store + (i32.const 628) + (local.get $3) ) - ) - (i32.store - (i32.const 208) - (i32.const -1) - ) - (local.set $2 - (i32.const 0) - ) - (loop $while-in43 - (i32.store offset=12 - (local.tee $4 - (i32.add - (i32.shl - (local.get $2) - (i32.const 3) - ) - (i32.const 216) - ) + (i32.store + (i32.const 636) + (i32.const 0) + ) + (i32.store + (i32.const 212) + (i32.load + (i32.const 648) ) - (local.get $4) ) - (i32.store offset=8 - (local.get $4) - (local.get $4) + (i32.store + (i32.const 208) + (i32.const -1) ) - (br_if $while-in43 - (i32.ne - (local.tee $2 + (local.set $2 + (i32.const 0) + ) + (loop $while-in43 + (i32.store offset=12 + (local.tee $4 (i32.add - (local.get $2) - (i32.const 1) + (i32.shl + (local.get $2) + (i32.const 3) + ) + (i32.const 216) ) ) - (i32.const 32) + (local.get $4) + ) + (i32.store offset=8 + (local.get $4) + (local.get $4) + ) + (br_if $while-in43 + (i32.ne + (local.tee $2 + (i32.add + (local.get $2) + (i32.const 1) + ) + ) + (i32.const 32) + ) ) ) - ) - (i32.store - (i32.const 200) - (local.tee $2 - (i32.add - (local.get $1) - (local.tee $1 - (select - (i32.and - (i32.sub - (i32.const 0) - (local.tee $1 - (i32.add - (local.get $1) - (i32.const 8) + (i32.store + (i32.const 200) + (local.tee $2 + (i32.add + (local.get $1) + (local.tee $1 + (select + (i32.and + (i32.sub + (i32.const 0) + (local.tee $1 + (i32.add + (local.get $1) + (i32.const 8) + ) ) ) + (i32.const 7) + ) + (i32.const 0) + (i32.and + (local.get $1) + (i32.const 7) ) - (i32.const 7) - ) - (i32.const 0) - (i32.and - (local.get $1) - (i32.const 7) ) ) ) ) ) - ) - (i32.store - (i32.const 188) - (local.tee $1 - (i32.sub - (i32.add - (local.get $3) - (i32.const -40) + (i32.store + (i32.const 188) + (local.tee $1 + (i32.sub + (i32.add + (local.get $3) + (i32.const -40) + ) + (local.get $1) ) - (local.get $1) ) ) - ) - (i32.store offset=4 - (local.get $2) - (i32.or - (local.get $1) - (i32.const 1) - ) - ) - (i32.store offset=4 - (i32.add + (i32.store offset=4 (local.get $2) - (local.get $1) + (i32.or + (local.get $1) + (i32.const 1) + ) ) - (i32.const 40) - ) - (i32.store - (i32.const 204) - (i32.load - (i32.const 664) + (i32.store offset=4 + (i32.add + (local.get $2) + (local.get $1) + ) + (i32.const 40) + ) + (i32.store + (i32.const 204) + (i32.load + (i32.const 664) + ) ) ) ) @@ -26275,7 +27741,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u @@ -26291,7 +27759,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -26310,7 +27780,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $8 ;; CHECK-NEXT: (i32.add @@ -26329,7 +27801,7 @@ ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -26337,7 +27809,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $7 ;; CHECK-NEXT: (i32.load ;; CHECK-NEXT: (local.get $1) @@ -26347,7 +27819,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u @@ -26362,7 +27836,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $0 ;; CHECK-NEXT: (i32.add @@ -26377,7 +27853,7 @@ ;; CHECK-NEXT: (i32.const 196) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ne ;; CHECK-NEXT: (i32.and @@ -26395,7 +27871,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -26444,7 +27920,7 @@ ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: (i32.const 256) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (i32.load offset=12 ;; CHECK-NEXT: (local.get $1) @@ -26467,13 +27943,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ne @@ -26482,7 +27960,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -26491,7 +27971,7 @@ ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.and @@ -26521,19 +28001,23 @@ ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -26547,10 +28031,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -26586,7 +28074,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.tee $5 @@ -26605,20 +28093,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $5 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $5 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $4 - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $6 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $4 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $6 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -26634,7 +28126,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) @@ -26655,7 +28147,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) @@ -26671,8 +28163,10 @@ ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (i32.const 0) @@ -26683,7 +28177,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.tee $10 @@ -26693,7 +28187,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ne @@ -26707,7 +28203,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -26721,7 +28219,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: (local.get $4) @@ -26734,14 +28232,16 @@ ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $1) @@ -26761,7 +28261,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (local.get $6) @@ -26770,7 +28270,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 180) ;; CHECK-NEXT: (i32.and @@ -26796,7 +28296,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $12) @@ -26804,7 +28304,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -26818,20 +28320,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $12) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $12) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -26852,7 +28358,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=24 ;; CHECK-NEXT: (local.get $6) @@ -26869,20 +28377,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $5) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=16 - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=16 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -26893,32 +28405,36 @@ ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -26928,7 +28444,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $2 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -26945,7 +28461,9 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz @@ -26963,14 +28481,16 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.and @@ -26993,7 +28513,7 @@ ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $8) @@ -27001,7 +28521,7 @@ ;; CHECK-NEXT: (i32.const 200) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 188) ;; CHECK-NEXT: (local.tee $0 @@ -27031,7 +28551,9 @@ ;; CHECK-NEXT: (i32.const 196) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 196) @@ -27051,7 +28573,7 @@ ;; CHECK-NEXT: (i32.const 196) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 184) ;; CHECK-NEXT: (local.tee $0 @@ -27105,7 +28627,7 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.const 256) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $4 ;; CHECK-NEXT: (i32.load offset=12 ;; CHECK-NEXT: (local.get $8) @@ -27128,7 +28650,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $1) @@ -27136,7 +28658,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ne @@ -27145,7 +28669,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -27154,7 +28680,7 @@ ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.and @@ -27178,13 +28704,15 @@ ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $14 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $4) @@ -27192,7 +28720,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -27206,10 +28736,14 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $14 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $14 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -27222,7 +28756,7 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $6 ;; CHECK-NEXT: (i32.load offset=24 ;; CHECK-NEXT: (local.get $8) @@ -27238,7 +28772,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.tee $3 @@ -27257,20 +28791,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $9 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $9 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (br $do-once6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $do-once6) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -27286,7 +28824,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -27307,7 +28845,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -27325,8 +28863,10 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 0) @@ -27337,7 +28877,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.tee $4 @@ -27349,7 +28889,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.ne @@ -27363,7 +28905,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -27377,7 +28921,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (local.get $0) @@ -27390,14 +28934,16 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (local.get $8) @@ -27417,7 +28963,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $9) @@ -27426,7 +28972,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $9) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 180) ;; CHECK-NEXT: (i32.and @@ -27446,7 +28992,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $6) @@ -27454,7 +29000,9 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eq @@ -27468,13 +29016,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.store + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $do-once4 @@ -27493,7 +29045,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store offset=24 ;; CHECK-NEXT: (local.get $9) @@ -27510,20 +29064,24 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=16 - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=16 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -27534,22 +29092,26 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (i32.store offset=20 - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.store offset=24 - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.store offset=20 + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.store offset=24 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $9) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -27580,15 +29142,17 @@ ;; CHECK-NEXT: (i32.const 196) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 184) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -27604,7 +29168,7 @@ ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (i32.const 256) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (i32.shl @@ -27628,33 +29192,37 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (local.tee $3 - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (local.tee $3 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 8) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.load + ;; CHECK-NEXT: (i32.const 192) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.load - ;; CHECK-NEXT: (i32.const 192) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (local.set $15 - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $13 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $15 + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.set $13 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 176) ;; CHECK-NEXT: (i32.or @@ -27703,93 +29271,101 @@ ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.gt_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.const 16777215) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 31) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.gt_u + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (i32.const 16777215) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 31) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (i32.const 14) - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (i32.or - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.tee $4 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1048320) + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (i32.const 14) + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (i32.or + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.tee $4 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1048320) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 8) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 520192) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 520192) + ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.tee $0 - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.tee $1 - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.tee $0 + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.tee $1 + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 245760) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 245760) + ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shr_u + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shr_u - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 15) - ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.shl + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.shl - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2) @@ -27824,7 +29400,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (i32.shl ;; CHECK-NEXT: (local.get $3) @@ -27889,7 +29465,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $5 ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) @@ -27907,8 +29483,10 @@ ;; CHECK-NEXT: (i32.const 192) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: (local.get $2) @@ -27954,7 +29532,7 @@ ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store offset=12 ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: (local.get $2) @@ -27976,11 +29554,13 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $_abort) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (i32.const 180) ;; CHECK-NEXT: (i32.or @@ -28020,9 +29600,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (return) - ;; CHECK-NEXT: (local.set $0 - ;; CHECK-NEXT: (i32.const 632) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $0 + ;; CHECK-NEXT: (i32.const 632) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $while-in17 @@ -28065,7 +29649,9 @@ (i32.eqz (local.get $0) ) - (return) + (then + (return) + ) ) (if (i32.lt_u @@ -28081,7 +29667,9 @@ ) ) ) - (call $_abort) + (then + (call $_abort) + ) ) (if (i32.eq @@ -28100,7 +29688,9 @@ ) (i32.const 1) ) - (call $_abort) + (then + (call $_abort) + ) ) (local.set $8 (i32.add @@ -28119,184 +29709,269 @@ (local.get $7) (i32.const 1) ) - (block - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $0) - ) - ) - (block - (local.set $7 - (i32.load + (then + (block + (local.set $2 (local.get $1) ) - ) - (if - (i32.eqz - (local.get $5) + (local.set $3 + (local.get $0) ) - (return) ) - (if - (i32.lt_u - (local.tee $1 - (i32.add - (local.get $1) - (i32.sub - (i32.const 0) - (local.get $7) + ) + (else + (block + (local.set $7 + (i32.load + (local.get $1) + ) + ) + (if + (i32.eqz + (local.get $5) + ) + (then + (return) + ) + ) + (if + (i32.lt_u + (local.tee $1 + (i32.add + (local.get $1) + (i32.sub + (i32.const 0) + (local.get $7) + ) ) ) + (local.get $11) + ) + (then + (call $_abort) ) - (local.get $11) - ) - (call $_abort) - ) - (local.set $0 - (i32.add - (local.get $7) - (local.get $0) ) - ) - (if - (i32.eq - (local.get $1) - (i32.load - (i32.const 196) + (local.set $0 + (i32.add + (local.get $7) + (local.get $0) ) ) - (block - (if - (i32.ne - (i32.and - (local.tee $3 - (i32.load - (local.tee $2 - (i32.add - (local.get $8) - (i32.const 4) + (if + (i32.eq + (local.get $1) + (i32.load + (i32.const 196) + ) + ) + (then + (block + (if + (i32.ne + (i32.and + (local.tee $3 + (i32.load + (local.tee $2 + (i32.add + (local.get $8) + (i32.const 4) + ) + ) ) ) + (i32.const 3) + ) + (i32.const 3) + ) + (then + (block + (local.set $2 + (local.get $1) + ) + (local.set $3 + (local.get $0) + ) + (br $do-once) ) ) - (i32.const 3) ) - (i32.const 3) - ) - (block - (local.set $2 + (i32.store + (i32.const 184) + (local.get $0) + ) + (i32.store + (local.get $2) + (i32.and + (local.get $3) + (i32.const -2) + ) + ) + (i32.store offset=4 (local.get $1) + (i32.or + (local.get $0) + (i32.const 1) + ) ) - (local.set $3 + (i32.store + (i32.add + (local.get $1) + (local.get $0) + ) (local.get $0) ) - (br $do-once) - ) - ) - (i32.store - (i32.const 184) - (local.get $0) - ) - (i32.store - (local.get $2) - (i32.and - (local.get $3) - (i32.const -2) - ) - ) - (i32.store offset=4 - (local.get $1) - (i32.or - (local.get $0) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (local.get $1) - (local.get $0) + (return) ) - (local.get $0) ) - (return) ) - ) - (local.set $5 - (i32.shr_u - (local.get $7) - (i32.const 3) - ) - ) - (if - (i32.lt_u - (local.get $7) - (i32.const 256) + (local.set $5 + (i32.shr_u + (local.get $7) + (i32.const 3) + ) ) - (block - (local.set $6 - (i32.load offset=12 - (local.get $1) - ) + (if + (i32.lt_u + (local.get $7) + (i32.const 256) ) - (if - (i32.ne - (local.tee $2 - (i32.load offset=8 + (then + (block + (local.set $6 + (i32.load offset=12 (local.get $1) ) ) - (local.tee $3 - (i32.add - (i32.shl - (local.get $5) - (i32.const 3) + (if + (i32.ne + (local.tee $2 + (i32.load offset=8 + (local.get $1) + ) + ) + (local.tee $3 + (i32.add + (i32.shl + (local.get $5) + (i32.const 3) + ) + (i32.const 216) + ) + ) + ) + (then + (block + (if + (i32.lt_u + (local.get $2) + (local.get $11) + ) + (then + (call $_abort) + ) + ) + (if + (i32.ne + (i32.load offset=12 + (local.get $2) + ) + (local.get $1) + ) + (then + (call $_abort) + ) + ) ) - (i32.const 216) ) ) - ) - (block (if - (i32.lt_u + (i32.eq + (local.get $6) (local.get $2) - (local.get $11) ) - (call $_abort) - ) - (if - (i32.ne - (i32.load offset=12 - (local.get $2) + (then + (block + (i32.store + (i32.const 176) + (i32.and + (i32.load + (i32.const 176) + ) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $5) + ) + (i32.const -1) + ) + ) + ) + (local.set $2 + (local.get $1) + ) + (local.set $3 + (local.get $0) + ) + (br $do-once) ) - (local.get $1) ) - (call $_abort) ) - ) - ) - (if - (i32.eq - (local.get $6) - (local.get $2) - ) - (block - (i32.store - (i32.const 176) - (i32.and - (i32.load - (i32.const 176) + (if + (i32.eq + (local.get $6) + (local.get $3) + ) + (then + (local.set $4 + (i32.add + (local.get $6) + (i32.const 8) + ) ) - (i32.xor - (i32.shl - (i32.const 1) - (local.get $5) + ) + (else + (block + (if + (i32.lt_u + (local.get $6) + (local.get $11) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $3 + (i32.add + (local.get $6) + (i32.const 8) + ) + ) + ) + (local.get $1) + ) + (then + (local.set $4 + (local.get $3) + ) + ) + (else + (call $_abort) + ) ) - (i32.const -1) ) ) ) + (i32.store offset=12 + (local.get $2) + (local.get $6) + ) + (i32.store + (local.get $4) + (local.get $2) + ) (local.set $2 (local.get $1) ) @@ -28306,408 +29981,423 @@ (br $do-once) ) ) + ) + (local.set $12 + (i32.load offset=24 + (local.get $1) + ) + ) + (block $do-once0 (if (i32.eq - (local.get $6) - (local.get $3) - ) - (local.set $4 - (i32.add - (local.get $6) - (i32.const 8) - ) - ) - (block - (if - (i32.lt_u - (local.get $6) - (local.get $11) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $3 - (i32.add - (local.get $6) - (i32.const 8) - ) - ) - ) + (local.tee $4 + (i32.load offset=12 (local.get $1) ) - (local.set $4 - (local.get $3) - ) - (call $_abort) - ) - ) - ) - (i32.store offset=12 - (local.get $2) - (local.get $6) - ) - (i32.store - (local.get $4) - (local.get $2) - ) - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $0) - ) - (br $do-once) - ) - ) - (local.set $12 - (i32.load offset=24 - (local.get $1) - ) - ) - (block $do-once0 - (if - (i32.eq - (local.tee $4 - (i32.load offset=12 - (local.get $1) ) + (local.get $1) ) - (local.get $1) - ) - (block - (if - (i32.eqz - (local.tee $5 - (i32.load - (local.tee $4 - (i32.add - (local.tee $7 + (then + (block + (if + (i32.eqz + (local.tee $5 + (i32.load + (local.tee $4 (i32.add - (local.get $1) - (i32.const 16) + (local.tee $7 + (i32.add + (local.get $1) + (i32.const 16) + ) + ) + (i32.const 4) ) ) - (i32.const 4) ) ) ) - ) - ) - (if - (local.tee $5 - (i32.load - (local.get $7) + (then + (if + (local.tee $5 + (i32.load + (local.get $7) + ) + ) + (then + (local.set $4 + (local.get $7) + ) + ) + (else + (block + (local.set $6 + (i32.const 0) + ) + (br $do-once0) + ) + ) + ) ) ) - (local.set $4 - (local.get $7) - ) - (block - (local.set $6 - (i32.const 0) + (loop $while-in + (if + (local.tee $7 + (i32.load + (local.tee $10 + (i32.add + (local.get $5) + (i32.const 20) + ) + ) + ) + ) + (then + (block + (local.set $5 + (local.get $7) + ) + (local.set $4 + (local.get $10) + ) + (br $while-in) + ) + ) ) - (br $do-once0) - ) - ) - ) - (loop $while-in - (if - (local.tee $7 - (i32.load - (local.tee $10 - (i32.add - (local.get $5) - (i32.const 20) + (if + (local.tee $7 + (i32.load + (local.tee $10 + (i32.add + (local.get $5) + (i32.const 16) + ) + ) + ) + ) + (then + (block + (local.set $5 + (local.get $7) + ) + (local.set $4 + (local.get $10) + ) + (br $while-in) ) ) ) ) - (block - (local.set $5 - (local.get $7) + (if + (i32.lt_u + (local.get $4) + (local.get $11) ) - (local.set $4 - (local.get $10) + (then + (call $_abort) ) - (br $while-in) - ) - ) - (if - (local.tee $7 - (i32.load - (local.tee $10 - (i32.add + (else + (block + (i32.store + (local.get $4) + (i32.const 0) + ) + (local.set $6 (local.get $5) - (i32.const 16) ) ) ) ) - (block - (local.set $5 - (local.get $7) - ) - (local.set $4 - (local.get $10) - ) - (br $while-in) - ) ) ) - (if - (i32.lt_u - (local.get $4) - (local.get $11) - ) - (call $_abort) + (else (block - (i32.store - (local.get $4) - (i32.const 0) - ) - (local.set $6 - (local.get $5) + (if + (i32.lt_u + (local.tee $10 + (i32.load offset=8 + (local.get $1) + ) + ) + (local.get $11) + ) + (then + (call $_abort) + ) ) - ) - ) - ) - (block - (if - (i32.lt_u - (local.tee $10 - (i32.load offset=8 + (if + (i32.ne + (i32.load + (local.tee $7 + (i32.add + (local.get $10) + (i32.const 12) + ) + ) + ) (local.get $1) ) + (then + (call $_abort) + ) ) - (local.get $11) - ) - (call $_abort) - ) - (if - (i32.ne - (i32.load - (local.tee $7 - (i32.add - (local.get $10) - (i32.const 12) + (if + (i32.eq + (i32.load + (local.tee $5 + (i32.add + (local.get $4) + (i32.const 8) + ) + ) ) + (local.get $1) ) - ) - (local.get $1) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $5 - (i32.add - (local.get $4) - (i32.const 8) + (then + (block + (i32.store + (local.get $7) + (local.get $4) + ) + (i32.store + (local.get $5) + (local.get $10) + ) + (local.set $6 + (local.get $4) + ) ) ) - ) - (local.get $1) - ) - (block - (i32.store - (local.get $7) - (local.get $4) - ) - (i32.store - (local.get $5) - (local.get $10) - ) - (local.set $6 - (local.get $4) + (else + (call $_abort) + ) ) ) - (call $_abort) ) ) ) - ) - (if - (local.get $12) - (block - (if - (i32.eq - (local.get $1) - (i32.load - (local.tee $4 - (i32.add - (i32.shl - (local.tee $5 - (i32.load offset=28 - (local.get $1) + (if + (local.get $12) + (then + (block + (if + (i32.eq + (local.get $1) + (i32.load + (local.tee $4 + (i32.add + (i32.shl + (local.tee $5 + (i32.load offset=28 + (local.get $1) + ) + ) + (i32.const 2) ) + (i32.const 480) ) - (i32.const 2) ) - (i32.const 480) ) ) - ) - ) - (block - (i32.store - (local.get $4) - (local.get $6) - ) - (if - (i32.eqz - (local.get $6) - ) - (block - (i32.store - (i32.const 180) - (i32.and - (i32.load - (i32.const 180) + (then + (block + (i32.store + (local.get $4) + (local.get $6) + ) + (if + (i32.eqz + (local.get $6) ) - (i32.xor - (i32.shl - (i32.const 1) - (local.get $5) + (then + (block + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $5) + ) + (i32.const -1) + ) + ) + ) + (local.set $2 + (local.get $1) + ) + (local.set $3 + (local.get $0) + ) + (br $do-once) ) - (i32.const -1) ) ) ) - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $0) + ) + (else + (block + (if + (i32.lt_u + (local.get $12) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $4 + (i32.add + (local.get $12) + (i32.const 16) + ) + ) + ) + (local.get $1) + ) + (then + (i32.store + (local.get $4) + (local.get $6) + ) + ) + (else + (i32.store offset=20 + (local.get $12) + (local.get $6) + ) + ) + ) + (if + (i32.eqz + (local.get $6) + ) + (then + (block + (local.set $2 + (local.get $1) + ) + (local.set $3 + (local.get $0) + ) + (br $do-once) + ) + ) + ) ) - (br $do-once) ) ) - ) - (block (if (i32.lt_u - (local.get $12) - (i32.load - (i32.const 192) + (local.get $6) + (local.tee $5 + (i32.load + (i32.const 192) + ) ) ) - (call $_abort) + (then + (call $_abort) + ) + ) + (i32.store offset=24 + (local.get $6) + (local.get $12) ) (if - (i32.eq + (local.tee $7 (i32.load (local.tee $4 (i32.add - (local.get $12) + (local.get $1) (i32.const 16) ) ) ) - (local.get $1) - ) - (i32.store - (local.get $4) - (local.get $6) - ) - (i32.store offset=20 - (local.get $12) - (local.get $6) ) - ) - (if - (i32.eqz - (local.get $6) - ) - (block - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $0) + (then + (if + (i32.lt_u + (local.get $7) + (local.get $5) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=16 + (local.get $6) + (local.get $7) + ) + (i32.store offset=24 + (local.get $7) + (local.get $6) + ) + ) + ) ) - (br $do-once) ) ) - ) - ) - (if - (i32.lt_u - (local.get $6) - (local.tee $5 - (i32.load - (i32.const 192) - ) - ) - ) - (call $_abort) - ) - (i32.store offset=24 - (local.get $6) - (local.get $12) - ) - (if - (local.tee $7 - (i32.load + (if (local.tee $4 - (i32.add - (local.get $1) - (i32.const 16) + (i32.load offset=4 + (local.get $4) ) ) - ) - ) - (if - (i32.lt_u - (local.get $7) - (local.get $5) - ) - (call $_abort) - (block - (i32.store offset=16 - (local.get $6) - (local.get $7) + (then + (if + (i32.lt_u + (local.get $4) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=20 + (local.get $6) + (local.get $4) + ) + (i32.store offset=24 + (local.get $4) + (local.get $6) + ) + (local.set $2 + (local.get $1) + ) + (local.set $3 + (local.get $0) + ) + ) + ) + ) ) - (i32.store offset=24 - (local.get $7) - (local.get $6) + (else + (block + (local.set $2 + (local.get $1) + ) + (local.set $3 + (local.get $0) + ) + ) ) ) ) ) - (if - (local.tee $4 - (i32.load offset=4 - (local.get $4) - ) - ) - (if - (i32.lt_u - (local.get $4) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (i32.store offset=20 - (local.get $6) - (local.get $4) - ) - (i32.store offset=24 - (local.get $4) - (local.get $6) - ) - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $0) - ) - ) - ) + (else (block (local.set $2 (local.get $1) @@ -28718,14 +30408,6 @@ ) ) ) - (block - (local.set $2 - (local.get $1) - ) - (local.set $3 - (local.get $0) - ) - ) ) ) ) @@ -28735,7 +30417,9 @@ (local.get $2) (local.get $8) ) - (call $_abort) + (then + (call $_abort) + ) ) (if (i32.eqz @@ -28753,593 +30437,681 @@ (i32.const 1) ) ) - (call $_abort) + (then + (call $_abort) + ) ) (if (i32.and (local.get $1) (i32.const 2) ) - (block - (i32.store - (local.get $0) - (i32.and - (local.get $1) - (i32.const -2) - ) - ) - (i32.store offset=4 - (local.get $2) - (i32.or - (local.get $3) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (local.get $2) - (local.get $3) - ) - (local.get $3) - ) - ) - (block - (if - (i32.eq - (local.get $8) - (i32.load - (i32.const 200) - ) - ) - (block - (i32.store - (i32.const 188) - (local.tee $0 - (i32.add - (i32.load - (i32.const 188) - ) - (local.get $3) - ) - ) - ) - (i32.store - (i32.const 200) - (local.get $2) - ) - (i32.store offset=4 - (local.get $2) - (i32.or - (local.get $0) - (i32.const 1) - ) - ) - (if - (i32.ne - (local.get $2) - (i32.load - (i32.const 196) - ) - ) - (return) - ) - (i32.store - (i32.const 196) - (i32.const 0) - ) - (i32.store - (i32.const 184) - (i32.const 0) + (then + (block + (i32.store + (local.get $0) + (i32.and + (local.get $1) + (i32.const -2) ) - (return) ) - ) - (if - (i32.eq - (local.get $8) - (i32.load - (i32.const 196) + (i32.store offset=4 + (local.get $2) + (i32.or + (local.get $3) + (i32.const 1) ) ) - (block - (i32.store - (i32.const 184) - (local.tee $0 - (i32.add - (i32.load - (i32.const 184) - ) - (local.get $3) - ) - ) - ) - (i32.store - (i32.const 196) - (local.get $2) - ) - (i32.store offset=4 + (i32.store + (i32.add (local.get $2) - (i32.or - (local.get $0) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (local.get $2) - (local.get $0) - ) - (local.get $0) - ) - (return) - ) - ) - (local.set $5 - (i32.add - (i32.and - (local.get $1) - (i32.const -8) + (local.get $3) ) (local.get $3) ) ) - (local.set $3 - (i32.shr_u - (local.get $1) - (i32.const 3) - ) - ) - (block $do-once4 + ) + (else + (block (if - (i32.lt_u - (local.get $1) - (i32.const 256) - ) - (block - (local.set $4 - (i32.load offset=12 - (local.get $8) - ) + (i32.eq + (local.get $8) + (i32.load + (i32.const 200) ) - (if - (i32.ne - (local.tee $1 - (i32.load offset=8 - (local.get $8) - ) - ) + ) + (then + (block + (i32.store + (i32.const 188) (local.tee $0 (i32.add - (i32.shl - (local.get $3) - (i32.const 3) + (i32.load + (i32.const 188) ) - (i32.const 216) + (local.get $3) ) ) ) - (block - (if - (i32.lt_u - (local.get $1) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) + (i32.store + (i32.const 200) + (local.get $2) + ) + (i32.store offset=4 + (local.get $2) + (i32.or + (local.get $0) + (i32.const 1) ) - (if - (i32.ne - (i32.load offset=12 - (local.get $1) - ) - (local.get $8) + ) + (if + (i32.ne + (local.get $2) + (i32.load + (i32.const 196) ) - (call $_abort) + ) + (then + (return) ) ) - ) - (if - (i32.eq - (local.get $4) - (local.get $1) + (i32.store + (i32.const 196) + (i32.const 0) ) - (block - (i32.store - (i32.const 176) - (i32.and + (i32.store + (i32.const 184) + (i32.const 0) + ) + (return) + ) + ) + ) + (if + (i32.eq + (local.get $8) + (i32.load + (i32.const 196) + ) + ) + (then + (block + (i32.store + (i32.const 184) + (local.tee $0 + (i32.add (i32.load - (i32.const 176) - ) - (i32.xor - (i32.shl - (i32.const 1) - (local.get $3) - ) - (i32.const -1) + (i32.const 184) ) + (local.get $3) ) ) - (br $do-once4) ) - ) - (if - (i32.eq - (local.get $4) - (local.get $0) + (i32.store + (i32.const 196) + (local.get $2) ) - (local.set $14 - (i32.add - (local.get $4) - (i32.const 8) + (i32.store offset=4 + (local.get $2) + (i32.or + (local.get $0) + (i32.const 1) ) ) - (block - (if - (i32.lt_u - (local.get $4) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $0 - (i32.add - (local.get $4) - (i32.const 8) - ) - ) - ) - (local.get $8) - ) - (local.set $14 - (local.get $0) - ) - (call $_abort) + (i32.store + (i32.add + (local.get $2) + (local.get $0) ) + (local.get $0) ) + (return) ) - (i32.store offset=12 - (local.get $1) - (local.get $4) - ) - (i32.store - (local.get $14) + ) + ) + (local.set $5 + (i32.add + (i32.and (local.get $1) + (i32.const -8) ) + (local.get $3) ) - (block - (local.set $6 - (i32.load offset=24 - (local.get $8) - ) + ) + (local.set $3 + (i32.shr_u + (local.get $1) + (i32.const 3) + ) + ) + (block $do-once4 + (if + (i32.lt_u + (local.get $1) + (i32.const 256) ) - (block $do-once6 - (if - (i32.eq - (local.tee $0 - (i32.load offset=12 - (local.get $8) - ) + (then + (block + (local.set $4 + (i32.load offset=12 + (local.get $8) ) - (local.get $8) ) - (block - (if - (i32.eqz - (local.tee $3 - (i32.load - (local.tee $0 - (i32.add - (local.tee $1 - (i32.add - (local.get $8) - (i32.const 16) - ) - ) - (i32.const 4) - ) - ) - ) + (if + (i32.ne + (local.tee $1 + (i32.load offset=8 + (local.get $8) ) ) - (if - (local.tee $3 - (i32.load - (local.get $1) - ) - ) - (local.set $0 - (local.get $1) - ) - (block - (local.set $9 - (i32.const 0) + (local.tee $0 + (i32.add + (i32.shl + (local.get $3) + (i32.const 3) ) - (br $do-once6) + (i32.const 216) ) ) ) - (loop $while-in9 - (if - (local.tee $1 - (i32.load - (local.tee $4 - (i32.add - (local.get $3) - (i32.const 20) - ) - ) - ) - ) - (block - (local.set $3 + (then + (block + (if + (i32.lt_u (local.get $1) + (i32.load + (i32.const 192) + ) ) - (local.set $0 - (local.get $4) + (then + (call $_abort) ) - (br $while-in9) ) - ) - (if - (local.tee $1 - (i32.load - (local.tee $4 - (i32.add - (local.get $3) - (i32.const 16) - ) + (if + (i32.ne + (i32.load offset=12 + (local.get $1) ) + (local.get $8) ) - ) - (block - (local.set $3 - (local.get $1) - ) - (local.set $0 - (local.get $4) + (then + (call $_abort) ) - (br $while-in9) ) ) ) - (if - (i32.lt_u - (local.get $0) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) + ) + (if + (i32.eq + (local.get $4) + (local.get $1) + ) + (then (block (i32.store - (local.get $0) - (i32.const 0) - ) - (local.set $9 - (local.get $3) + (i32.const 176) + (i32.and + (i32.load + (i32.const 176) + ) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $3) + ) + (i32.const -1) + ) + ) ) + (br $do-once4) ) ) ) - (block - (if - (i32.lt_u - (local.tee $4 - (i32.load offset=8 - (local.get $8) - ) - ) - (i32.load - (i32.const 192) + (if + (i32.eq + (local.get $4) + (local.get $0) + ) + (then + (local.set $14 + (i32.add + (local.get $4) + (i32.const 8) ) ) - (call $_abort) ) - (if - (i32.ne - (i32.load - (local.tee $1 - (i32.add - (local.get $4) - (i32.const 12) + (else + (block + (if + (i32.lt_u + (local.get $4) + (i32.load + (i32.const 192) ) ) + (then + (call $_abort) + ) ) - (local.get $8) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $3 - (i32.add + (if + (i32.eq + (i32.load + (local.tee $0 + (i32.add + (local.get $4) + (i32.const 8) + ) + ) + ) + (local.get $8) + ) + (then + (local.set $14 (local.get $0) - (i32.const 8) ) ) - ) - (local.get $8) - ) - (block - (i32.store - (local.get $1) - (local.get $0) - ) - (i32.store - (local.get $3) - (local.get $4) - ) - (local.set $9 - (local.get $0) + (else + (call $_abort) + ) ) ) - (call $_abort) ) ) + (i32.store offset=12 + (local.get $1) + (local.get $4) + ) + (i32.store + (local.get $14) + (local.get $1) + ) ) ) - (if - (local.get $6) + (else (block - (if - (i32.eq + (local.set $6 + (i32.load offset=24 (local.get $8) - (i32.load + ) + ) + (block $do-once6 + (if + (i32.eq (local.tee $0 - (i32.add - (i32.shl + (i32.load offset=12 + (local.get $8) + ) + ) + (local.get $8) + ) + (then + (block + (if + (i32.eqz (local.tee $3 - (i32.load offset=28 - (local.get $8) + (i32.load + (local.tee $0 + (i32.add + (local.tee $1 + (i32.add + (local.get $8) + (i32.const 16) + ) + ) + (i32.const 4) + ) + ) + ) + ) + ) + (then + (if + (local.tee $3 + (i32.load + (local.get $1) + ) + ) + (then + (local.set $0 + (local.get $1) + ) + ) + (else + (block + (local.set $9 + (i32.const 0) + ) + (br $do-once6) + ) ) ) - (i32.const 2) ) - (i32.const 480) ) - ) - ) - ) - (block - (i32.store - (local.get $0) - (local.get $9) - ) - (if - (i32.eqz - (local.get $9) - ) - (block - (i32.store - (i32.const 180) - (i32.and + (loop $while-in9 + (if + (local.tee $1 + (i32.load + (local.tee $4 + (i32.add + (local.get $3) + (i32.const 20) + ) + ) + ) + ) + (then + (block + (local.set $3 + (local.get $1) + ) + (local.set $0 + (local.get $4) + ) + (br $while-in9) + ) + ) + ) + (if + (local.tee $1 + (i32.load + (local.tee $4 + (i32.add + (local.get $3) + (i32.const 16) + ) + ) + ) + ) + (then + (block + (local.set $3 + (local.get $1) + ) + (local.set $0 + (local.get $4) + ) + (br $while-in9) + ) + ) + ) + ) + (if + (i32.lt_u + (local.get $0) (i32.load - (i32.const 180) + (i32.const 192) ) - (i32.xor - (i32.shl - (i32.const 1) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store + (local.get $0) + (i32.const 0) + ) + (local.set $9 (local.get $3) ) - (i32.const -1) ) ) ) - (br $do-once4) ) ) - ) - (block - (if - (i32.lt_u - (local.get $6) - (i32.load - (i32.const 192) + (else + (block + (if + (i32.lt_u + (local.tee $4 + (i32.load offset=8 + (local.get $8) + ) + ) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) ) - ) - (call $_abort) - ) - (if - (i32.eq - (i32.load - (local.tee $0 - (i32.add - (local.get $6) - (i32.const 16) + (if + (i32.ne + (i32.load + (local.tee $1 + (i32.add + (local.get $4) + (i32.const 12) + ) + ) ) + (local.get $8) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $3 + (i32.add + (local.get $0) + (i32.const 8) + ) + ) + ) + (local.get $8) + ) + (then + (block + (i32.store + (local.get $1) + (local.get $0) + ) + (i32.store + (local.get $3) + (local.get $4) + ) + (local.set $9 + (local.get $0) + ) + ) + ) + (else + (call $_abort) ) ) - (local.get $8) - ) - (i32.store - (local.get $0) - (local.get $9) - ) - (i32.store offset=20 - (local.get $6) - (local.get $9) - ) - ) - (br_if $do-once4 - (i32.eqz - (local.get $9) ) ) ) ) (if - (i32.lt_u - (local.get $9) - (local.tee $3 - (i32.load - (i32.const 192) - ) - ) - ) - (call $_abort) - ) - (i32.store offset=24 - (local.get $9) (local.get $6) - ) - (if - (local.tee $1 - (i32.load - (local.tee $0 - (i32.add + (then + (block + (if + (i32.eq (local.get $8) - (i32.const 16) + (i32.load + (local.tee $0 + (i32.add + (i32.shl + (local.tee $3 + (i32.load offset=28 + (local.get $8) + ) + ) + (i32.const 2) + ) + (i32.const 480) + ) + ) + ) + ) + (then + (block + (i32.store + (local.get $0) + (local.get $9) + ) + (if + (i32.eqz + (local.get $9) + ) + (then + (block + (i32.store + (i32.const 180) + (i32.and + (i32.load + (i32.const 180) + ) + (i32.xor + (i32.shl + (i32.const 1) + (local.get $3) + ) + (i32.const -1) + ) + ) + ) + (br $do-once4) + ) + ) + ) + ) + ) + (else + (block + (if + (i32.lt_u + (local.get $6) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + ) + (if + (i32.eq + (i32.load + (local.tee $0 + (i32.add + (local.get $6) + (i32.const 16) + ) + ) + ) + (local.get $8) + ) + (then + (i32.store + (local.get $0) + (local.get $9) + ) + ) + (else + (i32.store offset=20 + (local.get $6) + (local.get $9) + ) + ) + ) + (br_if $do-once4 + (i32.eqz + (local.get $9) + ) + ) + ) ) ) - ) - ) - (if - (i32.lt_u - (local.get $1) - (local.get $3) - ) - (call $_abort) - (block - (i32.store offset=16 - (local.get $9) - (local.get $1) + (if + (i32.lt_u + (local.get $9) + (local.tee $3 + (i32.load + (i32.const 192) + ) + ) + ) + (then + (call $_abort) + ) ) (i32.store offset=24 - (local.get $1) (local.get $9) + (local.get $6) ) - ) - ) - ) - (if - (local.tee $0 - (i32.load offset=4 - (local.get $0) - ) - ) - (if - (i32.lt_u - (local.get $0) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (i32.store offset=20 - (local.get $9) - (local.get $0) + (if + (local.tee $1 + (i32.load + (local.tee $0 + (i32.add + (local.get $8) + (i32.const 16) + ) + ) + ) + ) + (then + (if + (i32.lt_u + (local.get $1) + (local.get $3) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=16 + (local.get $9) + (local.get $1) + ) + (i32.store offset=24 + (local.get $1) + (local.get $9) + ) + ) + ) + ) + ) ) - (i32.store offset=24 - (local.get $0) - (local.get $9) + (if + (local.tee $0 + (i32.load offset=4 + (local.get $0) + ) + ) + (then + (if + (i32.lt_u + (local.get $0) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (i32.store offset=20 + (local.get $9) + (local.get $0) + ) + (i32.store offset=24 + (local.get $0) + (local.get $9) + ) + ) + ) + ) + ) ) ) ) @@ -29348,38 +31120,42 @@ ) ) ) - ) - (i32.store offset=4 - (local.get $2) - (i32.or - (local.get $5) - (i32.const 1) - ) - ) - (i32.store - (i32.add - (local.get $2) - (local.get $5) - ) - (local.get $5) - ) - (if - (i32.eq + (i32.store offset=4 (local.get $2) - (i32.load - (i32.const 196) + (i32.or + (local.get $5) + (i32.const 1) ) ) - (block - (i32.store - (i32.const 184) + (i32.store + (i32.add + (local.get $2) (local.get $5) ) - (return) - ) - (local.set $3 (local.get $5) ) + (if + (i32.eq + (local.get $2) + (i32.load + (i32.const 196) + ) + ) + (then + (block + (i32.store + (i32.const 184) + (local.get $5) + ) + (return) + ) + ) + (else + (local.set $3 + (local.get $5) + ) + ) + ) ) ) ) @@ -29394,92 +31170,102 @@ (local.get $3) (i32.const 256) ) - (block - (local.set $1 - (i32.add - (i32.shl - (local.get $0) - (i32.const 3) - ) - (i32.const 216) - ) - ) - (if - (i32.and - (local.tee $3 - (i32.load - (i32.const 176) - ) - ) - (local.tee $0 + (then + (block + (local.set $1 + (i32.add (i32.shl - (i32.const 1) (local.get $0) + (i32.const 3) ) + (i32.const 216) ) ) (if - (i32.lt_u - (local.tee $0 + (i32.and + (local.tee $3 (i32.load - (local.tee $3 - (i32.add - (local.get $1) - (i32.const 8) - ) - ) + (i32.const 176) ) ) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (local.set $15 - (local.get $3) - ) - (local.set $13 - (local.get $0) + (local.tee $0 + (i32.shl + (i32.const 1) + (local.get $0) + ) ) ) - ) - (block - (i32.store - (i32.const 176) - (i32.or - (local.get $3) - (local.get $0) + (then + (if + (i32.lt_u + (local.tee $0 + (i32.load + (local.tee $3 + (i32.add + (local.get $1) + (i32.const 8) + ) + ) + ) + ) + (i32.load + (i32.const 192) + ) + ) + (then + (call $_abort) + ) + (else + (block + (local.set $15 + (local.get $3) + ) + (local.set $13 + (local.get $0) + ) + ) + ) ) ) - (local.set $15 - (i32.add - (local.get $1) - (i32.const 8) + (else + (block + (i32.store + (i32.const 176) + (i32.or + (local.get $3) + (local.get $0) + ) + ) + (local.set $15 + (i32.add + (local.get $1) + (i32.const 8) + ) + ) + (local.set $13 + (local.get $1) + ) ) ) - (local.set $13 - (local.get $1) - ) ) + (i32.store + (local.get $15) + (local.get $2) + ) + (i32.store offset=12 + (local.get $13) + (local.get $2) + ) + (i32.store offset=8 + (local.get $2) + (local.get $13) + ) + (i32.store offset=12 + (local.get $2) + (local.get $1) + ) + (return) ) - (i32.store - (local.get $15) - (local.get $2) - ) - (i32.store offset=12 - (local.get $13) - (local.get $2) - ) - (i32.store offset=8 - (local.get $2) - (local.get $13) - ) - (i32.store offset=12 - (local.get $2) - (local.get $1) - ) - (return) ) ) (local.set $4 @@ -29493,93 +31279,101 @@ (i32.const 8) ) ) - (if (result i32) - (i32.gt_u - (local.get $3) - (i32.const 16777215) - ) - (i32.const 31) - (i32.or - (i32.and - (i32.shr_u - (local.get $3) - (i32.add - (local.tee $0 + (then + (if (result i32) + (i32.gt_u + (local.get $3) + (i32.const 16777215) + ) + (then + (i32.const 31) + ) + (else + (i32.or + (i32.and + (i32.shr_u + (local.get $3) (i32.add - (i32.sub - (i32.const 14) - (i32.or - (i32.or - (local.tee $0 - (i32.and - (i32.shr_u - (i32.add - (local.tee $1 - (i32.shl - (local.get $0) - (local.tee $4 - (i32.and - (i32.shr_u - (i32.add - (local.get $0) - (i32.const 1048320) + (local.tee $0 + (i32.add + (i32.sub + (i32.const 14) + (i32.or + (i32.or + (local.tee $0 + (i32.and + (i32.shr_u + (i32.add + (local.tee $1 + (i32.shl + (local.get $0) + (local.tee $4 + (i32.and + (i32.shr_u + (i32.add + (local.get $0) + (i32.const 1048320) + ) + (i32.const 16) + ) + (i32.const 8) ) - (i32.const 16) ) - (i32.const 8) ) ) + (i32.const 520192) ) + (i32.const 16) ) - (i32.const 520192) + (i32.const 4) ) - (i32.const 16) ) - (i32.const 4) + (local.get $4) ) - ) - (local.get $4) - ) - (local.tee $0 - (i32.and - (i32.shr_u - (i32.add - (local.tee $1 - (i32.shl - (local.get $1) - (local.get $0) + (local.tee $0 + (i32.and + (i32.shr_u + (i32.add + (local.tee $1 + (i32.shl + (local.get $1) + (local.get $0) + ) + ) + (i32.const 245760) ) + (i32.const 16) ) - (i32.const 245760) + (i32.const 2) ) - (i32.const 16) ) - (i32.const 2) ) ) + (i32.shr_u + (i32.shl + (local.get $1) + (local.get $0) + ) + (i32.const 15) + ) ) ) - (i32.shr_u - (i32.shl - (local.get $1) - (local.get $0) - ) - (i32.const 15) - ) + (i32.const 7) ) ) - (i32.const 7) + (i32.const 1) + ) + (i32.shl + (local.get $0) + (i32.const 1) ) ) - (i32.const 1) - ) - (i32.shl - (local.get $0) - (i32.const 1) ) ) ) - (i32.const 0) + (else + (i32.const 0) + ) ) ) (i32.const 2) @@ -29614,185 +31408,199 @@ ) ) ) - (block - (local.set $5 - (i32.shl - (local.get $3) - (select - (i32.const 0) - (i32.sub - (i32.const 25) - (i32.shr_u + (then + (block + (local.set $5 + (i32.shl + (local.get $3) + (select + (i32.const 0) + (i32.sub + (i32.const 25) + (i32.shr_u + (local.get $5) + (i32.const 1) + ) + ) + (i32.eq (local.get $5) - (i32.const 1) + (i32.const 31) ) ) - (i32.eq - (local.get $5) - (i32.const 31) - ) ) ) - ) - (local.set $0 - (i32.load - (local.get $4) + (local.set $0 + (i32.load + (local.get $4) + ) ) - ) - (block $__rjto$1 - (block $__rjti$1 - (loop $while-in15 - (br_if $__rjti$1 - (i32.eq - (i32.and - (i32.load offset=4 - (local.get $0) + (block $__rjto$1 + (block $__rjti$1 + (loop $while-in15 + (br_if $__rjti$1 + (i32.eq + (i32.and + (i32.load offset=4 + (local.get $0) + ) + (i32.const -8) ) - (i32.const -8) + (local.get $3) ) - (local.get $3) ) - ) - (local.set $4 - (i32.shl - (local.get $5) - (i32.const 1) + (local.set $4 + (i32.shl + (local.get $5) + (i32.const 1) + ) ) - ) - (if - (local.tee $1 - (i32.load - (local.tee $5 - (i32.add + (if + (local.tee $1 + (i32.load + (local.tee $5 (i32.add - (local.get $0) - (i32.const 16) - ) - (i32.shl - (i32.shr_u - (local.get $5) - (i32.const 31) + (i32.add + (local.get $0) + (i32.const 16) + ) + (i32.shl + (i32.shr_u + (local.get $5) + (i32.const 31) + ) + (i32.const 2) ) - (i32.const 2) ) ) ) ) - ) - (block - (local.set $5 - (local.get $4) - ) - (local.set $0 - (local.get $1) + (then + (block + (local.set $5 + (local.get $4) + ) + (local.set $0 + (local.get $1) + ) + (br $while-in15) + ) ) - (br $while-in15) ) ) - ) - (if - (i32.lt_u - (local.get $5) - (i32.load - (i32.const 192) - ) - ) - (call $_abort) - (block - (i32.store + (if + (i32.lt_u (local.get $5) - (local.get $2) - ) - (i32.store offset=24 - (local.get $2) - (local.get $0) + (i32.load + (i32.const 192) + ) ) - (i32.store offset=12 - (local.get $2) - (local.get $2) + (then + (call $_abort) ) - (i32.store offset=8 - (local.get $2) - (local.get $2) + (else + (block + (i32.store + (local.get $5) + (local.get $2) + ) + (i32.store offset=24 + (local.get $2) + (local.get $0) + ) + (i32.store offset=12 + (local.get $2) + (local.get $2) + ) + (i32.store offset=8 + (local.get $2) + (local.get $2) + ) + (br $do-once12) + ) ) - (br $do-once12) ) + (br $__rjto$1) ) - (br $__rjto$1) - ) - (if - (i32.and - (i32.ge_u - (local.tee $4 - (i32.load - (local.tee $1 - (i32.add - (local.get $0) - (i32.const 8) + (if + (i32.and + (i32.ge_u + (local.tee $4 + (i32.load + (local.tee $1 + (i32.add + (local.get $0) + (i32.const 8) + ) ) ) ) - ) - (local.tee $3 - (i32.load - (i32.const 192) + (local.tee $3 + (i32.load + (i32.const 192) + ) ) ) + (i32.ge_u + (local.get $0) + (local.get $3) + ) ) - (i32.ge_u - (local.get $0) - (local.get $3) - ) - ) - (block - (i32.store offset=12 - (local.get $4) - (local.get $2) - ) - (i32.store - (local.get $1) - (local.get $2) - ) - (i32.store offset=8 - (local.get $2) - (local.get $4) - ) - (i32.store offset=12 - (local.get $2) - (local.get $0) + (then + (block + (i32.store offset=12 + (local.get $4) + (local.get $2) + ) + (i32.store + (local.get $1) + (local.get $2) + ) + (i32.store offset=8 + (local.get $2) + (local.get $4) + ) + (i32.store offset=12 + (local.get $2) + (local.get $0) + ) + (i32.store offset=24 + (local.get $2) + (i32.const 0) + ) + ) ) - (i32.store offset=24 - (local.get $2) - (i32.const 0) + (else + (call $_abort) ) ) - (call $_abort) ) ) ) - (block - (i32.store - (i32.const 180) - (i32.or - (local.get $1) - (local.get $0) + (else + (block + (i32.store + (i32.const 180) + (i32.or + (local.get $1) + (local.get $0) + ) + ) + (i32.store + (local.get $4) + (local.get $2) + ) + (i32.store offset=24 + (local.get $2) + (local.get $4) + ) + (i32.store offset=12 + (local.get $2) + (local.get $2) + ) + (i32.store offset=8 + (local.get $2) + (local.get $2) ) - ) - (i32.store - (local.get $4) - (local.get $2) - ) - (i32.store offset=24 - (local.get $2) - (local.get $4) - ) - (i32.store offset=12 - (local.get $2) - (local.get $2) - ) - (i32.store offset=8 - (local.get $2) - (local.get $2) ) ) ) @@ -29810,9 +31618,13 @@ ) (if (local.get $0) - (return) - (local.set $0 - (i32.const 632) + (then + (return) + ) + (else + (local.set $0 + (i32.const 632) + ) ) ) (loop $while-in17 @@ -29934,7 +31746,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 20) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.get $1) @@ -29948,7 +31760,7 @@ ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $3 ;; CHECK-NEXT: (i32.sub ;; CHECK-NEXT: (i32.add @@ -29964,7 +31776,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store8 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -30014,7 +31826,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $3) @@ -30037,7 +31849,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store8 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (local.get $1) @@ -30072,98 +31884,106 @@ (local.get $2) (i32.const 20) ) - (block - (local.set $1 - (i32.and - (local.get $1) - (i32.const 255) - ) - ) - (if - (local.tee $3 + (then + (block + (local.set $1 (i32.and - (local.get $0) - (i32.const 3) + (local.get $1) + (i32.const 255) ) ) - (block - (local.set $3 - (i32.sub - (i32.add - (local.get $0) - (i32.const 4) - ) - (local.get $3) + (if + (local.tee $3 + (i32.and + (local.get $0) + (i32.const 3) ) ) - (loop $while-in - (if - (i32.lt_s - (local.get $0) - (local.get $3) - ) - (block - (i32.store8 - (local.get $0) - (local.get $1) - ) - (local.set $0 + (then + (block + (local.set $3 + (i32.sub (i32.add (local.get $0) - (i32.const 1) + (i32.const 4) + ) + (local.get $3) + ) + ) + (loop $while-in + (if + (i32.lt_s + (local.get $0) + (local.get $3) + ) + (then + (block + (i32.store8 + (local.get $0) + (local.get $1) + ) + (local.set $0 + (i32.add + (local.get $0) + (i32.const 1) + ) + ) + (br $while-in) + ) ) ) - (br $while-in) ) ) ) ) - ) - (local.set $3 - (i32.or + (local.set $3 (i32.or (i32.or - (local.get $1) + (i32.or + (local.get $1) + (i32.shl + (local.get $1) + (i32.const 8) + ) + ) (i32.shl (local.get $1) - (i32.const 8) + (i32.const 16) ) ) (i32.shl (local.get $1) - (i32.const 16) + (i32.const 24) ) ) - (i32.shl - (local.get $1) - (i32.const 24) - ) ) - ) - (local.set $5 - (i32.and - (local.get $4) - (i32.const -4) - ) - ) - (loop $while-in1 - (if - (i32.lt_s - (local.get $0) - (local.get $5) + (local.set $5 + (i32.and + (local.get $4) + (i32.const -4) ) - (block - (i32.store + ) + (loop $while-in1 + (if + (i32.lt_s (local.get $0) - (local.get $3) + (local.get $5) ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 4) + (then + (block + (i32.store + (local.get $0) + (local.get $3) + ) + (local.set $0 + (i32.add + (local.get $0) + (i32.const 4) + ) + ) + (br $while-in1) ) ) - (br $while-in1) ) ) ) @@ -30175,18 +31995,20 @@ (local.get $0) (local.get $4) ) - (block - (i32.store8 - (local.get $0) - (local.get $1) - ) - (local.set $0 - (i32.add + (then + (block + (i32.store8 (local.get $0) - (i32.const 1) + (local.get $1) ) + (local.set $0 + (i32.add + (local.get $0) + (i32.const 1) + ) + ) + (br $while-in3) ) - (br $while-in3) ) ) ) @@ -30201,7 +32023,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $tempRet0 ;; CHECK-NEXT: (i32.shr_u ;; CHECK-NEXT: (local.get $1) @@ -30251,33 +32073,35 @@ (local.get $2) (i32.const 32) ) - (block - (global.set $tempRet0 - (i32.shr_u - (local.get $1) - (local.get $2) - ) - ) - (return - (i32.or + (then + (block + (global.set $tempRet0 (i32.shr_u - (local.get $0) + (local.get $1) (local.get $2) ) - (i32.shl - (i32.and - (local.get $1) - (i32.sub - (i32.shl + ) + (return + (i32.or + (i32.shr_u + (local.get $0) + (local.get $2) + ) + (i32.shl + (i32.and + (local.get $1) + (i32.sub + (i32.shl + (i32.const 1) + (local.get $2) + ) (i32.const 1) - (local.get $2) ) - (i32.const 1) ) - ) - (i32.sub - (i32.const 32) - (local.get $2) + (i32.sub + (i32.const 32) + (local.get $2) + ) ) ) ) @@ -30301,7 +32125,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 32) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $tempRet0 ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (i32.shl @@ -30357,41 +32181,43 @@ (local.get $2) (i32.const 32) ) - (block - (global.set $tempRet0 - (i32.or - (i32.shl - (local.get $1) - (local.get $2) - ) - (i32.shr_u - (i32.and - (local.get $0) - (i32.shl - (i32.sub - (i32.shl + (then + (block + (global.set $tempRet0 + (i32.or + (i32.shl + (local.get $1) + (local.get $2) + ) + (i32.shr_u + (i32.and + (local.get $0) + (i32.shl + (i32.sub + (i32.shl + (i32.const 1) + (local.get $2) + ) (i32.const 1) + ) + (i32.sub + (i32.const 32) (local.get $2) ) - (i32.const 1) - ) - (i32.sub - (i32.const 32) - (local.get $2) ) ) - ) - (i32.sub - (i32.const 32) - (local.get $2) + (i32.sub + (i32.const 32) + (local.get $2) + ) ) ) ) - ) - (return - (i32.shl - (local.get $0) - (local.get $2) + (return + (i32.shl + (local.get $0) + (local.get $2) + ) ) ) ) @@ -30414,11 +32240,13 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 4096) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (call $_emscripten_memcpy_big - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (call $_emscripten_memcpy_big + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -30436,20 +32264,22 @@ ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (loop $while-in ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.and ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.store8 @@ -30486,7 +32316,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.load @@ -30523,7 +32353,7 @@ ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store8 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.load8_s @@ -30561,11 +32391,13 @@ (local.get $2) (i32.const 4096) ) - (return - (call $_emscripten_memcpy_big - (local.get $0) - (local.get $1) - (local.get $2) + (then + (return + (call $_emscripten_memcpy_big + (local.get $0) + (local.get $1) + (local.get $2) + ) ) ) ) @@ -30583,82 +32415,90 @@ (i32.const 3) ) ) - (block - (loop $while-in - (if - (i32.and - (local.get $0) - (i32.const 3) - ) - (block - (if - (i32.eqz - (local.get $2) - ) - (return - (local.get $3) - ) - ) - (i32.store8 + (then + (block + (loop $while-in + (if + (i32.and (local.get $0) - (i32.load8_s - (local.get $1) - ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 1) - ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 1) - ) + (i32.const 3) ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 1) + (then + (block + (if + (i32.eqz + (local.get $2) + ) + (then + (return + (local.get $3) + ) + ) + ) + (i32.store8 + (local.get $0) + (i32.load8_s + (local.get $1) + ) + ) + (local.set $0 + (i32.add + (local.get $0) + (i32.const 1) + ) + ) + (local.set $1 + (i32.add + (local.get $1) + (i32.const 1) + ) + ) + (local.set $2 + (i32.sub + (local.get $2) + (i32.const 1) + ) + ) + (br $while-in) ) ) - (br $while-in) ) ) - ) - (loop $while-in1 - (if - (i32.ge_s - (local.get $2) - (i32.const 4) - ) - (block - (i32.store - (local.get $0) - (i32.load - (local.get $1) - ) - ) - (local.set $0 - (i32.add - (local.get $0) - (i32.const 4) - ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 4) - ) + (loop $while-in1 + (if + (i32.ge_s + (local.get $2) + (i32.const 4) ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 4) + (then + (block + (i32.store + (local.get $0) + (i32.load + (local.get $1) + ) + ) + (local.set $0 + (i32.add + (local.get $0) + (i32.const 4) + ) + ) + (local.set $1 + (i32.add + (local.get $1) + (i32.const 4) + ) + ) + (local.set $2 + (i32.sub + (local.get $2) + (i32.const 4) + ) + ) + (br $while-in1) ) ) - (br $while-in1) ) ) ) @@ -30670,32 +32510,34 @@ (local.get $2) (i32.const 0) ) - (block - (i32.store8 - (local.get $0) - (i32.load8_s - (local.get $1) - ) - ) - (local.set $0 - (i32.add + (then + (block + (i32.store8 (local.get $0) - (i32.const 1) + (i32.load8_s + (local.get $1) + ) ) - ) - (local.set $1 - (i32.add - (local.get $1) - (i32.const 1) + (local.set $0 + (i32.add + (local.get $0) + (i32.const 1) + ) ) - ) - (local.set $2 - (i32.sub - (local.get $2) - (i32.const 1) + (local.set $1 + (i32.add + (local.get $1) + (i32.const 1) + ) ) + (local.set $2 + (i32.sub + (local.get $2) + (i32.const 1) + ) + ) + (br $while-in3) ) - (br $while-in3) ) ) ) @@ -30809,11 +32651,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $r) - ;; CHECK-NEXT: (i64.store - ;; CHECK-NEXT: (local.get $r) - ;; CHECK-NEXT: (i64.rem_u - ;; CHECK-NEXT: (local.get $x64) - ;; CHECK-NEXT: (local.get $y64) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i64.store + ;; CHECK-NEXT: (local.get $r) + ;; CHECK-NEXT: (i64.rem_u + ;; CHECK-NEXT: (local.get $x64) + ;; CHECK-NEXT: (local.get $y64) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -30866,11 +32710,13 @@ ) (if (local.get $r) - (i64.store - (local.get $r) - (i64.rem_u - (local.get $x64) - (local.get $y64) + (then + (i64.store + (local.get $r) + (i64.rem_u + (local.get $x64) + (local.get $y64) + ) ) ) ) diff --git a/test/lit/passes/inlining_enable-tail-call.wast b/test/lit/passes/inlining_enable-tail-call.wast index ff1a9efbf..d2d7772cd 100644 --- a/test/lit/passes/inlining_enable-tail-call.wast +++ b/test/lit/passes/inlining_enable-tail-call.wast @@ -294,8 +294,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $hangLimit) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 54) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 54) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $hangLimit @@ -308,27 +310,35 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (block (result i32) - ;; CHECK-NEXT: (block $__inlined_func$func_3 (result i32) - ;; CHECK-NEXT: (local.set $8 - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (select - ;; CHECK-NEXT: (local.get $8) - ;; CHECK-NEXT: (local.tee $8 - ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (block $__inlined_func$func_3 (result i32) + ;; CHECK-NEXT: (local.set $8 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (select + ;; CHECK-NEXT: (local.get $8) + ;; CHECK-NEXT: (local.tee $8 + ;; CHECK-NEXT: (i32.const -1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $label$0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label$0) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -346,8 +356,10 @@ (i32.eqz (global.get $hangLimit) ) - (return - (i32.const 54) + (then + (return + (i32.const 54) + ) ) ) (global.set $hangLimit @@ -360,14 +372,22 @@ (i32.eqz (if (result i32) (i32.const 1) - (if (result i32) - (i32.eqz - (call $func_3) + (then + (if (result i32) + (i32.eqz + (call $func_3) + ) + (then + (br $label$0) + ) + (else + (i32.const 0) + ) ) - (br $label$0) - (i32.const 0) ) - (unreachable) + (else + (unreachable) + ) ) ) ) @@ -396,8 +416,12 @@ ;; CHECK-NEXT: (call_indirect (type $T) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -410,8 +434,12 @@ (call_indirect (type $T) (if (result i32) ;; if copy must preserve the forced type (i32.const 0) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) (i32.const 1) ) @@ -653,7 +681,9 @@ (func $2 (; 2 ;) (type $6) (if (global.get $global$0) - (return) + (then + (return) + ) ) (global.set $global$0 (i32.const 1) @@ -662,7 +692,9 @@ (func $13 (; 13 ;) (type $6) (if (global.get $global$0) - (unreachable) + (then + (unreachable) + ) ) (return_call $2) ) @@ -673,7 +705,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global$0) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block @@ -681,7 +715,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global$0) - ;; CHECK-NEXT: (br $__inlined_func$2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $global$0 ;; CHECK-NEXT: (i32.const 1) @@ -714,26 +750,34 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $i) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (block $__inlined_func$is_odd (result i32) - ;; CHECK-NEXT: (local.set $1 - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $i) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return_call $is_even + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (block $__inlined_func$is_odd (result i32) + ;; CHECK-NEXT: (local.set $1 ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $i) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (return_call $is_even + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -742,11 +786,15 @@ (func $is_even (param $i i32) (result i32) (if (result i32) (i32.eqz (local.get $i)) - (i32.const 1) - (return_call $is_odd - (i32.sub - (local.get $i) - (i32.const 1) + (then + (i32.const 1) + ) + (else + (return_call $is_odd + (i32.sub + (local.get $i) + (i32.const 1) + ) ) ) ) @@ -754,11 +802,15 @@ (func $is_odd (param $i i32) (result i32) (if (result i32) (i32.eqz (local.get $i)) - (i32.const 0) - (return_call $is_even - (i32.sub - (local.get $i) - (i32.const 1) + (then + (i32.const 0) + ) + (else + (return_call $is_even + (i32.sub + (local.get $i) + (i32.const 1) + ) ) ) ) diff --git a/test/lit/passes/inlining_splitting.wast b/test/lit/passes/inlining_splitting.wast index 145a69016..b34f74cf4 100644 --- a/test/lit/passes/inlining_splitting.wast +++ b/test/lit/passes/inlining_splitting.wast @@ -38,7 +38,9 @@ ;; the rest will be outlined into a new function with suffix "outlined". (if (local.get $x) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -59,8 +61,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$maybe-work-hard - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$maybe-work-hard + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -74,8 +78,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$maybe-work-hard - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$maybe-work-hard + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -89,8 +95,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$maybe-work-hard - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$maybe-work-hard + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -113,10 +121,12 @@ ;; As above, but all we have is an if. (if (local.get $x) - (loop $l - (call $import) - (br_if $l - (local.get $x) + (then + (loop $l + (call $import) + (br_if $l + (local.get $x) + ) ) ) ) @@ -132,8 +142,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (call $byn-split-outlined-B$just-if - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-B$just-if + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -145,8 +157,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (call $byn-split-outlined-B$just-if - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-B$just-if + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -161,10 +175,16 @@ ;; CHECK-NEXT: (block $toplevel ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (br $toplevel) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $toplevel) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -173,13 +193,19 @@ (block $toplevel (if (local.get $x) - (block - (if - (local.get $x) - ;; A br to the toplevel block prevents us from outlining this code, - ;; as we can't outline a br without its target. - (br $toplevel) - (call $import) + (then + (block + (if + (local.get $x) + ;; A br to the toplevel block prevents us from outlining this code, + ;; as we can't outline a br without its target. + (then + (br $toplevel) + ) + (else + (call $import) + ) + ) ) ) ) @@ -203,7 +229,9 @@ ;; We can inline despite the non-initial, non-defaultable param. (if (local.get $x) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -224,7 +252,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (br $__inlined_func$nondefaultable-param$5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$nondefaultable-param$5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $l ;; CHECK-NEXT: (call $import) @@ -243,7 +273,9 @@ ;; condition. (if (local.get $y) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -273,10 +305,12 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$many-params - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$many-params + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -296,10 +330,12 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $4) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$many-params - ;; CHECK-NEXT: (local.get $3) - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$many-params + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -321,7 +357,9 @@ (i32.eqz (local.get $x) ) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -343,8 +381,10 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-eqz - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-eqz + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -360,8 +400,10 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-eqz - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-eqz + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -376,7 +418,9 @@ (if ;; A global read, also worth splitting. (global.get $glob) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -391,7 +435,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $glob) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-global) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-global) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -401,7 +447,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $glob) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-global) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-global) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -417,7 +465,9 @@ (ref.is_null (local.get $x) ) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -439,8 +489,10 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-ref.is - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-ref.is + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -456,8 +508,10 @@ ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-ref.is - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$condition-ref.is + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -474,7 +528,9 @@ ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $l ;; CHECK-NEXT: (call $import) @@ -488,7 +544,9 @@ (local.get $x) (local.get $x) ) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -514,7 +572,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $l ;; CHECK-NEXT: (call $import) @@ -527,7 +587,9 @@ (i32.eqz (unreachable) ) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -551,7 +613,9 @@ ;; CHECK: (func $start-used-globally (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $glob) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $l ;; CHECK-NEXT: (call $import) @@ -565,7 +629,9 @@ ;; it). (if (global.get $glob) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -580,7 +646,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $glob) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$start-used-globally) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$start-used-globally) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -590,7 +658,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $glob) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$start-used-globally) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$start-used-globally) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -606,7 +676,9 @@ ;; that is split out. (if (global.get $glob) - (return) + (then + (return) + ) ) ) @@ -615,7 +687,9 @@ ;; CHECK-NEXT: (block $__inlined_func$inlineable$16 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $glob) - ;; CHECK-NEXT: (br $__inlined_func$inlineable$16) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$inlineable$16) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -623,7 +697,9 @@ ;; CHECK-NEXT: (block $__inlined_func$inlineable$17 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $glob) - ;; CHECK-NEXT: (br $__inlined_func$inlineable$17) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$inlineable$17) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -637,7 +713,9 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $l ;; CHECK-NEXT: (call $import) @@ -650,7 +728,9 @@ (nop) (if (local.get $x) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -674,8 +754,12 @@ ;; CHECK: (func $if-else (type $1) (param $x i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (return) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $l ;; CHECK-NEXT: (call $import) @@ -686,8 +770,12 @@ ;; An else in the if prevents us from recognizing the pattern we want. (if (local.get $x) - (return) - (nop) + (then + (return) + ) + (else + (nop) + ) ) (loop $l (call $import) @@ -711,7 +799,9 @@ ;; CHECK: (func $if-non-return (type $1) (param $x i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (loop $l ;; CHECK-NEXT: (call $import) @@ -722,7 +812,9 @@ ;; Something other than a return in the if body prevents us from outlining. (if (local.get $x) - (unreachable) + (then + (unreachable) + ) ) (loop $l (call $import) @@ -748,7 +840,9 @@ ;; function after us. (if (local.get $x) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -768,8 +862,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$colliding-name_67 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$colliding-name_67 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -783,8 +879,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$colliding-name_67 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$colliding-name_67 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -817,9 +915,11 @@ (ref.is_null (local.get $x) ) - (block - (call $import) - (unreachable) + (then + (block + (call $import) + (unreachable) + ) ) ) (local.get $x) @@ -839,9 +939,11 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$error-if-null$20 - ;; CHECK-NEXT: (call $byn-split-outlined-B$error-if-null - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$error-if-null$20 + ;; CHECK-NEXT: (call $byn-split-outlined-B$error-if-null + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -861,9 +963,11 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$error-if-null$21 - ;; CHECK-NEXT: (call $byn-split-outlined-B$error-if-null - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$error-if-null$21 + ;; CHECK-NEXT: (call $byn-split-outlined-B$error-if-null + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -883,7 +987,7 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -896,9 +1000,11 @@ (ref.is_null (local.get $x) ) - (block - (call $import) - (unreachable) + (then + (block + (call $import) + (unreachable) + ) ) ) (nop) ;; An extra operation here prevents us from identifying the pattern. @@ -927,7 +1033,7 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) @@ -939,9 +1045,11 @@ (ref.is_null (local.get $x) ) - (block - (call $import) - (unreachable) + (then + (block + (call $import) + (unreachable) + ) ) ) (unreachable) ;; This prevents us from optimizing @@ -972,11 +1080,13 @@ ;; It is ok if the body is not unreachable (so long as it contains no ;; returns). We will optimize this, and just do a call to the outlined ;; code, without a return of a value here. - (block - ;; We need to have a loop here to avoid normal inlining from kicking in - ;; on the outlined code. - (loop $loop - (call $import) + (then + (block + ;; We need to have a loop here to avoid normal inlining from kicking in + ;; on the outlined code. + (loop $loop + (call $import) + ) ) ) ) @@ -997,8 +1107,10 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-B$reachable-if-body - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-B$reachable-if-body + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $0) @@ -1017,8 +1129,10 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-B$reachable-if-body - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-B$reachable-if-body + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) @@ -1038,7 +1152,9 @@ (ref.is_null (local.get $x) ) - (call $import) + (then + (call $import) + ) ) (local.get $x) ) @@ -1057,7 +1173,9 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -1075,7 +1193,9 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) @@ -1096,12 +1216,18 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $x) @@ -1111,13 +1237,19 @@ (ref.is_null (local.get $x) ) - (if - (i32.const 1) - ;; The return here prevents the optimization. - (return - (local.get $x) + (then + (if + (i32.const 1) + ;; The return here prevents the optimization. + (then + (return + (local.get $x) + ) + ) + (else + (call $import) + ) ) - (call $import) ) ) (local.get $x) @@ -1147,9 +1279,11 @@ ) ;; The if body is unreachable, but the function has no returned value. ;; When we outline this code, we should not try to return a value. - (block - (call $import) - (unreachable) + (then + (block + (call $import) + (unreachable) + ) ) ) ) @@ -1166,8 +1300,10 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-B$unreachable-if-body-no-result - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-B$unreachable-if-body-no-result + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1181,8 +1317,10 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-B$unreachable-if-body-no-result - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-B$unreachable-if-body-no-result + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1198,17 +1336,21 @@ (ref.is_null (local.get $x) ) - (call $import) + (then + (call $import) + ) ) ;; A second if. We can outline both if bodies. (if (ref.is_null (local.get $x) ) - (loop $x - (call $import) - (br_if $x - (global.get $glob) + (then + (loop $x + (call $import) + (br_if $x + (global.get $glob) + ) ) ) ) @@ -1231,19 +1373,23 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-B$multi-if$30 - ;; CHECK-NEXT: (local.set $2 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-B$multi-if$30 + ;; CHECK-NEXT: (local.set $2 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-B$multi-if_76 - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-B$multi-if_76 + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $0) @@ -1262,19 +1408,23 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-B$multi-if$31 - ;; CHECK-NEXT: (local.set $3 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-B$multi-if$31 + ;; CHECK-NEXT: (local.set $3 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-B$multi-if_76 - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-B$multi-if_76 + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $1) @@ -1293,31 +1443,41 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $import) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -1327,31 +1487,41 @@ (ref.is_null (local.get $x) ) - (call $import) + (then + (call $import) + ) ) (if (ref.is_null (local.get $x) ) - (call $import) + (then + (call $import) + ) ) (if (ref.is_null (local.get $x) ) - (call $import) + (then + (call $import) + ) ) (if (ref.is_null (local.get $x) ) - (call $import) + (then + (call $import) + ) ) (if (ref.is_null (local.get $x) ) - (call $import) + (then + (call $import) + ) ) (local.get $x) ) @@ -1468,7 +1638,9 @@ ;; CHECK: (func $0 (type $none_=>_none) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global$0) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block $__inlined_func$1 @@ -1489,7 +1661,9 @@ ;; A function that is a good candidate to partially inline. (if (global.get $global$0) - (return) + (then + (return) + ) ) (call $1) (call $1) @@ -1501,37 +1675,43 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-A$0$3 - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $__inlined_func$byn-split-outlined-A$0$3 ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$1 - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block $__inlined_func$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$4 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (global.get $global$0) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$4 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (global.get $global$0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$1$1 - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block $__inlined_func$1$1 ;; CHECK-NEXT: (block ;; CHECK-NEXT: (block - ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$5 - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (global.get $global$0) + ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (block $__inlined_func$byn-split-inlineable-A$0$5 + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (global.get $global$0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1668,7 +1848,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (call $byn-split-outlined-A$0_21) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (call $byn-split-outlined-A$0_21) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1684,7 +1866,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (call $byn-split-outlined-A$0_21) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (call $byn-split-outlined-A$0_21) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1703,7 +1887,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (call $byn-split-outlined-A$0_22) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (call $byn-split-outlined-A$0_22) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1719,7 +1905,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (call $byn-split-outlined-A$0_22) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (call $byn-split-outlined-A$0_22) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1752,7 +1940,9 @@ ;; case, to avoid wasted work. (if (local.get $x) - (return) + (then + (return) + ) ) ;; 6x3 = 18 items, close to the default size limit of 20. With the if, we ;; hit that limit and are too big. But if we did partial inlining then the @@ -1779,7 +1969,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (br $__inlined_func$middle-size-A) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$middle-size-A) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 0) @@ -1819,7 +2011,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (br $__inlined_func$middle-size-A$1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$middle-size-A$1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 0) @@ -1869,7 +2063,9 @@ ;; it. (if (local.get $x) - (return) + (then + (return) + ) ) ;; 6x4 = 24 items, which is more than the inlining limit. (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) @@ -1890,8 +2086,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$big-size-A - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$big-size-A + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1905,8 +2103,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $byn-split-outlined-A$big-size-A - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $byn-split-outlined-A$big-size-A + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1926,11 +2126,13 @@ ;; As above, but for pattern B and not A. (if (local.get $x) - (block - (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) - (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) - (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) - (unreachable) + (then + (block + (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) + (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) + (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) + (unreachable) + ) ) ) (local.get $x) @@ -1948,7 +2150,7 @@ ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -1993,7 +2195,7 @@ ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) @@ -2049,12 +2251,14 @@ ;; it. (if (local.get $x) - (block - (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) - (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) - (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) - (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) - (unreachable) + (then + (block + (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) + (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) + (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) + (drop (i32.const 0)) (drop (i32.const 0)) (drop (i32.const 0)) + (unreachable) + ) ) ) (local.get $x) @@ -2072,9 +2276,11 @@ ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$big-size-B$6 - ;; CHECK-NEXT: (call $byn-split-outlined-B$big-size-B - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$big-size-B$6 + ;; CHECK-NEXT: (call $byn-split-outlined-B$big-size-B + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2092,9 +2298,11 @@ ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$big-size-B$7 - ;; CHECK-NEXT: (call $byn-split-outlined-B$big-size-B - ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $__inlined_func$byn-split-inlineable-B$big-size-B$7 + ;; CHECK-NEXT: (call $byn-split-outlined-B$big-size-B + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/inlining_splitting_basics.wast b/test/lit/passes/inlining_splitting_basics.wast index 017e043a7..fe07a3926 100644 --- a/test/lit/passes/inlining_splitting_basics.wast +++ b/test/lit/passes/inlining_splitting_basics.wast @@ -33,7 +33,9 @@ ;; NORMAL_: (func $pattern-A (type $1) (param $x i32) ;; NORMAL_-NEXT: (if ;; NORMAL_-NEXT: (local.get $x) - ;; NORMAL_-NEXT: (return) + ;; NORMAL_-NEXT: (then + ;; NORMAL_-NEXT: (return) + ;; NORMAL_-NEXT: ) ;; NORMAL_-NEXT: ) ;; NORMAL_-NEXT: (loop $l ;; NORMAL_-NEXT: (call $import) @@ -43,7 +45,9 @@ (func $pattern-A (param $x i32) (if (local.get $x) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -71,8 +75,10 @@ ;; PARTIAL-NEXT: (i32.eqz ;; PARTIAL-NEXT: (local.get $0) ;; PARTIAL-NEXT: ) - ;; PARTIAL-NEXT: (call $byn-split-outlined-A$pattern-A - ;; PARTIAL-NEXT: (local.get $0) + ;; PARTIAL-NEXT: (then + ;; PARTIAL-NEXT: (call $byn-split-outlined-A$pattern-A + ;; PARTIAL-NEXT: (local.get $0) + ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) @@ -86,8 +92,10 @@ ;; PARTIAL-NEXT: (i32.eqz ;; PARTIAL-NEXT: (local.get $1) ;; PARTIAL-NEXT: ) - ;; PARTIAL-NEXT: (call $byn-split-outlined-A$pattern-A - ;; PARTIAL-NEXT: (local.get $1) + ;; PARTIAL-NEXT: (then + ;; PARTIAL-NEXT: (call $byn-split-outlined-A$pattern-A + ;; PARTIAL-NEXT: (local.get $1) + ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) @@ -109,7 +117,7 @@ ;; NORMAL_-NEXT: (i32.eqz ;; NORMAL_-NEXT: (local.get $x) ;; NORMAL_-NEXT: ) - ;; NORMAL_-NEXT: (block + ;; NORMAL_-NEXT: (then ;; NORMAL_-NEXT: (call $import) ;; NORMAL_-NEXT: (unreachable) ;; NORMAL_-NEXT: ) @@ -121,9 +129,11 @@ (i32.eqz (local.get $x) ) - (block - (call $import) - (unreachable) + (then + (block + (call $import) + (unreachable) + ) ) ) (local.get $x) @@ -155,9 +165,11 @@ ;; PARTIAL-NEXT: (i32.eqz ;; PARTIAL-NEXT: (local.get $0) ;; PARTIAL-NEXT: ) - ;; PARTIAL-NEXT: (br $__inlined_func$byn-split-inlineable-B$pattern-B$2 - ;; PARTIAL-NEXT: (call $byn-split-outlined-B$pattern-B - ;; PARTIAL-NEXT: (local.get $0) + ;; PARTIAL-NEXT: (then + ;; PARTIAL-NEXT: (br $__inlined_func$byn-split-inlineable-B$pattern-B$2 + ;; PARTIAL-NEXT: (call $byn-split-outlined-B$pattern-B + ;; PARTIAL-NEXT: (local.get $0) + ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) @@ -177,9 +189,11 @@ ;; PARTIAL-NEXT: (i32.eqz ;; PARTIAL-NEXT: (local.get $1) ;; PARTIAL-NEXT: ) - ;; PARTIAL-NEXT: (br $__inlined_func$byn-split-inlineable-B$pattern-B$3 - ;; PARTIAL-NEXT: (call $byn-split-outlined-B$pattern-B - ;; PARTIAL-NEXT: (local.get $1) + ;; PARTIAL-NEXT: (then + ;; PARTIAL-NEXT: (br $__inlined_func$byn-split-inlineable-B$pattern-B$3 + ;; PARTIAL-NEXT: (call $byn-split-outlined-B$pattern-B + ;; PARTIAL-NEXT: (local.get $1) + ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) ;; PARTIAL-NEXT: ) diff --git a/test/lit/passes/j2cl-inline.wast b/test/lit/passes/j2cl-inline.wast index 263be0726..9b6d4127b 100644 --- a/test/lit/passes/j2cl-inline.wast +++ b/test/lit/passes/j2cl-inline.wast @@ -24,7 +24,9 @@ ;; CHECK: (func $clinit-non-trivial_<once>_@Zoo (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $$class-initialized@Zoo) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $$class-initialized@Zoo ;; CHECK-NEXT: (i32.const 1) @@ -32,7 +34,9 @@ ;; CHECK-NEXT: ) (func $clinit-non-trivial_<once>_@Zoo (if (global.get $$class-initialized@Zoo) - (return) + (then + (return) + ) ) (global.set $$class-initialized@Zoo (i32.const 1)) ) diff --git a/test/lit/passes/local-cse.wast b/test/lit/passes/local-cse.wast index c0e4c9b59..c38ca243a 100644 --- a/test/lit/passes/local-cse.wast +++ b/test/lit/passes/local-cse.wast @@ -31,7 +31,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.add @@ -77,7 +79,7 @@ (drop (i32.add (i32.const 1) (i32.const 2)) ) - (if (i32.const 0) (nop)) + (if (i32.const 0) (then (nop))) ;; This add is after an if, which means we are no longer in the same basic ;; block - which means we cannot optimize it with the previous identical ;; adds. @@ -399,13 +401,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -420,17 +426,21 @@ (if (i32.const 0) ;; This add is dominated by the above, so we can use a tee of it. - (drop - (i32.add - (i32.const 2) - (i32.const 3) + (then + (drop + (i32.add + (i32.const 2) + (i32.const 3) + ) ) ) ;; We could optimize this add as well, but do not yet. TODO - (drop - (i32.add - (i32.const 2) - (i32.const 3) + (else + (drop + (i32.add + (i32.const 2) + (i32.const 3) + ) ) ) ) diff --git a/test/lit/passes/local-subtyping-nn.wast b/test/lit/passes/local-subtyping-nn.wast index 04cade7e0..3754230d8 100644 --- a/test/lit/passes/local-subtyping-nn.wast +++ b/test/lit/passes/local-subtyping-nn.wast @@ -44,9 +44,11 @@ ;; CHECK-NEXT: (local $x nullref) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $i) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (ref.as_non_null - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (ref.as_non_null + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -59,8 +61,10 @@ (if (local.get $i) ;; The only set to this local uses a non-nullable type. - (local.set $x - (ref.as_non_null (ref.null $struct)) + (then + (local.set $x + (ref.as_non_null (ref.null $struct)) + ) ) ) (drop diff --git a/test/lit/passes/local-subtyping.wast b/test/lit/passes/local-subtyping.wast index 17ad5dc13..74f9d53a8 100644 --- a/test/lit/passes/local-subtyping.wast +++ b/test/lit/passes/local-subtyping.wast @@ -30,11 +30,15 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result (ref i31)) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (ref.i31 - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (ref.i31 + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (ref.i31 - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (ref.i31 + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -55,8 +59,12 @@ (drop (if (result anyref) (local.get $x) - (ref.i31 (i32.const 0)) - (ref.i31 (i32.const 1)) + (then + (ref.i31 (i32.const 0)) + ) + (else + (ref.i31 (i32.const 1)) + ) ) ) (drop @@ -324,8 +332,10 @@ ;; CHECK-NEXT: (local $x (ref null $2)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $i) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (ref.func $uses-default) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (ref.func $uses-default) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -337,7 +347,9 @@ (if (local.get $i) ;; The only set to this local uses a more specific type than funcref. - (local.set $x (ref.func $uses-default)) + (then + (local.set $x (ref.func $uses-default)) + ) ) (drop ;; This get may use the default value, but it is ok to have a null of a @@ -472,8 +484,10 @@ ;; CHECK-NEXT: (local $x (ref null $0)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (ref.func $become-non-nullable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (ref.func $become-non-nullable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -487,8 +501,10 @@ ;; though.) (if (i32.const 1) - (local.set $x - (ref.func $become-non-nullable) + (then + (local.set $x + (ref.func $become-non-nullable) + ) ) ) (drop diff --git a/test/lit/passes/memory-packing_all-features.wast b/test/lit/passes/memory-packing_all-features.wast index 1f0886d66..cf6c2aeef 100644 --- a/test/lit/passes/memory-packing_all-features.wast +++ b/test/lit/passes/memory-packing_all-features.wast @@ -118,7 +118,9 @@ ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) @@ -186,7 +188,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i32.const 0) @@ -511,7 +515,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_1) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i32.const 0) @@ -573,7 +579,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_2) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i32.const 0) @@ -624,7 +632,9 @@ ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) @@ -763,7 +773,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (local.get $0) @@ -881,7 +893,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_2) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i32.const 0) @@ -993,7 +1007,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_3) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i32.const 0) @@ -1055,7 +1071,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_4) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i32.const 0) @@ -1112,7 +1130,9 @@ ;; CHECK-NEXT: (block ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_5) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i32.const 0) @@ -1175,7 +1195,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_6) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_6 @@ -1209,7 +1231,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $zero-size-undropped @@ -1312,7 +1336,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_8) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_8 @@ -1380,7 +1406,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.get $__mem_segment_drop_state) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (global.set $__mem_segment_drop_state @@ -1414,7 +1442,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_1 @@ -1448,7 +1478,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_2 @@ -1481,7 +1513,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.get $__mem_segment_drop_state_3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (block ;; CHECK-NEXT: (global.set $__mem_segment_drop_state_3 @@ -2234,7 +2268,9 @@ ;; CHECK: (func $0 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i32.const 0) @@ -2316,7 +2352,9 @@ ;; CHECK: (func $0 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (i64.const 0) @@ -2364,7 +2402,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (local.get $0) diff --git a/test/lit/passes/memory-packing_zero-filled-memory64.wast b/test/lit/passes/memory-packing_zero-filled-memory64.wast index 308666de3..235711840 100644 --- a/test/lit/passes/memory-packing_zero-filled-memory64.wast +++ b/test/lit/passes/memory-packing_zero-filled-memory64.wast @@ -22,7 +22,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $__mem_segment_drop_state) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.fill ;; CHECK-NEXT: (local.get $1) diff --git a/test/lit/passes/merge-blocks.wast b/test/lit/passes/merge-blocks.wast index b6fa8f585..66b0e8b71 100644 --- a/test/lit/passes/merge-blocks.wast +++ b/test/lit/passes/merge-blocks.wast @@ -192,13 +192,13 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 2) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 4) ;; CHECK-NEXT: ) @@ -213,13 +213,17 @@ (drop (i32.const 0)) (i32.const 1) ) - (block (result i32) - (drop (i32.const 2)) - (i32.const 3) + (then + (block (result i32) + (drop (i32.const 2)) + (i32.const 3) + ) ) - (block (result i32) - (drop (i32.const 4)) - (i32.const 5) + (else + (block (result i32) + (drop (i32.const 4)) + (i32.const 5) + ) ) ) ) diff --git a/test/lit/passes/multi-memory-lowering.wast b/test/lit/passes/multi-memory-lowering.wast index 7463b7810..7508a5627 100644 --- a/test/lit/passes/multi-memory-lowering.wast +++ b/test/lit/passes/multi-memory-lowering.wast @@ -96,7 +96,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory1_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $0) ;; BOUNDS-NEXT: ) @@ -122,7 +124,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory2_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $1) ;; BOUNDS-NEXT: ) @@ -148,7 +152,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory3_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $2) ;; BOUNDS-NEXT: ) @@ -212,7 +218,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory1_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $0) ;; BOUNDS-NEXT: ) @@ -237,7 +245,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory2_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $1) ;; BOUNDS-NEXT: ) @@ -262,7 +272,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory3_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $2) ;; BOUNDS-NEXT: ) @@ -307,7 +319,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory1_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $1) ;; BOUNDS-NEXT: ) @@ -349,7 +363,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory2_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $2) ;; BOUNDS-NEXT: ) @@ -392,7 +408,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory3_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $1) ;; BOUNDS-NEXT: ) @@ -432,7 +450,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory2_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $1) ;; BOUNDS-NEXT: ) @@ -506,7 +526,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory3_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $2) ;; BOUNDS-NEXT: ) @@ -533,7 +555,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory2_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $3) ;; BOUNDS-NEXT: ) @@ -558,7 +582,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory1_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $4) ;; BOUNDS-NEXT: ) @@ -586,7 +612,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory2_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $5) ;; BOUNDS-NEXT: ) @@ -653,7 +681,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory1_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $2) ;; BOUNDS-NEXT: ) @@ -708,7 +738,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory2_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $2) ;; BOUNDS-NEXT: ) @@ -721,7 +753,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory3_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $0) ;; BOUNDS-NEXT: ) @@ -772,7 +806,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (call $memory2_size) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (if ;; BOUNDS-NEXT: (i32.gt_u @@ -782,7 +818,9 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (i32.const 1) ;; BOUNDS-NEXT: ) - ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: (then + ;; BOUNDS-NEXT: (unreachable) + ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $2) ;; BOUNDS-NEXT: ) @@ -851,8 +889,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (return -;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (return +;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.copy @@ -909,8 +949,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (return -;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (return +;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.copy @@ -954,8 +996,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (return -;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (return +;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $return_size) @@ -1013,8 +1057,10 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (i32.const -1) ;; BOUNDS-NEXT: ) -;; BOUNDS-NEXT: (return -;; BOUNDS-NEXT: (i32.const -1) +;; BOUNDS-NEXT: (then +;; BOUNDS-NEXT: (return +;; BOUNDS-NEXT: (i32.const -1) +;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (memory.copy @@ -1071,8 +1117,10 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (i32.const -1) ;; BOUNDS-NEXT: ) -;; BOUNDS-NEXT: (return -;; BOUNDS-NEXT: (i32.const -1) +;; BOUNDS-NEXT: (then +;; BOUNDS-NEXT: (return +;; BOUNDS-NEXT: (i32.const -1) +;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (memory.copy @@ -1116,8 +1164,10 @@ ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (i32.const -1) ;; BOUNDS-NEXT: ) -;; BOUNDS-NEXT: (return -;; BOUNDS-NEXT: (i32.const -1) +;; BOUNDS-NEXT: (then +;; BOUNDS-NEXT: (return +;; BOUNDS-NEXT: (i32.const -1) +;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: ) ;; BOUNDS-NEXT: (local.get $return_size) diff --git a/test/lit/passes/no-inline.wast b/test/lit/passes/no-inline.wast index 5e5c1ea0e..9fd95d0b7 100644 --- a/test/lit/passes/no-inline.wast +++ b/test/lit/passes/no-inline.wast @@ -49,7 +49,9 @@ (func $partial-yes-inline (param $x i32) (if (local.get $x) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -60,7 +62,9 @@ ;; NO_PART: (func $partial-maybe-inline (param $x i32) ;; NO_PART-NEXT: (if ;; NO_PART-NEXT: (local.get $x) - ;; NO_PART-NEXT: (return) + ;; NO_PART-NEXT: (then + ;; NO_PART-NEXT: (return) + ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: (loop $l ;; NO_PART-NEXT: (call $import) @@ -70,7 +74,9 @@ ;; NO_BOTH: (func $partial-maybe-inline (param $x i32) ;; NO_BOTH-NEXT: (if ;; NO_BOTH-NEXT: (local.get $x) - ;; NO_BOTH-NEXT: (return) + ;; NO_BOTH-NEXT: (then + ;; NO_BOTH-NEXT: (return) + ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: (loop $l ;; NO_BOTH-NEXT: (call $import) @@ -80,7 +86,9 @@ (func $partial-maybe-inline (param $x i32) (if (local.get $x) - (return) + (then + (return) + ) ) (loop $l (call $import) @@ -118,8 +126,10 @@ ;; YES_ALL-NEXT: (i32.eqz ;; YES_ALL-NEXT: (local.get $2) ;; YES_ALL-NEXT: ) - ;; YES_ALL-NEXT: (call $byn-split-outlined-A$partial-yes-inline - ;; YES_ALL-NEXT: (local.get $2) + ;; YES_ALL-NEXT: (then + ;; YES_ALL-NEXT: (call $byn-split-outlined-A$partial-yes-inline + ;; YES_ALL-NEXT: (local.get $2) + ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) @@ -133,8 +143,10 @@ ;; YES_ALL-NEXT: (i32.eqz ;; YES_ALL-NEXT: (local.get $3) ;; YES_ALL-NEXT: ) - ;; YES_ALL-NEXT: (call $byn-split-outlined-A$partial-maybe-inline - ;; YES_ALL-NEXT: (local.get $3) + ;; YES_ALL-NEXT: (then + ;; YES_ALL-NEXT: (call $byn-split-outlined-A$partial-maybe-inline + ;; YES_ALL-NEXT: (local.get $3) + ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) @@ -169,8 +181,10 @@ ;; NO_PART-NEXT: (i32.eqz ;; NO_PART-NEXT: (local.get $2) ;; NO_PART-NEXT: ) - ;; NO_PART-NEXT: (call $byn-split-outlined-A$partial-yes-inline - ;; NO_PART-NEXT: (local.get $2) + ;; NO_PART-NEXT: (then + ;; NO_PART-NEXT: (call $byn-split-outlined-A$partial-yes-inline + ;; NO_PART-NEXT: (local.get $2) + ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) @@ -203,8 +217,10 @@ ;; NO_FULL-NEXT: (i32.eqz ;; NO_FULL-NEXT: (local.get $1) ;; NO_FULL-NEXT: ) - ;; NO_FULL-NEXT: (call $byn-split-outlined-A$partial-yes-inline - ;; NO_FULL-NEXT: (local.get $1) + ;; NO_FULL-NEXT: (then + ;; NO_FULL-NEXT: (call $byn-split-outlined-A$partial-yes-inline + ;; NO_FULL-NEXT: (local.get $1) + ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) @@ -218,8 +234,10 @@ ;; NO_FULL-NEXT: (i32.eqz ;; NO_FULL-NEXT: (local.get $2) ;; NO_FULL-NEXT: ) - ;; NO_FULL-NEXT: (call $byn-split-outlined-A$partial-maybe-inline - ;; NO_FULL-NEXT: (local.get $2) + ;; NO_FULL-NEXT: (then + ;; NO_FULL-NEXT: (call $byn-split-outlined-A$partial-maybe-inline + ;; NO_FULL-NEXT: (local.get $2) + ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) @@ -248,8 +266,10 @@ ;; NO_BOTH-NEXT: (i32.eqz ;; NO_BOTH-NEXT: (local.get $1) ;; NO_BOTH-NEXT: ) - ;; NO_BOTH-NEXT: (call $byn-split-outlined-A$partial-yes-inline - ;; NO_BOTH-NEXT: (local.get $1) + ;; NO_BOTH-NEXT: (then + ;; NO_BOTH-NEXT: (call $byn-split-outlined-A$partial-yes-inline + ;; NO_BOTH-NEXT: (local.get $1) + ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) @@ -303,8 +323,10 @@ ;; YES_ALL-NEXT: (i32.eqz ;; YES_ALL-NEXT: (local.get $2) ;; YES_ALL-NEXT: ) - ;; YES_ALL-NEXT: (call $byn-split-outlined-A$partial-yes-inline - ;; YES_ALL-NEXT: (local.get $2) + ;; YES_ALL-NEXT: (then + ;; YES_ALL-NEXT: (call $byn-split-outlined-A$partial-yes-inline + ;; YES_ALL-NEXT: (local.get $2) + ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) @@ -318,8 +340,10 @@ ;; YES_ALL-NEXT: (i32.eqz ;; YES_ALL-NEXT: (local.get $3) ;; YES_ALL-NEXT: ) - ;; YES_ALL-NEXT: (call $byn-split-outlined-A$partial-maybe-inline - ;; YES_ALL-NEXT: (local.get $3) + ;; YES_ALL-NEXT: (then + ;; YES_ALL-NEXT: (call $byn-split-outlined-A$partial-maybe-inline + ;; YES_ALL-NEXT: (local.get $3) + ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) @@ -354,8 +378,10 @@ ;; NO_PART-NEXT: (i32.eqz ;; NO_PART-NEXT: (local.get $2) ;; NO_PART-NEXT: ) - ;; NO_PART-NEXT: (call $byn-split-outlined-A$partial-yes-inline - ;; NO_PART-NEXT: (local.get $2) + ;; NO_PART-NEXT: (then + ;; NO_PART-NEXT: (call $byn-split-outlined-A$partial-yes-inline + ;; NO_PART-NEXT: (local.get $2) + ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) @@ -388,8 +414,10 @@ ;; NO_FULL-NEXT: (i32.eqz ;; NO_FULL-NEXT: (local.get $1) ;; NO_FULL-NEXT: ) - ;; NO_FULL-NEXT: (call $byn-split-outlined-A$partial-yes-inline - ;; NO_FULL-NEXT: (local.get $1) + ;; NO_FULL-NEXT: (then + ;; NO_FULL-NEXT: (call $byn-split-outlined-A$partial-yes-inline + ;; NO_FULL-NEXT: (local.get $1) + ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) @@ -403,8 +431,10 @@ ;; NO_FULL-NEXT: (i32.eqz ;; NO_FULL-NEXT: (local.get $2) ;; NO_FULL-NEXT: ) - ;; NO_FULL-NEXT: (call $byn-split-outlined-A$partial-maybe-inline - ;; NO_FULL-NEXT: (local.get $2) + ;; NO_FULL-NEXT: (then + ;; NO_FULL-NEXT: (call $byn-split-outlined-A$partial-maybe-inline + ;; NO_FULL-NEXT: (local.get $2) + ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) @@ -433,8 +463,10 @@ ;; NO_BOTH-NEXT: (i32.eqz ;; NO_BOTH-NEXT: (local.get $1) ;; NO_BOTH-NEXT: ) - ;; NO_BOTH-NEXT: (call $byn-split-outlined-A$partial-yes-inline - ;; NO_BOTH-NEXT: (local.get $1) + ;; NO_BOTH-NEXT: (then + ;; NO_BOTH-NEXT: (call $byn-split-outlined-A$partial-yes-inline + ;; NO_BOTH-NEXT: (local.get $1) + ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) @@ -526,13 +558,17 @@ ;; NO_PART: (func $maybe-partial-or-full-1 (param $x i32) ;; NO_PART-NEXT: (if ;; NO_PART-NEXT: (local.get $x) - ;; NO_PART-NEXT: (call $import) + ;; NO_PART-NEXT: (then + ;; NO_PART-NEXT: (call $import) + ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) ;; NO_BOTH: (func $maybe-partial-or-full-1 (param $x i32) ;; NO_BOTH-NEXT: (if ;; NO_BOTH-NEXT: (local.get $x) - ;; NO_BOTH-NEXT: (call $import) + ;; NO_BOTH-NEXT: (then + ;; NO_BOTH-NEXT: (call $import) + ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) (func $maybe-partial-or-full-1 (param $x i32) @@ -542,14 +578,18 @@ ;; partially inline it. (if (local.get $x) - (call $import) + (then + (call $import) + ) ) ) ;; NO_PART: (func $maybe-partial-or-full-2 (param $x i32) ;; NO_PART-NEXT: (if ;; NO_PART-NEXT: (local.get $x) - ;; NO_PART-NEXT: (return) + ;; NO_PART-NEXT: (then + ;; NO_PART-NEXT: (return) + ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: ) ;; NO_PART-NEXT: (nop) ;; NO_PART-NEXT: (drop @@ -580,7 +620,9 @@ ;; NO_BOTH: (func $maybe-partial-or-full-2 (param $x i32) ;; NO_BOTH-NEXT: (if ;; NO_BOTH-NEXT: (local.get $x) - ;; NO_BOTH-NEXT: (return) + ;; NO_BOTH-NEXT: (then + ;; NO_BOTH-NEXT: (return) + ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: ) ;; NO_BOTH-NEXT: (nop) ;; NO_BOTH-NEXT: (drop @@ -613,7 +655,9 @@ ;; some extra things to the function size for partial inlining to kick in. (if (local.get $x) - (return) + (then + (return) + ) ) (nop) (drop @@ -654,7 +698,9 @@ ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: (if ;; YES_ALL-NEXT: (local.get $0) - ;; YES_ALL-NEXT: (call $import) + ;; YES_ALL-NEXT: (then + ;; YES_ALL-NEXT: (call $import) + ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) @@ -665,7 +711,9 @@ ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: (if ;; YES_ALL-NEXT: (local.get $1) - ;; YES_ALL-NEXT: (call $import) + ;; YES_ALL-NEXT: (then + ;; YES_ALL-NEXT: (call $import) + ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) @@ -677,7 +725,9 @@ ;; YES_ALL-NEXT: (block ;; YES_ALL-NEXT: (if ;; YES_ALL-NEXT: (local.get $2) - ;; YES_ALL-NEXT: (br $__inlined_func$maybe-partial-or-full-2$2) + ;; YES_ALL-NEXT: (then + ;; YES_ALL-NEXT: (br $__inlined_func$maybe-partial-or-full-2$2) + ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: (nop) ;; YES_ALL-NEXT: (drop @@ -715,7 +765,9 @@ ;; YES_ALL-NEXT: (block ;; YES_ALL-NEXT: (if ;; YES_ALL-NEXT: (local.get $3) - ;; YES_ALL-NEXT: (br $__inlined_func$maybe-partial-or-full-2$3) + ;; YES_ALL-NEXT: (then + ;; YES_ALL-NEXT: (br $__inlined_func$maybe-partial-or-full-2$3) + ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: ) ;; YES_ALL-NEXT: (nop) ;; YES_ALL-NEXT: (drop @@ -772,8 +824,10 @@ ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: (if ;; NO_FULL-NEXT: (local.get $0) - ;; NO_FULL-NEXT: (call $byn-split-outlined-B$maybe-partial-or-full-1 - ;; NO_FULL-NEXT: (local.get $0) + ;; NO_FULL-NEXT: (then + ;; NO_FULL-NEXT: (call $byn-split-outlined-B$maybe-partial-or-full-1 + ;; NO_FULL-NEXT: (local.get $0) + ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) @@ -785,8 +839,10 @@ ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: (if ;; NO_FULL-NEXT: (local.get $1) - ;; NO_FULL-NEXT: (call $byn-split-outlined-B$maybe-partial-or-full-1 - ;; NO_FULL-NEXT: (local.get $1) + ;; NO_FULL-NEXT: (then + ;; NO_FULL-NEXT: (call $byn-split-outlined-B$maybe-partial-or-full-1 + ;; NO_FULL-NEXT: (local.get $1) + ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) @@ -800,8 +856,10 @@ ;; NO_FULL-NEXT: (i32.eqz ;; NO_FULL-NEXT: (local.get $2) ;; NO_FULL-NEXT: ) - ;; NO_FULL-NEXT: (call $byn-split-outlined-A$maybe-partial-or-full-2 - ;; NO_FULL-NEXT: (local.get $2) + ;; NO_FULL-NEXT: (then + ;; NO_FULL-NEXT: (call $byn-split-outlined-A$maybe-partial-or-full-2 + ;; NO_FULL-NEXT: (local.get $2) + ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) @@ -815,8 +873,10 @@ ;; NO_FULL-NEXT: (i32.eqz ;; NO_FULL-NEXT: (local.get $3) ;; NO_FULL-NEXT: ) - ;; NO_FULL-NEXT: (call $byn-split-outlined-A$maybe-partial-or-full-2 - ;; NO_FULL-NEXT: (local.get $3) + ;; NO_FULL-NEXT: (then + ;; NO_FULL-NEXT: (call $byn-split-outlined-A$maybe-partial-or-full-2 + ;; NO_FULL-NEXT: (local.get $3) + ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) ;; NO_FULL-NEXT: ) diff --git a/test/lit/passes/once-reduction.wast b/test/lit/passes/once-reduction.wast index 45170a0e1..af9f4f113 100644 --- a/test/lit/passes/once-reduction.wast +++ b/test/lit/passes/once-reduction.wast @@ -14,7 +14,9 @@ ;; A minimal "once" function. It is so trivial we can remove its body. (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -40,7 +42,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -52,7 +56,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ;; Add some more content in the function. @@ -62,7 +68,7 @@ ;; CHECK: (func $caller-if-1 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (call $once) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -76,11 +82,13 @@ ;; Add more calls, and ones that are conditional. (if (i32.const 1) - (block - (call $once) - (call $once) - (call $once) - (call $once) + (then + (block + (call $once) + (call $once) + (call $once) + (call $once) + ) ) ) (call $once) @@ -90,8 +98,10 @@ ;; CHECK: (func $caller-if-2 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $once) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (call $once) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) @@ -104,11 +114,15 @@ ;; call after the if is *not* optimized. (if (i32.const 1) - (call $once) - (block - (call $once) + (then (call $once) ) + (else + (block + (call $once) + (call $once) + ) + ) ) (call $once) (call $once) @@ -118,7 +132,9 @@ ;; CHECK-NEXT: (loop $loop ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $once) ;; CHECK-NEXT: (nop) @@ -134,7 +150,9 @@ (loop $loop (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (call $once) (call $once) @@ -148,7 +166,9 @@ ;; CHECK-NEXT: (loop $loop ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $loop ;; CHECK-NEXT: (i32.const 1) @@ -162,7 +182,9 @@ (loop $loop (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (br_if $loop (i32.const 1)) ) @@ -202,7 +224,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -212,7 +236,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) (call $foo) @@ -243,7 +269,9 @@ ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -254,7 +282,9 @@ (nop) (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) (call $foo) @@ -283,7 +313,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (global.set $once @@ -294,7 +326,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (nop) (global.set $once (i32.const 1)) @@ -324,8 +358,12 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) - ;; CHECK-NEXT: (call $foo) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $foo) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -335,8 +373,12 @@ (func $once (if (global.get $once) - (return) - (call $foo) + (then + (return) + ) + (else + (call $foo) + ) ) (global.set $once (i32.const 1)) (call $foo) @@ -364,7 +406,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once1) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once2 ;; CHECK-NEXT: (i32.const 1) @@ -373,7 +417,9 @@ (func $once (if (global.get $once1) - (return) + (then + (return) + ) ) (global.set $once2 (i32.const 1)) ) @@ -398,7 +444,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 0) @@ -407,7 +455,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 0)) ) @@ -432,7 +482,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -441,7 +493,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -475,7 +529,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 42)) ) @@ -517,7 +573,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -527,7 +585,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) (call $once) @@ -546,7 +606,9 @@ ;; CHECK-NEXT: (i32.trunc_f64_s ;; CHECK-NEXT: (global.get $once) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (f64.const 1) @@ -558,7 +620,9 @@ (i32.trunc_f64_s (global.get $once) ) - (return) + (then + (return) + ) ) (global.set $once (f64.const 1)) ) @@ -592,7 +656,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -617,7 +683,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.eqz @@ -630,7 +698,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.eqz (i32.eqz (i32.const 1)))) ) @@ -657,7 +727,9 @@ ;; CHECK: (func $once (type $0) (param $x i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -666,7 +738,9 @@ (func $once (param $x i32) (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -697,8 +771,10 @@ ;; CHECK: (func $once (type $0) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once @@ -709,7 +785,9 @@ (func $once (result i32) (if (global.get $once) - (return (i32.const 2)) + (then + (return (i32.const 2)) + ) ) (global.set $once (i32.const 1)) (i32.const 3) @@ -740,7 +818,9 @@ ;; CHECK-NEXT: (loop $loop ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -751,7 +831,9 @@ (loop $loop (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -777,13 +859,17 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $once (if (global.get $once) - (return) + (then + (return) + ) ) ) @@ -807,7 +893,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -816,7 +904,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -845,7 +935,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -857,7 +949,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) (drop (global.get $once)) @@ -887,7 +981,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -921,7 +1017,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -929,53 +1027,79 @@ ;; CHECK: (func $caller (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $once) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) @@ -983,53 +1107,79 @@ (func $caller (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (call $once) (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (call $once) (if (i32.const 1) - (nop) - (nop) + (then + (nop) + ) + (else + (nop) + ) ) (call $once) (if (i32.const 1) - (nop) - (call $once) + (then + (nop) + ) + (else + (call $once) + ) ) (call $once) (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (call $once) (if (i32.const 1) - (nop) - (call $once) + (then + (nop) + ) + (else + (call $once) + ) ) (call $once) (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (call $once) (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) (call $once) (call $once) @@ -1056,7 +1206,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -1066,7 +1218,9 @@ ;; CHECK-NEXT: (do ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $once) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (catch $tag @@ -1081,7 +1235,9 @@ (do (if (i32.const 1) - (call $once) + (then + (call $once) + ) ) ) (catch $tag @@ -1111,7 +1267,9 @@ ;; CHECK: (func $once1 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once1) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once1 ;; CHECK-NEXT: (i32.const 1) @@ -1128,7 +1286,9 @@ (func $once1 (if (global.get $once1) - (return) + (then + (return) + ) ) (global.set $once1 (i32.const 1)) (call $once1) @@ -1144,7 +1304,9 @@ ;; CHECK: (func $many1 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $many1) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $many1 ;; CHECK-NEXT: (i32.const 0) @@ -1161,7 +1323,9 @@ (func $many1 (if (global.get $many1) - (return) + (then + (return) + ) ) (global.set $many1 (i32.const 0)) ;; prevent this global being "once" (call $many2) @@ -1177,7 +1341,9 @@ ;; CHECK: (func $once2 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once2) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once2 ;; CHECK-NEXT: (i32.const 2) @@ -1194,7 +1360,9 @@ (func $once2 (if (global.get $once2) - (return) + (then + (return) + ) ) (global.set $once2 (i32.const 2)) (call $once2) @@ -1210,7 +1378,9 @@ ;; CHECK: (func $many2 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $many2) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $many1 ;; CHECK-NEXT: (i32.const 0) @@ -1227,7 +1397,9 @@ (func $many2 (if (global.get $many2) - (return) + (then + (return) + ) ) (global.set $many1 (i32.const 0)) (call $many1) @@ -1256,7 +1428,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -1324,7 +1498,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -1333,7 +1509,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -1362,7 +1540,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -1371,7 +1551,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -1406,7 +1588,9 @@ ;; two lines here (the early-exit logic). (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) (call $once.1) @@ -1420,7 +1604,9 @@ ;; out. (if (global.get $once.1) - (return) + (then + (return) + ) ) (global.set $once.1 (i32.const 1)) ) @@ -1501,7 +1687,9 @@ ;; logic. (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) (call $once.1) @@ -1510,7 +1698,9 @@ ;; CHECK: (func $once.1 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once.1) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once.1 ;; CHECK-NEXT: (i32.const 1) @@ -1523,7 +1713,9 @@ ;; cannot do so here (it would risk an infinite loop). (if (global.get $once.1) - (return) + (then + (return) + ) ) (global.set $once.1 (i32.const 1)) (call $once) ;; This call was added. @@ -1593,7 +1785,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -1607,7 +1801,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) (call $once.1) @@ -1634,7 +1830,9 @@ ;; CHECK: (func $once.1 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once.1) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once.1 ;; CHECK-NEXT: (i32.const 1) @@ -1648,7 +1846,9 @@ (func $once.1 (if (global.get $once.1) - (return) + (then + (return) + ) ) (global.set $once.1 (i32.const 1)) (call $once) @@ -1662,7 +1862,9 @@ ;; CHECK: (func $once.2 (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once.2) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once.2 ;; CHECK-NEXT: (i32.const 1) @@ -1676,7 +1878,9 @@ (func $once.2 (if (global.get $once.2) - (return) + (then + (return) + ) ) (global.set $once.2 (i32.const 1)) (call $once) @@ -1699,7 +1903,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -1709,7 +1915,9 @@ (func $once (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ;; A recursive call. This of course does not recurse infinitely since the @@ -1743,7 +1951,9 @@ ;; A minimal "once" function. (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ) @@ -1789,7 +1999,9 @@ ;; CHECK: (func $once (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -1800,7 +2012,9 @@ ;; We should not remove this early-exit logic. (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1)) ;; A call to a non-"once" function. diff --git a/test/lit/passes/optimize-casts.wast b/test/lit/passes/optimize-casts.wast index d0b4d05d7..512a04e9d 100644 --- a/test/lit/passes/optimize-casts.wast +++ b/test/lit/passes/optimize-casts.wast @@ -437,7 +437,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $x) @@ -453,7 +455,9 @@ ;; this atm. (if (i32.const 0) - (return) + (then + (return) + ) ) (drop (local.get $x) @@ -1291,7 +1295,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.tee $1 ;; CHECK-NEXT: (ref.as_non_null @@ -1322,17 +1326,19 @@ ) (if (i32.const 0) - (block - (drop - ;; The ref.as_non_null can be moved here because - ;; it is in the same block in the same arm of the - ;; if statement. - (local.get $x) - ) - (drop - (ref.as_non_null + (then + (block + (drop + ;; The ref.as_non_null can be moved here because + ;; it is in the same block in the same arm of the + ;; if statement. (local.get $x) ) + (drop + (ref.as_non_null + (local.get $x) + ) + ) ) ) ) diff --git a/test/lit/passes/optimize-instructions-call_ref.wast b/test/lit/passes/optimize-instructions-call_ref.wast index 29c09eb0f..f83ddb091 100644 --- a/test/lit/passes/optimize-instructions-call_ref.wast +++ b/test/lit/passes/optimize-instructions-call_ref.wast @@ -256,13 +256,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (call $foo - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $foo + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $bar - ;; CHECK-NEXT: (local.get $4) - ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $bar + ;; CHECK-NEXT: (local.get $4) + ;; CHECK-NEXT: (local.get $5) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -311,13 +315,17 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $get-i32) - ;; CHECK-NEXT: (return_call $foo - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return_call $foo + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return_call $bar - ;; CHECK-NEXT: (local.get $2) - ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (return_call $bar + ;; CHECK-NEXT: (local.get $2) + ;; CHECK-NEXT: (local.get $3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/optimize-instructions-exceptions.wast b/test/lit/passes/optimize-instructions-exceptions.wast index 9d22224fb..dcb649129 100644 --- a/test/lit/passes/optimize-instructions-exceptions.wast +++ b/test/lit/passes/optimize-instructions-exceptions.wast @@ -13,7 +13,9 @@ ;; CHECK-NEXT: (i32.const 456) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $test @@ -34,7 +36,9 @@ ) ) ) - (nop) + (then + (nop) + ) ) ) ) diff --git a/test/lit/passes/optimize-instructions-gc-tnh.wast b/test/lit/passes/optimize-instructions-gc-tnh.wast index 98372bed2..3cf7a72d2 100644 --- a/test/lit/passes/optimize-instructions-gc-tnh.wast +++ b/test/lit/passes/optimize-instructions-gc-tnh.wast @@ -243,16 +243,24 @@ ;; NO_TNH-NEXT: (struct.set $struct 0 ;; NO_TNH-NEXT: (if (result (ref null $struct)) ;; NO_TNH-NEXT: (local.get $x) - ;; NO_TNH-NEXT: (local.get $ref) - ;; NO_TNH-NEXT: (ref.null none) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (local.get $ref) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (ref.null none) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (i32.const 1) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (struct.set $struct 0 ;; NO_TNH-NEXT: (if (result (ref null $struct)) ;; NO_TNH-NEXT: (local.get $x) - ;; NO_TNH-NEXT: (ref.null none) - ;; NO_TNH-NEXT: (local.get $ref) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (ref.null none) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (local.get $ref) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (i32.const 2) ;; NO_TNH-NEXT: ) @@ -263,16 +271,24 @@ (struct.set $struct 0 (if (result (ref null $struct)) (local.get $x) - (local.get $ref) - (ref.null none) + (then + (local.get $ref) + ) + (else + (ref.null none) + ) ) (i32.const 1) ) (struct.set $struct 0 (if (result (ref null $struct)) (local.get $x) - (ref.null none) - (local.get $ref) + (then + (ref.null none) + ) + (else + (local.get $ref) + ) ) (i32.const 2) ) @@ -655,8 +671,12 @@ ;; NO_TNH-NEXT: (drop ;; NO_TNH-NEXT: (if (result (ref none)) ;; NO_TNH-NEXT: (i32.const 1) - ;; NO_TNH-NEXT: (unreachable) - ;; NO_TNH-NEXT: (local.get $x) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (local.get $x) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (unreachable) @@ -668,8 +688,12 @@ (ref.cast (ref $struct) (if (result (ref none)) (i32.const 1) - (unreachable) - (local.get $x) + (then + (unreachable) + ) + (else + (local.get $x) + ) ) ) ) @@ -689,8 +713,12 @@ ;; NO_TNH-NEXT: (drop ;; NO_TNH-NEXT: (if (result (ref none)) ;; NO_TNH-NEXT: (i32.const 1) - ;; NO_TNH-NEXT: (local.get $x) - ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (local.get $x) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (unreachable) @@ -700,8 +728,12 @@ (ref.cast (ref $struct) (if (result (ref none)) (i32.const 1) - (local.get $x) - (unreachable) + (then + (local.get $x) + ) + (else + (unreachable) + ) ) ) ) @@ -936,8 +968,12 @@ ;; TNH-NEXT: (drop ;; TNH-NEXT: (if (result (ref nofunc)) ;; TNH-NEXT: (i32.const 1) - ;; TNH-NEXT: (return) - ;; TNH-NEXT: (unreachable) + ;; TNH-NEXT: (then + ;; TNH-NEXT: (return) + ;; TNH-NEXT: ) + ;; TNH-NEXT: (else + ;; TNH-NEXT: (unreachable) + ;; TNH-NEXT: ) ;; TNH-NEXT: ) ;; TNH-NEXT: ) ;; TNH-NEXT: (unreachable) @@ -950,8 +986,12 @@ ;; NO_TNH-NEXT: (drop ;; NO_TNH-NEXT: (if (result (ref nofunc)) ;; NO_TNH-NEXT: (i32.const 1) - ;; NO_TNH-NEXT: (return) - ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (return) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (unreachable) @@ -968,10 +1008,14 @@ (ref.cast (ref func) (if (result (ref nofunc)) (i32.const 1) - (block (result (ref nofunc)) - (return) + (then + (block (result (ref nofunc)) + (return) + ) + ) + (else + (unreachable) ) - (unreachable) ) ) ) diff --git a/test/lit/passes/optimize-instructions-gc.wast b/test/lit/passes/optimize-instructions-gc.wast index cb732d68b..c7c7f601f 100644 --- a/test/lit/passes/optimize-instructions-gc.wast +++ b/test/lit/passes/optimize-instructions-gc.wast @@ -52,23 +52,35 @@ (func $if-arms-subtype-fold (result anyref) (if (result anyref) (i32.const 0) - (ref.null eq) - (ref.null eq) + (then + (ref.null eq) + ) + (else + (ref.null eq) + ) ) ) ;; 2. if its `ifTrue` and `ifFalse` arms are not identical (cannot fold) ;; CHECK: (func $if-arms-subtype-nofold (type $27) (param $i31ref i31ref) (result anyref) ;; CHECK-NEXT: (if (result anyref) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (ref.null none) - ;; CHECK-NEXT: (local.get $i31ref) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $i31ref) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-arms-subtype-nofold (param $i31ref i31ref) (result anyref) (if (result anyref) (i32.const 0) - (ref.null none) - (local.get $i31ref) + (then + (ref.null none) + ) + (else + (local.get $i31ref) + ) ) ) @@ -669,8 +681,12 @@ ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (if (result (ref null $struct)) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: (local.get $z) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $z) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -679,8 +695,12 @@ (drop (if (result i32) (local.get $x) - (ref.is_null (local.get $y)) - (ref.is_null (local.get $z)) + (then + (ref.is_null (local.get $y)) + ) + (else + (ref.is_null (local.get $z)) + ) ) ) ) @@ -741,8 +761,12 @@ ;; CHECK-NEXT: (struct.get_u $struct $i8 ;; CHECK-NEXT: (if (result (ref null $struct)) ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -753,11 +777,15 @@ (local.get $z) ;; the arms are equal and have side effects, but that is ok with an if ;; which only executes one side anyhow - (struct.get_u $struct 0 - (local.get $x) + (then + (struct.get_u $struct 0 + (local.get $x) + ) ) - (struct.get_u $struct 0 - (local.get $y) + (else + (struct.get_u $struct 0 + (local.get $y) + ) ) ) ) @@ -1058,11 +1086,15 @@ ;; CHECK: (func $hoist-LUB-danger (type $33) (param $x i32) (param $b (ref $B)) (param $c (ref $C)) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (struct.get $B 1 - ;; CHECK-NEXT: (local.get $b) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (struct.get $B 1 + ;; CHECK-NEXT: (local.get $b) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (struct.get $C 1 - ;; CHECK-NEXT: (local.get $c) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (struct.get $C 1 + ;; CHECK-NEXT: (local.get $c) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1077,11 +1109,15 @@ ;; nominal typing. (if (result i32) (local.get $x) - (struct.get $B 1 - (local.get $b) + (then + (struct.get $B 1 + (local.get $b) + ) ) - (struct.get $C 1 - (local.get $c) + (else + (struct.get $C 1 + (local.get $c) + ) ) ) ) @@ -3097,8 +3133,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (br $block) - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $block) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: (i32.const 42) @@ -3117,8 +3157,12 @@ ) (if (result i32) (i32.const 1) - (br $block) - (i32.const 10) + (then + (br $block) + ) + (else + (i32.const 10) + ) ) ;; There are no tricky effects after this, so this cast can be removed. (ref.as_non_null diff --git a/test/lit/passes/optimize-instructions-ignore-traps.wast b/test/lit/passes/optimize-instructions-ignore-traps.wast index 0d31794e5..e594b791c 100644 --- a/test/lit/passes/optimize-instructions-ignore-traps.wast +++ b/test/lit/passes/optimize-instructions-ignore-traps.wast @@ -51,20 +51,28 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.rem_u - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.rem_u + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.mul + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 11) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 11) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $while-in6 @@ -149,8 +157,12 @@ ) ) ) - (local.get $7) - (local.get $6) + (then + (local.get $7) + ) + (else + (local.get $6) + ) ) ) (br_if $while-in6 @@ -232,8 +244,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $7) - ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $while-in6 @@ -318,8 +334,12 @@ ) ) ) - (local.get $7) - (local.get $6) + (then + (local.get $7) + ) + (else + (local.get $6) + ) ) ) (br_if $while-in6 @@ -384,22 +404,30 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.rem_s - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (i32.mul - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.rem_s + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (i32.mul ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 17) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 17) + ;; CHECK-NEXT: (i32.const 5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 5) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $6) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $6) - ;; CHECK-NEXT: (local.get $7) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br_if $while-in6 @@ -484,8 +512,12 @@ ) ) ) - (local.get $7) - (local.get $6) + (then + (local.get $7) + ) + (else + (local.get $6) + ) ) ) (br_if $while-in6 @@ -540,8 +572,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return @@ -576,7 +610,9 @@ ) ) ) - (return (local.get $0)) + (then + (return (local.get $0)) + ) ) (return (local.get $1)) ) @@ -587,23 +623,29 @@ ;; CHECK-NEXT: (local.tee $1 ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.lt_u - ;; CHECK-NEXT: (i32.and - ;; CHECK-NEXT: (i32.extend8_s - ;; CHECK-NEXT: (i32.sub - ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.lt_u + ;; CHECK-NEXT: (i32.and + ;; CHECK-NEXT: (i32.extend8_s + ;; CHECK-NEXT: (i32.sub + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 255) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 255) + ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (return @@ -638,7 +680,9 @@ ) ) ) - (return (local.get $0)) + (then + (return (local.get $0)) + ) ) (return (local.get $1)) ) diff --git a/test/lit/passes/optimize-instructions-multivalue.wast b/test/lit/passes/optimize-instructions-multivalue.wast index 10b64e354..e2a353365 100644 --- a/test/lit/passes/optimize-instructions-multivalue.wast +++ b/test/lit/passes/optimize-instructions-multivalue.wast @@ -8,8 +8,12 @@ ;; CHECK-NEXT: (tuple.extract 2 0 ;; CHECK-NEXT: (if (type $2) (result i32 i32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $tuple) - ;; CHECK-NEXT: (local.get $tuple2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $tuple) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $tuple2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -19,11 +23,15 @@ (if (result i32) (local.get $x) ;; The tuple.extract can be hoisted out. - (tuple.extract 2 0 - (local.get $tuple) + (then + (tuple.extract 2 0 + (local.get $tuple) + ) ) - (tuple.extract 2 0 - (local.get $tuple2) + (else + (tuple.extract 2 0 + (local.get $tuple2) + ) ) ) ) diff --git a/test/lit/passes/optimize-instructions-mvp.wast b/test/lit/passes/optimize-instructions-mvp.wast index 550db4094..9ac34145c 100644 --- a/test/lit/passes/optimize-instructions-mvp.wast +++ b/test/lit/passes/optimize-instructions-mvp.wast @@ -92,8 +92,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $i1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 10) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -102,8 +104,10 @@ (i32.eqz (local.get $i1) ) - (drop - (i32.const 10) + (then + (drop + (i32.const 10) + ) ) ) ) @@ -111,8 +115,12 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $i1) - ;; CHECK-NEXT: (i32.const 12) - ;; CHECK-NEXT: (i32.const 11) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 11) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -121,11 +129,15 @@ (i32.eqz (local.get $i1) ) - (drop - (i32.const 11) + (then + (drop + (i32.const 11) + ) ) - (drop - (i32.const 12) + (else + (drop + (i32.const 12) + ) ) ) ) @@ -135,8 +147,12 @@ ;; CHECK-NEXT: (i64.eqz ;; CHECK-NEXT: (local.get $i2) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 11) - ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 11) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 12) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -145,11 +161,15 @@ (i64.eqz (local.get $i2) ) - (drop - (i32.const 11) + (then + (drop + (i32.const 11) + ) ) - (drop - (i32.const 12) + (else + (drop + (i32.const 12) + ) ) ) ) @@ -510,7 +530,9 @@ ;; CHECK: (func $if-eqz-eqz ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 123) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-eqz-eqz @@ -520,7 +542,9 @@ (i32.const 123) ) ) - (nop) + (then + (nop) + ) ) ) ;; CHECK: (func $select-eqz (param $i1 i32) (result i32) @@ -2118,18 +2142,24 @@ ;; CHECK: (func $ne0 (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $ne0) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $ne0) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.or ;; CHECK-NEXT: (call $ne0) ;; CHECK-NEXT: (call $ne0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.and @@ -2142,16 +2172,22 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) (func $ne0 (result i32) (if (i32.ne (call $ne0) (i32.const 0)) - (nop) + (then + (nop) + ) ) (if (i32.ne (i32.const 0) (call $ne0)) - (nop) + (then + (nop) + ) ) ;; through an or (if @@ -2159,7 +2195,9 @@ (i32.ne (i32.const 0) (call $ne0)) (i32.ne (i32.const 0) (call $ne0)) ) - (nop) + (then + (nop) + ) ) ;; but not an and (if @@ -2167,7 +2205,9 @@ (i32.ne (i32.const 0) (call $ne0)) (i32.ne (i32.const 0) (call $ne0)) ) - (nop) + (then + (nop) + ) ) (i32.const 1) ) @@ -2175,34 +2215,50 @@ ;; CHECK-NEXT: (if ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $ne0) - ;; CHECK-NEXT: (call $ne1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $ne0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $ne1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (call $ne0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $recurse-bool (if (if (result i32) (i32.const 1) - (i32.ne (call $ne0) (i32.const 0)) - (i32.ne (call $ne1) (i32.const 0)) + (then + (i32.ne (call $ne0) (i32.const 0)) + ) + (else + (i32.ne (call $ne1) (i32.const 0)) + ) + ) + (then + (nop) ) - (nop) ) (if (block (result i32) (nop) (i32.ne (call $ne0) (i32.const 0)) ) - (nop) + (then + (nop) + ) ) ) ;; CHECK: (func $ne1 (result i32) @@ -2671,8 +2727,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 111) - ;; CHECK-NEXT: (i32.const 222) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 111) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 222) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-sext-unreachable (param $0 i32) (result i32) @@ -2684,8 +2744,12 @@ ) (i32.const 16) ) - (i32.const 111) - (i32.const 222) + (then + (i32.const 111) + ) + (else + (i32.const 222) + ) ) ) ;; CHECK: (func $sext-24-100 (result i32) @@ -4074,8 +4138,12 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: (i32.const 255) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: (i32.const 200) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 100) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 200) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -4089,8 +4157,12 @@ ) (i32.const 24) ) - (i32.const 100) - (i32.const 200) + (then + (i32.const 100) + ) + (else + (i32.const 200) + ) ) ) ) @@ -5703,13 +5775,17 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $1) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $1) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -5718,36 +5794,56 @@ (drop (if (result i32) (local.get $0) - (i32.add (local.get $1) (i32.const 1)) - (i32.add (local.get $1) (i32.const 1)) + (then + (i32.add (local.get $1) (i32.const 1)) + ) + (else + (i32.add (local.get $1) (i32.const 1)) + ) ) ) (drop (if (result i32) (local.tee $0 (local.get $1)) ;; side effects! - (i32.add (local.get $1) (i32.const 1)) - (i32.add (local.get $1) (i32.const 1)) + (then + (i32.add (local.get $1) (i32.const 1)) + ) + (else + (i32.add (local.get $1) (i32.const 1)) + ) ) ) (drop (if (result i32) (local.get $0) - (i32.add (local.get $1) (unreachable)) ;; folding them would change the type of the if - (i32.add (local.get $1) (unreachable)) + (then + (i32.add (local.get $1) (unreachable)) ;; folding them would change the type of the if + ) + (else + (i32.add (local.get $1) (unreachable)) + ) ) ) (drop (if (result i32) (local.tee $0 (local.get $1)) ;; side effects! - (i32.add (local.get $1) (unreachable)) ;; folding them would change the type of the if - (i32.add (local.get $1) (unreachable)) + (then + (i32.add (local.get $1) (unreachable)) ;; folding them would change the type of the if + ) + (else + (i32.add (local.get $1) (unreachable)) + ) ) ) (drop (if (result i32) (unreachable) ;; !!! - (i32.add (local.get $1) (unreachable)) ;; folding them would change the type of the if - (i32.add (local.get $1) (unreachable)) + (then + (i32.add (local.get $1) (unreachable)) ;; folding them would change the type of the if + ) + (else + (i32.add (local.get $1) (unreachable)) + ) ) ) ) @@ -6830,8 +6926,12 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 40) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $return-proper-value-from-shift-left-by-zero (result i32) @@ -6855,8 +6955,12 @@ ) (i32.const -2) ) - (i32.const 1) - (i32.const 0) + (then + (i32.const 1) + ) + (else + (i32.const 0) + ) ) ) ;; CHECK: (func $de-morgan-2 (param $x i32) (param $y i32) @@ -9950,8 +10054,12 @@ ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: (i32.const 3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -9960,8 +10068,12 @@ ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: (i32.const 2147483647) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -10146,8 +10258,12 @@ (local.get $x) (i32.const 4) ) - (i32.const 1) - (i32.const 0) + (then + (i32.const 1) + ) + (else + (i32.const 0) + ) )) ;; (signed)x % min_s ? 1 : 0 (drop (if (result i32) @@ -10155,8 +10271,12 @@ (local.get $x) (i32.const 0x80000000) ) - (i32.const 1) - (i32.const 0) + (then + (i32.const 1) + ) + (else + (i32.const 0) + ) )) ) ;; CHECK: (func $fold-eqz-eqz (param $x i32) (param $y i64) @@ -10244,8 +10364,12 @@ ;; CHECK-NEXT: (local.set $x4 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -10257,8 +10381,12 @@ ;; CHECK-NEXT: (local.set $x5 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -10267,8 +10395,12 @@ ;; CHECK-NEXT: (local.set $x6 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -10308,13 +10440,13 @@ (local.set $x3 (loop (result i32) (i32.const 1))) (drop (i32.and (local.get $x3) (i32.const 7))) ;; if - two sides, can't - (local.set $x4 (if (result i32) (i32.const 1) (i32.const 2) (i32.const 3))) + (local.set $x4 (if (result i32) (i32.const 1) (then (i32.const 2) )(else (i32.const 3)))) (drop (i32.and (local.get $x4) (i32.const 7))) ;; if - one side, can - (local.set $x5 (if (result i32) (i32.const 1) (unreachable) (i32.const 3))) + (local.set $x5 (if (result i32) (i32.const 1) (then (unreachable) )(else (i32.const 3)))) (drop (i32.and (local.get $x5) (i32.const 7))) ;; if - one side, can - (local.set $x6 (if (result i32) (i32.const 1) (i32.const 3) (unreachable))) + (local.set $x6 (if (result i32) (i32.const 1) (then (i32.const 3) )(else (unreachable)))) (drop (i32.and (local.get $x6) (i32.const 7))) ;; br_if with value (drop @@ -12136,7 +12268,9 @@ ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $select-into-arms (param $x i32) (param $y i32) @@ -12146,7 +12280,9 @@ (i32.eqz (i32.eqz (local.get $y))) (local.get $y) ) - (unreachable) + (then + (unreachable) + ) ) ) ;; CHECK: (func $select-with-same-arm-and-cond-32 (param $x i32) @@ -12443,7 +12579,9 @@ ;; CHECK: (func $optimize-boolean-context (param $x i32) (param $y i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (select @@ -12460,7 +12598,9 @@ (i32.const 0) (local.get $x) ) - (unreachable) + (then + (unreachable) + ) ) (drop (select (local.get $x) @@ -14646,8 +14786,12 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14693,10 +14837,14 @@ (drop (if (result i32) (local.get $x) - (i32.eqz - (local.get $y) + (then + (i32.eqz + (local.get $y) + ) + ) + (else + (i32.const 1) ) - (i32.const 1) ) ) ) @@ -14705,8 +14853,12 @@ ;; CHECK-NEXT: (i64.eqz ;; CHECK-NEXT: (if (result i64) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (i64.const 1) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i64.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14715,9 +14867,13 @@ (drop (if (result i32) (local.get $x) - (i32.const 0) - (i64.eqz - (local.get $y) + (then + (i32.const 0) + ) + (else + (i64.eqz + (local.get $y) + ) ) ) ) @@ -14727,8 +14883,12 @@ ;; CHECK-NEXT: (i64.eqz ;; CHECK-NEXT: (if (result i64) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) - ;; CHECK-NEXT: (i64.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i64.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14737,10 +14897,14 @@ (drop (if (result i32) (local.get $x) - (i64.eqz - (local.get $y) + (then + (i64.eqz + (local.get $y) + ) + ) + (else + (i32.const 1) ) - (i32.const 1) ) ) ) @@ -14769,10 +14933,14 @@ ;; CHECK: (func $ternary-no-unreachable-1 (param $x i32) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $ternary-no-unreachable-1 (param $x i32) (result i32) @@ -14781,18 +14949,26 @@ ;; one arm is an eqz, the other is 0 or 1, so we can put an eqz on the ;; outside in theory, but we'd need to be careful with the unreachable ;; type here. ignore this case, as DCE is the proper optimization anyhow. - (i32.eqz - (unreachable) + (then + (i32.eqz + (unreachable) + ) + ) + (else + (i32.const 0) ) - (i32.const 0) ) ) ;; CHECK: (func $ternary-no-unreachable-2 (param $x i32) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14800,9 +14976,13 @@ (if (result i32) (local.get $x) ;; as before, but flipped - (i32.const 0) - (i32.eqz - (unreachable) + (then + (i32.const 0) + ) + (else + (i32.eqz + (unreachable) + ) ) ) ) @@ -14831,8 +15011,12 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14841,8 +15025,12 @@ (drop (if (result i32) (local.get $z) - (i32.eqz (local.get $x)) - (i32.eqz (local.get $y)) + (then + (i32.eqz (local.get $x)) + ) + (else + (i32.eqz (local.get $y)) + ) ) ) ) @@ -14852,8 +15040,12 @@ ;; CHECK-NEXT: (f64.floor ;; CHECK-NEXT: (if (result f64) ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14865,8 +15057,12 @@ ;; f64 (if (result f32) (local.get $z) - (f32.demote_f64 (f64.floor (local.get $x))) - (f32.demote_f64 (f64.floor (local.get $y))) + (then + (f32.demote_f64 (f64.floor (local.get $x))) + ) + (else + (f32.demote_f64 (f64.floor (local.get $y))) + ) ) ) ) @@ -14921,8 +15117,12 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14930,18 +15130,26 @@ (func $ternary-identical-arms-and-type-is-none (param $x i32) (param $y i32) (param $z i32) (if (local.get $z) - (drop (i32.eqz (local.get $x))) - (drop (i32.eqz (local.get $y))) + (then + (drop (i32.eqz (local.get $x))) + ) + (else + (drop (i32.eqz (local.get $y))) + ) ) ) ;; CHECK: (func $ternary-identical-arms-and-type-is-none-child-types-mismatch (param $x i32) (param $y i32) (param $z i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (f64.const 2.34) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (f64.const 2.34) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -14950,8 +15158,12 @@ (local.get $z) ;; the drop cannot be hoisted out, since the children's type mismatch ;; would not allow us to give a proper type to the if. - (drop (i32.const 1)) - (drop (f64.const 2.34)) + (then + (drop (i32.const 1)) + ) + (else + (drop (f64.const 2.34)) + ) ) ) ;; CHECK: (func $ternary-identical-arms-but-block (param $x i32) (param $y i32) (param $z i32) @@ -15021,8 +15233,12 @@ ;; CHECK-NEXT: (br_if $block ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -15032,11 +15248,15 @@ (if (local.get $z) ;; two br_ifs with the same target are shallowly identical - (br_if $block - (local.get $x) + (then + (br_if $block + (local.get $x) + ) ) - (br_if $block - (local.get $y) + (else + (br_if $block + (local.get $y) + ) ) ) ) @@ -15046,11 +15266,15 @@ ;; CHECK-NEXT: (block $block2 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (br_if $block1 - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br_if $block1 + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br_if $block2 - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br_if $block2 + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -15062,11 +15286,15 @@ (if (local.get $z) ;; two br_ifs with different targets are not shallowly identical - (br_if $block1 - (local.get $x) + (then + (br_if $block1 + (local.get $x) + ) ) - (br_if $block2 - (local.get $y) + (else + (br_if $block2 + (local.get $y) + ) ) ) ) @@ -15077,8 +15305,12 @@ ;; CHECK-NEXT: (return ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -15087,11 +15319,15 @@ (block $block (if (local.get $z) - (return - (local.get $x) + (then + (return + (local.get $x) + ) ) - (return - (local.get $y) + (else + (return + (local.get $y) + ) ) ) ) @@ -15131,30 +15367,42 @@ ;; CHECK-NEXT: (call $send-i32 ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $z) - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $ternary-identical-arms-call (param $x i32) (param $y i32) (param $z i32) (if (local.get $z) - (call $send-i32 - (local.get $x) + (then + (call $send-i32 + (local.get $x) + ) ) - (call $send-i32 - (local.get $y) + (else + (call $send-i32 + (local.get $y) + ) ) ) ) ;; CHECK: (func $if-dont-change-to-unreachable (param $x i32) (param $y i32) (param $z i32) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (local.get $z) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (local.get $z) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -15162,11 +15410,15 @@ ;; if we move the returns outside, we'd become unreachable; avoid that. (if (result i32) (local.get $x) - (return - (local.get $y) + (then + (return + (local.get $y) + ) ) - (return - (local.get $z) + (else + (return + (local.get $z) + ) ) ) ) diff --git a/test/lit/passes/optimize-stack-ir.wast b/test/lit/passes/optimize-stack-ir.wast index adb787879..bb1e0f9f0 100644 --- a/test/lit/passes/optimize-stack-ir.wast +++ b/test/lit/passes/optimize-stack-ir.wast @@ -159,8 +159,10 @@ ) (i32.const 0) ) - (br $topmost - (f64.const -3.4) + (then + (br $topmost + (f64.const -3.4) + ) ) ) (if @@ -170,8 +172,10 @@ ) (f64.const 0) ) - (br $topmost - (f64.const 5.6) + (then + (br $topmost + (f64.const 5.6) + ) ) ) (f64.const 1.2) @@ -224,8 +228,10 @@ (local.get $x) (f64.const 0) ) - (br $topmost - (f64.const 1.2) + (then + (br $topmost + (f64.const 1.2) + ) ) ) (if @@ -233,8 +239,10 @@ (local.get $Int) (f64.const 0) ) - (br $topmost - (f64.const -3.4) + (then + (br $topmost + (f64.const -3.4) + ) ) ) (if @@ -242,8 +250,10 @@ (local.get $Double) (i32.const 0) ) - (br $topmost - (f64.const 5.6) + (then + (br $topmost + (f64.const 5.6) + ) ) ) (if @@ -251,8 +261,10 @@ (local.get $x) (local.get $y) ) - (br $topmost - (local.get $x) + (then + (br $topmost + (local.get $x) + ) ) ) (local.get $y) @@ -899,8 +911,12 @@ (f64.abs (if ;; note no type - valid in binaryen IR, in wasm must be i32 (i32.const 3) - (return (i32.const 2)) - (return (i32.const 1)) + (then + (return (i32.const 2)) + ) + (else + (return (i32.const 1)) + ) ) ) ) @@ -919,8 +935,12 @@ (func $unreachable-if-toplevel (result i32) (if ;; note no type - valid in binaryen IR, in wasm must be i32 (i32.const 3) - (return (i32.const 2)) - (return (i32.const 1)) + (then + (return (i32.const 2)) + ) + (else + (return (i32.const 1)) + ) ) ) @@ -986,16 +1006,16 @@ ;; CHECK-NEXT: unreachable ;; CHECK-NEXT: ) (func $unreachable-ifs - (if (unreachable) (nop)) - (if (unreachable) (unreachable)) - (if (unreachable) (nop) (nop)) - (if (unreachable) (unreachable) (nop)) - (if (unreachable) (nop) (unreachable)) - (if (unreachable) (unreachable) (unreachable)) + (if (unreachable) (then (nop))) + (if (unreachable) (then (unreachable))) + (if (unreachable) (then (nop) )(else (nop))) + (if (unreachable) (then (unreachable) )(else (nop))) + (if (unreachable) (then (nop) )(else (unreachable))) + (if (unreachable) (then (unreachable) )(else (unreachable))) ;; - (if (i32.const 1) (unreachable) (nop)) - (if (i32.const 1) (nop) (unreachable)) - (if (i32.const 1) (unreachable) (unreachable)) + (if (i32.const 1) (then (unreachable) )(else (nop))) + (if (i32.const 1) (then (nop) )(else (unreachable))) + (if (i32.const 1) (then (unreachable) )(else (unreachable))) ) ;; CHECK: (func $unreachable-if-arm (type $FUNCSIG$v) @@ -1008,13 +1028,17 @@ (func $unreachable-if-arm (if (i32.const 1) - (block - (nop) + (then + (block + (nop) + ) ) - (block - (unreachable) - (drop - (i32.const 1) + (else + (block + (unreachable) + (drop + (i32.const 1) + ) ) ) ) @@ -1137,8 +1161,12 @@ (func $local-to-stack-3-no (param $x i32) (result i32) (local $temp i32) (if (i32.const 1) - (local.set $temp (call $local-to-stack (i32.const 1))) - (local.set $temp (call $local-to-stack (i32.const 2))) ;; two sets for that get + (then + (local.set $temp (call $local-to-stack (i32.const 1))) + ) + (else + (local.set $temp (call $local-to-stack (i32.const 2))) ;; two sets for that get + ) ) (drop (call $local-to-stack (i32.const 3))) (local.get $temp) @@ -1338,7 +1366,7 @@ (local $temp2 i32) (local.set $temp2 (call $local-to-stack-multi-4 (i32.const 0))) (local.set $temp1 (call $local-to-stack-multi-4 (i32.const 1))) - (if (i32.const 0) (nop)) + (if (i32.const 0) (then (nop))) (drop (local.get $temp1)) (local.set $temp1 (call $local-to-stack-multi-4 (i32.const 2))) (block $block (br $block)) @@ -1362,13 +1390,17 @@ (func $local-to-stack-in-control-flow (local $temp1 i32) (if (i32.const 0) - (block - (local.set $temp1 (call $local-to-stack-multi-4 (i32.const 0))) - (drop (local.get $temp1)) + (then + (block + (local.set $temp1 (call $local-to-stack-multi-4 (i32.const 0))) + (drop (local.get $temp1)) + ) ) - (block - (local.set $temp1 (call $local-to-stack-multi-4 (i32.const 1))) - (drop (local.get $temp1)) + (else + (block + (local.set $temp1 (call $local-to-stack-multi-4 (i32.const 1))) + (drop (local.get $temp1)) + ) ) ) ) diff --git a/test/lit/passes/outlining.wast b/test/lit/passes/outlining.wast index 349513dde..ee6dd5d90 100644 --- a/test/lit/passes/outlining.wast +++ b/test/lit/passes/outlining.wast @@ -255,8 +255,10 @@ ;; CHECK: (func $a (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $outline$) - ;; CHECK-NEXT: (global.set $global$1 - ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $global$1 + ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -265,16 +267,20 @@ (i32.eqz (global.get $global$1) ) - (global.set $global$1 - (i32.const 15) + (then + (global.set $global$1 + (i32.const 15) + ) ) ) ) ;; CHECK: (func $b (type $0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $outline$) - ;; CHECK-NEXT: (global.set $global$1 - ;; CHECK-NEXT: (i32.const 20) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $global$1 + ;; CHECK-NEXT: (i32.const 20) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -283,8 +289,10 @@ (i32.eqz (global.get $global$1) ) - (global.set $global$1 - (i32.const 20) + (then + (global.set $global$1 + (i32.const 20) + ) ) ) ) @@ -307,7 +315,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $outline$) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $outline$) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $a (param i32) @@ -315,8 +325,10 @@ (i32.eqz (local.get 0) ) - (drop - (i32.const 10) + (then + (drop + (i32.const 10) + ) ) ) ) @@ -325,7 +337,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $outline$) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $outline$) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $b (param i32) @@ -333,8 +347,10 @@ (i32.eqz (local.get 0) ) - (drop - (i32.const 10) + (then + (drop + (i32.const 10) + ) ) ) ) @@ -357,10 +373,14 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.set $global$1 - ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $global$1 + ;; CHECK-NEXT: (i32.const 15) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $outline$) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $outline$) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $a @@ -368,12 +388,16 @@ (i32.eqz (global.get $global$1) ) - (global.set $global$1 - (i32.const 15) - ) - (block + (then (global.set $global$1 - (i32.const 100) + (i32.const 15) + ) + ) + (else + (block + (global.set $global$1 + (i32.const 100) + ) ) ) ) @@ -383,10 +407,14 @@ ;; CHECK-NEXT: (i32.ctz ;; CHECK-NEXT: (global.get $global$1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.set $global$1 - ;; CHECK-NEXT: (i32.const 30) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $global$1 + ;; CHECK-NEXT: (i32.const 30) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $outline$) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $outline$) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $b @@ -394,12 +422,16 @@ (i32.ctz (global.get $global$1) ) - (global.set $global$1 - (i32.const 30) - ) - (block + (then (global.set $global$1 - (i32.const 100) + (i32.const 30) + ) + ) + (else + (block + (global.set $global$1 + (i32.const 100) + ) ) ) ) @@ -421,8 +453,12 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $global$1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $outline$_3) - ;; CHECK-NEXT: (call $outline$_4) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $outline$_3) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $outline$_4) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -446,11 +482,15 @@ (i32.eqz (global.get $global$1) ) - (drop - (i32.const 10) + (then + (drop + (i32.const 10) + ) ) - (global.set $global$1 - (i32.const 20) + (else + (global.set $global$1 + (i32.const 20) + ) ) ) ) @@ -462,11 +502,15 @@ (i32.eqz (global.get $global$1) ) - (drop - (i32.const 10) + (then + (drop + (i32.const 10) + ) ) - (global.set $global$1 - (i32.const 20) + (else + (global.set $global$1 + (i32.const 20) + ) ) ) ) diff --git a/test/lit/passes/poppify.wast b/test/lit/passes/poppify.wast index 38bc920aa..93a0353e3 100644 --- a/test/lit/passes/poppify.wast +++ b/test/lit/passes/poppify.wast @@ -184,13 +184,17 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (pop i32) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if (if (i32.const 0) - (nop) + (then + (nop) + ) ) ) @@ -198,15 +202,23 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (pop i32) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else (result i32) (if i32 (i32.const 0) - (i32.const 1) - (i32.const 2) + (then + (i32.const 1) + ) + (else + (i32.const 2) + ) ) ) diff --git a/test/lit/passes/precompute-gc-immutable.wast b/test/lit/passes/precompute-gc-immutable.wast index 0ae99b26a..c2a96bd23 100644 --- a/test/lit/passes/precompute-gc-immutable.wast +++ b/test/lit/passes/precompute-gc-immutable.wast @@ -160,14 +160,18 @@ ;; CHECK-NEXT: (local $ref-imm (ref null $struct-imm)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.set $ref-imm - ;; CHECK-NEXT: (struct.new $struct-imm - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $ref-imm + ;; CHECK-NEXT: (struct.new $struct-imm + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $ref-imm - ;; CHECK-NEXT: (struct.new $struct-imm - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $ref-imm + ;; CHECK-NEXT: (struct.new $struct-imm + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -183,14 +187,18 @@ ;; different values. (if (local.get $x) - (local.set $ref-imm - (struct.new $struct-imm - (i32.const 1) + (then + (local.set $ref-imm + (struct.new $struct-imm + (i32.const 1) + ) ) ) - (local.set $ref-imm - (struct.new $struct-imm - (i32.const 2) + (else + (local.set $ref-imm + (struct.new $struct-imm + (i32.const 2) + ) ) ) ) @@ -205,14 +213,18 @@ ;; CHECK-NEXT: (local $ref-imm (ref null $struct-imm)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.set $ref-imm - ;; CHECK-NEXT: (struct.new $struct-imm - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $ref-imm + ;; CHECK-NEXT: (struct.new $struct-imm + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $ref-imm - ;; CHECK-NEXT: (struct.new $struct-imm - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $ref-imm + ;; CHECK-NEXT: (struct.new $struct-imm + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -230,14 +242,18 @@ ;; possible values). (if (local.get $x) - (local.set $ref-imm - (struct.new $struct-imm - (i32.const 1) + (then + (local.set $ref-imm + (struct.new $struct-imm + (i32.const 1) + ) ) ) - (local.set $ref-imm - (struct.new $struct-imm - (i32.const 1) + (else + (local.set $ref-imm + (struct.new $struct-imm + (i32.const 1) + ) ) ) ) @@ -252,7 +268,7 @@ ;; CHECK-NEXT: (local $ref-imm (ref null $struct-imm)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $ref-imm ;; CHECK-NEXT: (struct.new $struct-imm ;; CHECK-NEXT: (i32.const 1) @@ -262,7 +278,7 @@ ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (local.set $ref-imm ;; CHECK-NEXT: (struct.new $struct-imm ;; CHECK-NEXT: (i32.const 2) @@ -280,27 +296,31 @@ ;; reused. (if (local.get $x) - (block - (local.set $ref-imm - (struct.new $struct-imm - (i32.const 1) + (then + (block + (local.set $ref-imm + (struct.new $struct-imm + (i32.const 1) + ) ) - ) - (call $helper - (struct.get $struct-imm 0 - (local.get $ref-imm) + (call $helper + (struct.get $struct-imm 0 + (local.get $ref-imm) + ) ) ) ) - (block - (local.set $ref-imm - (struct.new $struct-imm - (i32.const 2) + (else + (block + (local.set $ref-imm + (struct.new $struct-imm + (i32.const 2) + ) ) - ) - (call $helper - (struct.get $struct-imm 0 - (local.get $ref-imm) + (call $helper + (struct.get $struct-imm 0 + (local.get $ref-imm) + ) ) ) ) diff --git a/test/lit/passes/precompute-gc.wast b/test/lit/passes/precompute-gc.wast index 1c99d6e98..29f64ba07 100644 --- a/test/lit/passes/precompute-gc.wast +++ b/test/lit/passes/precompute-gc.wast @@ -125,14 +125,18 @@ ;; CHECK-NEXT: (local $x (ref null $struct)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $i) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (struct.new $struct - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (struct.new $struct + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (struct.new $struct - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (struct.new $struct + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -147,14 +151,18 @@ ;; a merge of two different $x values cannot be precomputed (if (local.get $i) - (local.set $x - (struct.new $struct - (i32.const 1) + (then + (local.set $x + (struct.new $struct + (i32.const 1) + ) ) ) - (local.set $x - (struct.new $struct - (i32.const 2) + (else + (local.set $x + (struct.new $struct + (i32.const 2) + ) ) ) ) @@ -466,8 +474,10 @@ ;; CHECK-NEXT: (call $helper ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $tempref - ;; CHECK-NEXT: (struct.new_default $empty) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $tempref + ;; CHECK-NEXT: (struct.new_default $empty) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $tempresult @@ -494,8 +504,10 @@ (call $helper (i32.const 0) ) - (local.set $tempref - (struct.new $empty) + (then + (local.set $tempref + (struct.new $empty) + ) ) ) (local.set $tempresult @@ -669,8 +681,10 @@ ;; CHECK-NEXT: (call $helper ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.set $tempref - ;; CHECK-NEXT: (struct.new_default $empty) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $tempref + ;; CHECK-NEXT: (struct.new_default $empty) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $stashedref @@ -702,8 +716,10 @@ (call $helper (i32.const 0) ) - (local.set $tempref - (struct.new $empty) + (then + (local.set $tempref + (struct.new $empty) + ) ) ) (local.set $stashedref @@ -898,8 +914,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $param) - ;; CHECK-NEXT: (local.set $ref - ;; CHECK-NEXT: (struct.new_default $empty) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $ref + ;; CHECK-NEXT: (struct.new_default $empty) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -938,8 +956,10 @@ ) (if (local.get $param) - (local.set $ref - (struct.new $empty) + (then + (local.set $ref + (struct.new $empty) + ) ) ) (drop @@ -1041,7 +1061,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -1062,7 +1084,9 @@ ;; later block. (if (i32.const 1) - (unreachable) + (then + (unreachable) + ) ) (local.get $x) ) @@ -1105,7 +1129,9 @@ ;; CHECK-NEXT: (local $0 (ref any)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: (local.set $0 @@ -1126,7 +1152,9 @@ ;; Otherwise this is the same as before. (if (local.get $x) - (nop) + (then + (nop) + ) ) (unreachable) (local.set $0 @@ -1149,7 +1177,9 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -1162,7 +1192,9 @@ ) (if (i32.const 1) - (unreachable) + (then + (unreachable) + ) ) (local.get $x) ) diff --git a/test/lit/passes/remove-unused-brs-gc.wast b/test/lit/passes/remove-unused-brs-gc.wast index 7a620193e..84c16cab2 100644 --- a/test/lit/passes/remove-unused-brs-gc.wast +++ b/test/lit/passes/remove-unused-brs-gc.wast @@ -36,8 +36,12 @@ ;; (that is not specifically intended to be tested here). (if (result (ref struct)) (i32.const 0) - (local.get $0) - (local.get $0) + (then + (local.get $0) + ) + (else + (local.get $0) + ) ) ) ) @@ -639,36 +643,48 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (ref.test (ref none) - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (ref.test (ref none) + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result nullref) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (ref.null none) - ;; CHECK-NEXT: (ref.cast nullref + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (ref.cast nullref + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result (ref null $struct)) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block $something (result (ref null $struct)) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (block (result nullref) - ;; CHECK-NEXT: (br_on_non_null $something - ;; CHECK-NEXT: (local.get $struct) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $something (result (ref null $struct)) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (block (result nullref) + ;; CHECK-NEXT: (br_on_non_null $something + ;; CHECK-NEXT: (local.get $struct) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (ref.null none) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -699,19 +715,27 @@ (drop (if (result i32) (local.get $x) - (ref.test (ref $struct) - (ref.null any) + (then + (ref.test (ref $struct) + (ref.null any) + ) + ) + (else + (i32.const 0) ) - (i32.const 0) ) ) (drop (if (result anyref) (local.get $x) - (ref.null any) - (ref.cast (ref null $struct) + (then (ref.null any) ) + (else + (ref.cast (ref null $struct) + (ref.null any) + ) + ) ) ) ;; We do not selectify here because the amount of work in the if is @@ -719,34 +743,42 @@ (drop (if (result anyref) (local.get $x) - (block (result anyref) - (block $something (result anyref) - (drop - (br_on_cast $something anyref (ref $struct) - (local.get $struct) + (then + (block (result anyref) + (block $something (result anyref) + (drop + (br_on_cast $something anyref (ref $struct) + (local.get $struct) + ) ) + (ref.null any) ) - (ref.null any) ) ) - (ref.null any) + (else + (ref.null any) + ) ) ) ;; However, null checks are fairly fast, and we will emit a select here. (drop (if (result anyref) (local.get $x) - (block (result anyref) - (block $nothing - (drop - (br_on_null $nothing - (ref.null $struct) + (then + (block (result anyref) + (block $nothing + (drop + (br_on_null $nothing + (ref.null $struct) + ) ) ) + (ref.null any) ) + ) + (else (ref.null any) ) - (ref.null any) ) ) ) diff --git a/test/lit/passes/remove-unused-brs.wast b/test/lit/passes/remove-unused-brs.wast index 6907547c3..6fcc5b066 100644 --- a/test/lit/passes/remove-unused-brs.wast +++ b/test/lit/passes/remove-unused-brs.wast @@ -17,11 +17,15 @@ (func $selectify-fresh-lub (param $x i32) (result anyref) (if (local.get $x) - (return - (ref.null none) + (then + (return + (ref.null none) + ) ) - (return - (ref.i31 (i32.const 0)) + (else + (return + (ref.i31 (i32.const 0)) + ) ) ) ) @@ -54,13 +58,17 @@ ) (i32.const 10) ) - (i32.const 1) - (i32.lt_u - (i32.sub - (local.get $0) - (i32.const 97) + (then + (i32.const 1) + ) + (else + (i32.lt_u + (i32.sub + (local.get $0) + (i32.const 97) + ) + (i32.const 6) ) - (i32.const 6) ) ) ) @@ -68,13 +76,17 @@ ;; CHECK: (func $restructure-br_if (type $0) (param $x i32) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: (block $x (result i32) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 200) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 100) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $x (result i32) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 200) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 300) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 300) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -104,13 +116,17 @@ ;; CHECK-NEXT: (call $nothing) ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 100) - ;; CHECK-NEXT: (block $x (result i32) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 200) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 100) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $x (result i32) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 200) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (i32.const 300) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 300) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -382,7 +398,9 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $if-of-if) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $if-of-if) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-of-if @@ -393,9 +411,13 @@ (local.tee $x (i32.const 1) ) - (if - (local.get $x) - (call $if-of-if) + (then + (if + (local.get $x) + (then + (call $if-of-if) + ) + ) ) ) ) @@ -406,11 +428,15 @@ ;; CHECK-NEXT: (local.tee $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.tee $x - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.tee $x + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $if-of-if-but-side-effects) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $if-of-if-but-side-effects) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -422,11 +448,15 @@ (local.tee $x (i32.const 1) ) - (if - (local.tee $x - (i32.const 2) + (then + (if + (local.tee $x + (i32.const 2) + ) + (then + (call $if-of-if-but-side-effects) + ) ) - (call $if-of-if-but-side-effects) ) ) ) @@ -437,8 +467,8 @@ ;; CHECK-NEXT: (local.tee $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (i32.eqz @@ -447,7 +477,9 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -456,8 +488,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $if-of-if-but-too-costly) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $if-of-if-but-too-costly) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -469,11 +503,15 @@ (local.tee $x (i32.const 1) ) - (if - (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz - (local.get $x) - ))))))))) - (call $if-of-if-but-too-costly) + (then + (if + (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz (i32.eqz + (local.get $x) + ))))))))) + (then + (call $if-of-if-but-too-costly) + ) + ) ) ) ) @@ -484,10 +522,16 @@ ;; CHECK-NEXT: (local.tee $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (call $if-of-if-but-inner-else) - ;; CHECK-NEXT: (call $if-of-if) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $if-of-if-but-inner-else) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $if-of-if) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -498,10 +542,16 @@ (local.tee $x (i32.const 1) ) - (if - (local.get $x) - (call $if-of-if-but-inner-else) - (call $if-of-if) + (then + (if + (local.get $x) + (then + (call $if-of-if-but-inner-else) + ) + (else + (call $if-of-if) + ) + ) ) ) ) @@ -512,11 +562,17 @@ ;; CHECK-NEXT: (local.tee $x ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (call $if-of-if-but-outer-else) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $if-of-if-but-outer-else) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $if-of-if) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $if-of-if) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-of-if-but-outer-else @@ -526,11 +582,17 @@ (local.tee $x (i32.const 1) ) - (if - (local.get $x) - (call $if-of-if-but-outer-else) + (then + (if + (local.get $x) + (then + (call $if-of-if-but-outer-else) + ) + ) + ) + (else + (call $if-of-if) ) - (call $if-of-if) ) ) ) diff --git a/test/lit/passes/remove-unused-brs_all-features.wast b/test/lit/passes/remove-unused-brs_all-features.wast index 344fbe12f..98f020274 100644 --- a/test/lit/passes/remove-unused-brs_all-features.wast +++ b/test/lit/passes/remove-unused-brs_all-features.wast @@ -33,25 +33,33 @@ ;; CHECK: (func $foo (type $3) (result (ref null $struct)) ;; CHECK-NEXT: (if (result (ref null $struct)) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (struct.new $struct - ;; CHECK-NEXT: (array.new_default $vector - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (struct.new $struct + ;; CHECK-NEXT: (array.new_default $vector + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $foo (result (ref null $struct)) (if (result (ref null $struct)) (i32.const 1) - (struct.new $struct - ;; regression test for computing the cost of an array.new_default, which - ;; lacks the optional field "init" - (array.new_default $vector - (i32.const 1) + (then + (struct.new $struct + ;; regression test for computing the cost of an array.new_default, which + ;; lacks the optional field "init" + (array.new_default $vector + (i32.const 1) + ) ) ) - (ref.null $struct) + (else + (ref.null $struct) + ) ) ) @@ -59,15 +67,19 @@ ;; CHECK-NEXT: (loop $loop (result f64) ;; CHECK-NEXT: (if (result f64) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (f64.const 0) - ;; CHECK-NEXT: (block $block (result f64) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (br_if $loop - ;; CHECK-NEXT: (i32.eqz - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $block (result f64) + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (br_if $loop + ;; CHECK-NEXT: (i32.eqz + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -83,7 +95,9 @@ ) (if (i32.const 0) - (unreachable) + (then + (unreachable) + ) ) ;; this will be moved from $block into the if right before it. we must be ;; careful to properly finalize() things, as if we finalize the block too @@ -117,8 +131,12 @@ ;; LUB (if (result funcref) (local.get $x) - (ref.func $none_=>_i32) - (ref.func $i32_=>_none) + (then + (ref.func $none_=>_i32) + ) + (else + (ref.func $i32_=>_none) + ) ) ) diff --git a/test/lit/passes/remove-unused-brs_levels.wast b/test/lit/passes/remove-unused-brs_levels.wast index f4737627e..927cce867 100644 --- a/test/lit/passes/remove-unused-brs_levels.wast +++ b/test/lit/passes/remove-unused-brs_levels.wast @@ -11,11 +11,15 @@ ;; SHRINK_0-NEXT: (local.get $x) ;; SHRINK_0-NEXT: (i32.const 53498923) ;; SHRINK_0-NEXT: ) - ;; SHRINK_0-NEXT: (i32.div_s + ;; SHRINK_0-NEXT: (then + ;; SHRINK_0-NEXT: (i32.div_s + ;; SHRINK_0-NEXT: (local.get $x) + ;; SHRINK_0-NEXT: (i32.const 13) + ;; SHRINK_0-NEXT: ) + ;; SHRINK_0-NEXT: ) + ;; SHRINK_0-NEXT: (else ;; SHRINK_0-NEXT: (local.get $x) - ;; SHRINK_0-NEXT: (i32.const 13) ;; SHRINK_0-NEXT: ) - ;; SHRINK_0-NEXT: (local.get $x) ;; SHRINK_0-NEXT: ) ;; SHRINK_0-NEXT: ) ;; SHRINK_1: (func $selectify-division (type $0) (param $x i32) (result i32) @@ -52,11 +56,15 @@ (local.get $x) (i32.const 53498923) ) - (i32.div_s + (then + (i32.div_s + (local.get $x) + (i32.const 13) + ) + ) + (else (local.get $x) - (i32.const 13) ) - (local.get $x) ) ) @@ -66,14 +74,18 @@ ;; SHRINK_0-NEXT: (local.get $x) ;; SHRINK_0-NEXT: (i32.const 53498923) ;; SHRINK_0-NEXT: ) - ;; SHRINK_0-NEXT: (i32.div_s + ;; SHRINK_0-NEXT: (then ;; SHRINK_0-NEXT: (i32.div_s - ;; SHRINK_0-NEXT: (local.get $x) + ;; SHRINK_0-NEXT: (i32.div_s + ;; SHRINK_0-NEXT: (local.get $x) + ;; SHRINK_0-NEXT: (i32.const 13) + ;; SHRINK_0-NEXT: ) ;; SHRINK_0-NEXT: (i32.const 13) ;; SHRINK_0-NEXT: ) - ;; SHRINK_0-NEXT: (i32.const 13) ;; SHRINK_0-NEXT: ) - ;; SHRINK_0-NEXT: (local.get $x) + ;; SHRINK_0-NEXT: (else + ;; SHRINK_0-NEXT: (local.get $x) + ;; SHRINK_0-NEXT: ) ;; SHRINK_0-NEXT: ) ;; SHRINK_0-NEXT: ) ;; SHRINK_1: (func $selectify-division2 (type $0) (param $x i32) (result i32) @@ -82,14 +94,18 @@ ;; SHRINK_1-NEXT: (local.get $x) ;; SHRINK_1-NEXT: (i32.const 53498923) ;; SHRINK_1-NEXT: ) - ;; SHRINK_1-NEXT: (i32.div_s + ;; SHRINK_1-NEXT: (then ;; SHRINK_1-NEXT: (i32.div_s - ;; SHRINK_1-NEXT: (local.get $x) + ;; SHRINK_1-NEXT: (i32.div_s + ;; SHRINK_1-NEXT: (local.get $x) + ;; SHRINK_1-NEXT: (i32.const 13) + ;; SHRINK_1-NEXT: ) ;; SHRINK_1-NEXT: (i32.const 13) ;; SHRINK_1-NEXT: ) - ;; SHRINK_1-NEXT: (i32.const 13) ;; SHRINK_1-NEXT: ) - ;; SHRINK_1-NEXT: (local.get $x) + ;; SHRINK_1-NEXT: (else + ;; SHRINK_1-NEXT: (local.get $x) + ;; SHRINK_1-NEXT: ) ;; SHRINK_1-NEXT: ) ;; SHRINK_1-NEXT: ) ;; SHRINK_2: (func $selectify-division2 (type $0) (param $x i32) (result i32) @@ -116,14 +132,18 @@ (local.get $x) (i32.const 53498923) ) - (i32.div_s + (then (i32.div_s - (local.get $x) + (i32.div_s + (local.get $x) + (i32.const 13) + ) (i32.const 13) ) - (i32.const 13) ) - (local.get $x) + (else + (local.get $x) + ) ) ) ) diff --git a/test/lit/passes/remove-unused-module-elements_all-features.wast b/test/lit/passes/remove-unused-module-elements_all-features.wast index f287df88f..c964d8c28 100644 --- a/test/lit/passes/remove-unused-module-elements_all-features.wast +++ b/test/lit/passes/remove-unused-module-elements_all-features.wast @@ -576,8 +576,12 @@ (f64.const 1) (f64.const 1) ) - (f64.const 1) - (f64.const 0) + (then + (f64.const 1) + ) + (else + (f64.const 0) + ) ) ) ) @@ -590,8 +594,12 @@ (f64.const 1) (f64.const 1) ) - (call_indirect (type $0) (f64.const 1) (i32.const 0)) - (f64.const 0) + (then + (call_indirect (type $0) (f64.const 1) (i32.const 0)) + ) + (else + (f64.const 0) + ) ) ) ) @@ -634,8 +642,12 @@ ;; CHECK-NEXT: (f64.const 1) ;; CHECK-NEXT: (f64.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (f64.const 1) - ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (f64.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (f64.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $0 (; 0 ;) (type $0) (param $var$0 f64) (result f64) @@ -649,8 +661,12 @@ (f64.const 1) (f64.const 1) ) - (f64.const 1) - (f64.const 0) + (then + (f64.const 1) + ) + (else + (f64.const 0) + ) ) ) ) diff --git a/test/lit/passes/rse-gc.wast b/test/lit/passes/rse-gc.wast index 367f3ce18..4bef953b9 100644 --- a/test/lit/passes/rse-gc.wast +++ b/test/lit/passes/rse-gc.wast @@ -64,11 +64,15 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $B) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $B) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (local.get $B) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (local.get $B) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -95,11 +99,15 @@ ) (if (local.get $x) - (drop - (local.get $A) + (then + (drop + (local.get $A) + ) ) - (drop - (local.get $B) + (else + (drop + (local.get $B) + ) ) ) (drop diff --git a/test/lit/passes/signature-refining.wast b/test/lit/passes/signature-refining.wast index 3b0cf1198..103cbe7f9 100644 --- a/test/lit/passes/signature-refining.wast +++ b/test/lit/passes/signature-refining.wast @@ -569,17 +569,25 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result (ref $struct)) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call $func-can-refine) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $func-can-refine) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result (ref $struct)) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (call_ref $sig-can-refine - ;; CHECK-NEXT: (ref.func $func-can-refine) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call_ref $sig-can-refine + ;; CHECK-NEXT: (ref.func $func-can-refine) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -590,18 +598,26 @@ (drop (if (result anyref) (i32.const 1) - (call $func-can-refine) - (unreachable) + (then + (call $func-can-refine) + ) + (else + (unreachable) + ) ) ) ;; The same with a call_ref. (drop (if (result anyref) (i32.const 1) - (call_ref $sig-can-refine - (ref.func $func-can-refine) + (then + (call_ref $sig-can-refine + (ref.func $func-can-refine) + ) + ) + (else + (unreachable) ) - (unreachable) ) ) ) @@ -641,8 +657,10 @@ ;; CHECK: (func $func-4 (type $sig) (result (ref null $struct)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (return - ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (ref.null none) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (unreachable) @@ -650,8 +668,10 @@ (func $func-4 (type $sig) (result anyref) (if (i32.const 1) - (return - (ref.null any) + (then + (return + (ref.null any) + ) ) ) (unreachable) diff --git a/test/lit/passes/simplify-globals-dominance.wast b/test/lit/passes/simplify-globals-dominance.wast index 3756a4a7e..dddcaa983 100644 --- a/test/lit/passes/simplify-globals-dominance.wast +++ b/test/lit/passes/simplify-globals-dominance.wast @@ -14,7 +14,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 10) ;; CHECK-NEXT: ) @@ -23,8 +23,10 @@ ;; CHECK-NEXT: (global.get $global) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (global.get $global) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (global.get $global) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -34,22 +36,26 @@ ) (if (i32.const 0) - (block - ;; This is dominated by the set, so we can apply 10 here. - (drop - (global.get $global) + (then + (block + ;; This is dominated by the set, so we can apply 10 here. + (drop + (global.get $global) + ) + (call $test) + ;; This is after a call, so we do nothing (we are still dominated by the + ;; global.set, but the call might set the global to another value). + (drop + (global.get $global) + ) ) - (call $test) - ;; This is after a call, so we do nothing (we are still dominated by the - ;; global.set, but the call might set the global to another value). + ) + ;; This is dominated by the set, but we do not optimize it yet. TODO + (else (drop (global.get $global) ) ) - ;; This is dominated by the set, but we do not optimize it yet. TODO - (drop - (global.get $global) - ) ) ) ) diff --git a/test/lit/passes/simplify-globals-read_only_to_write.wast b/test/lit/passes/simplify-globals-read_only_to_write.wast index cf783ee4b..e1f27327c 100644 --- a/test/lit/passes/simplify-globals-read_only_to_write.wast +++ b/test/lit/passes/simplify-globals-read_only_to_write.wast @@ -12,15 +12,19 @@ ;; CHECK: (func $simple ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $simple (if (global.get $global) - (global.set $global (i32.const 1)) + (then + (global.set $global (i32.const 1)) + ) ) ) ;; CHECK: (func $more-with-no-side-effects @@ -28,7 +32,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) @@ -43,9 +47,11 @@ (global.get $global) ) ;; Also test for other operations in the body, with no effects. - (block - (nop) - (global.set $global (i32.const 1)) + (then + (block + (nop) + (global.set $global (i32.const 1)) + ) ) ) ) @@ -69,8 +75,10 @@ ;; CHECK: (func $additional-read ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global) - ;; CHECK-NEXT: (global.set $global - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $global + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -80,7 +88,9 @@ (func $additional-read (if (global.get $global) - (global.set $global (i32.const 1)) + (then + (global.set $global (i32.const 1)) + ) ) (drop (global.get $global) @@ -96,17 +106,25 @@ ;; CHECK: (func $if-else ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global) - ;; CHECK-NEXT: (global.set $global - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $global + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else (if (global.get $global) - (global.set $global (i32.const 1)) - (nop) + (then + (global.set $global (i32.const 1)) + ) + (else + (nop) + ) ) ) ) @@ -121,7 +139,7 @@ ;; CHECK: (func $side-effects-in-body ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $global) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $global ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) @@ -137,10 +155,12 @@ (func $side-effects-in-body (if (global.get $global) - (block - (global.set $global (i32.const 1)) - (global.set $other (i32.const 2)) - (drop (global.get $other)) + (then + (block + (global.set $global (i32.const 1)) + (global.set $other (i32.const 2)) + (drop (global.get $other)) + ) ) ) ) @@ -159,17 +179,19 @@ ;; CHECK: (func $nested ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop @@ -183,18 +205,24 @@ (func $nested (if (global.get $a) - (block - (global.set $a (i32.const 1)) - (if - (global.get $b) - (block - (if - (global.get $c) + (then + (block + (global.set $a (i32.const 1)) + (if + (global.get $b) + (then (block - (global.set $c (i32.const 2)) + (if + (global.get $c) + (then + (block + (global.set $c (i32.const 2)) + ) + ) + ) + (global.set $b (i32.const 3)) ) ) - (global.set $b (i32.const 3)) ) ) ) @@ -211,7 +239,9 @@ ;; CHECK: (func $clinit ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (i32.const 1) @@ -223,7 +253,9 @@ ;; in the if body in this case. (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1) @@ -240,7 +272,9 @@ ;; CHECK: (func $clinit ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -252,7 +286,9 @@ ;; many elements - a nop is added at the end. (if (global.get $once) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1) @@ -270,8 +306,12 @@ ;; CHECK: (func $clinit ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (return) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -281,8 +321,12 @@ ;; As above, but the optimization fails because the if has an else. (if (global.get $once) - (return) - (nop) + (then + (return) + ) + (else + (nop) + ) ) (global.set $once (i32.const 1) @@ -299,7 +343,9 @@ ;; CHECK: (func $clinit ;; CHECK-NEXT: (if ;; CHECK-NEXT: (global.get $once) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -310,7 +356,9 @@ ;; return. (if (global.get $once) - (nop) + (then + (nop) + ) ) (global.set $once (i32.const 1) @@ -331,7 +379,9 @@ ;; CHECK-NEXT: (call $foo ;; CHECK-NEXT: (global.get $once) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (return) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $once ;; CHECK-NEXT: (i32.const 1) @@ -344,7 +394,9 @@ ;; value, which is dangerous. (global.get $once) ) - (return) + (then + (return) + ) ) (global.set $once (i32.const 1) @@ -374,11 +426,17 @@ ;; CHECK-NEXT: (if ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (global.get $global) - ;; CHECK-NEXT: (call $foo) - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $foo) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.set $global - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $global + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -386,10 +444,16 @@ (if (if (result i32) (global.get $global) ;; the global's value may cause foo() to be called - (call $foo) - (i32.const 1) + (then + (call $foo) + ) + (else + (i32.const 1) + ) + ) + (then + (global.set $global (i32.const 1)) ) - (global.set $global (i32.const 1)) ) ) @@ -416,11 +480,17 @@ ;; CHECK-NEXT: (if ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (call $foo) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -429,11 +499,17 @@ (if (result i32) (call $foo) ;; these side effects are not a problem, as the global's ;; value cannot reach them. - (i32.const 1) - (global.get $global) ;; the global's value flows out through the if, + (then + (i32.const 1) + ) + (else + (global.get $global) ;; the global's value flows out through the if, + ) ;; safely ) - (global.set $global (i32.const 1)) + (then + (global.set $global (i32.const 1)) + ) ) ) @@ -459,8 +535,10 @@ ;; CHECK-NEXT: (local.tee $temp ;; CHECK-NEXT: (global.get $global) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.set $global - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $global + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -470,7 +548,9 @@ (local.tee $temp (global.get $global) ;; the global's value flows into a place that has ) ;; side effects, so it may be noticed. - (global.set $global (i32.const 1)) + (then + (global.set $global (i32.const 1)) + ) ) ) ) @@ -505,8 +585,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -528,8 +610,10 @@ ) ) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) ) @@ -554,8 +638,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.eq @@ -563,8 +649,10 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -579,8 +667,10 @@ (i32.eqz (global.get $once) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) (i32.eq @@ -588,8 +678,10 @@ (i32.const 0) ) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) ) @@ -614,18 +706,24 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $once) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.set $once - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $once + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.eq ;; CHECK-NEXT: (global.get $once) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.set $once - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $once + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -640,18 +738,24 @@ (i32.eqz (global.get $once) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) + ) + (else + (nop) ;; This breaks the pattern we are looking for. ) - (nop) ;; This breaks the pattern we are looking for. ) (i32.eq (global.get $once) (i32.const 0) ) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) ) @@ -677,15 +781,19 @@ ;; CHECK-NEXT: (block (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.eq @@ -693,8 +801,10 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -709,15 +819,19 @@ ;; A third nested appearance. (if (global.get $once) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) (global.get $once) ) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) (i32.eq @@ -725,8 +839,10 @@ (i32.const 0) ) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) ) @@ -754,8 +870,10 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $once) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.set $once - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $once + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.eq @@ -763,8 +881,10 @@ ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (global.set $once - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (global.set $once + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -788,8 +908,10 @@ (i32.eqz (global.get $once) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) (i32.eq @@ -797,8 +919,10 @@ (i32.const 0) ) ) - (global.set $once - (i32.const 1) + (then + (global.set $once + (i32.const 1) + ) ) ) ) diff --git a/test/lit/passes/simplify-locals-eh.wast b/test/lit/passes/simplify-locals-eh.wast index 36bd11083..5e4a395d3 100644 --- a/test/lit/passes/simplify-locals-eh.wast +++ b/test/lit/passes/simplify-locals-eh.wast @@ -196,7 +196,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $p) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -204,7 +204,7 @@ ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) @@ -228,18 +228,22 @@ (drop (local.get $1)) (if (local.get $p) - (block - ;; We also optimize in this block, which is adjacent to the code before - ;; us. It is valid to optimize the 1 to a 0 here, as it is dominated by - ;; the code earlier. - (drop (local.get $0)) - (drop (local.get $1)) + (then + (block + ;; We also optimize in this block, which is adjacent to the code before + ;; us. It is valid to optimize the 1 to a 0 here, as it is dominated by + ;; the code earlier. + (drop (local.get $0)) + (drop (local.get $1)) + ) ) - (block - ;; We could also optimize here, but atm just look at code adjacent to - ;; its dominator. TODO - (drop (local.get $0)) - (drop (local.get $1)) + (else + (block + ;; We could also optimize here, but atm just look at code adjacent to + ;; its dominator. TODO + (drop (local.get $0)) + (drop (local.get $1)) + ) ) ) ;; As in the else, this could be optimized. TODO diff --git a/test/lit/passes/simplify-locals-gc-nn.wast b/test/lit/passes/simplify-locals-gc-nn.wast index df5148d12..32c881de8 100644 --- a/test/lit/passes/simplify-locals-gc-nn.wast +++ b/test/lit/passes/simplify-locals-gc-nn.wast @@ -154,7 +154,9 @@ ;; CHECK-NEXT: (local $temp ((ref func) nullref)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-return-tuple-nn @@ -165,10 +167,12 @@ ;; Instead, we can remove the local.set entirely, as it has no gets. (if (i32.const 0) - (local.set $temp - (tuple.make 2 - (ref.func $if-return-tuple-nn) - (ref.null none) + (then + (local.set $temp + (tuple.make 2 + (ref.func $if-return-tuple-nn) + (ref.null none) + ) ) ) ) diff --git a/test/lit/passes/simplify-locals-gc.wast b/test/lit/passes/simplify-locals-gc.wast index 2c5f56952..98d1f5925 100644 --- a/test/lit/passes/simplify-locals-gc.wast +++ b/test/lit/passes/simplify-locals-gc.wast @@ -166,8 +166,10 @@ ;; CHECK-NEXT: (local $x (ref func)) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (ref.func $if-nnl) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (ref.func $if-nnl) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $helper @@ -195,8 +197,10 @@ ;; do not optimize here. (if (i32.const 1) - (local.set $x - (ref.func $if-nnl) + (then + (local.set $x + (ref.func $if-nnl) + ) ) ) ;; An exta set + gets, just to avoid other optimizations kicking in @@ -219,8 +223,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (local.set $x - ;; CHECK-NEXT: (ref.func $if-nnl) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.set $x + ;; CHECK-NEXT: (ref.func $if-nnl) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (call $helper @@ -241,8 +247,10 @@ ) (if (i32.const 1) - (local.set $x - (ref.func $if-nnl) + (then + (local.set $x + (ref.func $if-nnl) + ) ) ) (call $helper diff --git a/test/lit/passes/simplify-locals-tnh.wast b/test/lit/passes/simplify-locals-tnh.wast index fa10c318d..21f4863c8 100644 --- a/test/lit/passes/simplify-locals-tnh.wast +++ b/test/lit/passes/simplify-locals-tnh.wast @@ -57,8 +57,10 @@ ;; TNH-NEXT: ) ;; TNH-NEXT: (if ;; TNH-NEXT: (i32.const 0) - ;; TNH-NEXT: (return - ;; TNH-NEXT: (i32.const 1) + ;; TNH-NEXT: (then + ;; TNH-NEXT: (return + ;; TNH-NEXT: (i32.const 1) + ;; TNH-NEXT: ) ;; TNH-NEXT: ) ;; TNH-NEXT: ) ;; TNH-NEXT: (local.get $temp) @@ -72,8 +74,10 @@ ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (i32.const 0) - ;; NO_TNH-NEXT: (return - ;; NO_TNH-NEXT: (i32.const 1) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (return + ;; NO_TNH-NEXT: (i32.const 1) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (local.get $temp) @@ -91,8 +95,10 @@ ) (if (i32.const 0) - (return - (i32.const 1) + (then + (return + (i32.const 1) + ) ) ) (local.get $temp) diff --git a/test/lit/passes/stack-check-memory64.wast b/test/lit/passes/stack-check-memory64.wast index 201910f36..137b156de 100644 --- a/test/lit/passes/stack-check-memory64.wast +++ b/test/lit/passes/stack-check-memory64.wast @@ -39,7 +39,9 @@ ;; CHECK-NEXT: (global.get $__stack_limit) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (global.set $sp ;; CHECK-NEXT: (local.get $0) @@ -63,30 +65,40 @@ (module ;; if the global names are taken we should not crash (memory i64 (data)) - ;; CHECK: (type $0 (func (param i64 i64))) + ;; CHECK: (type $0 (func (result i64))) + + ;; CHECK: (type $1 (func (param i64 i64))) ;; CHECK: (global $sp (mut i64) (i64.const 0)) - (global $sp (mut i64) (i64.const 0))) + (global $sp (mut i64) (i64.const 0)) ;; CHECK: (global $__stack_base (mut i64) (i64.const 0)) (global $__stack_base (mut i64) (i64.const 0)) ;; CHECK: (global $__stack_limit (mut i64) (i64.const 0)) (global $__stack_limit (mut i64) (i64.const 0)) + ;; CHECK: (global $__stack_base_3 (mut i64) (i64.const 0)) + + ;; CHECK: (global $__stack_limit_3 (mut i64) (i64.const 0)) + + ;; CHECK: (memory $0 i64 0 65536) + + ;; CHECK: (data $0 (i64.const 0) "") + + ;; CHECK: (export "use_stack" (func $0)) (export "use_stack" (func $0)) + ;; CHECK: (export "__set_stack_limits" (func $__set_stack_limits)) + + ;; CHECK: (func $0 (result i64) + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) (func $0 (result i64) (unreachable) ) ) -;; CHECK: (memory $0 i64 0 65536) - -;; CHECK: (data $0 (i64.const 0) "") - -;; CHECK: (export "__set_stack_limits" (func $__set_stack_limits)) - ;; CHECK: (func $__set_stack_limits (param $0 i64) (param $1 i64) -;; CHECK-NEXT: (global.set $__stack_base +;; CHECK-NEXT: (global.set $__stack_base_3 ;; CHECK-NEXT: (local.get $0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (global.set $__stack_limit +;; CHECK-NEXT: (global.set $__stack_limit_3 ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) diff --git a/test/lit/passes/stack-ir-non-nullable.wast b/test/lit/passes/stack-ir-non-nullable.wast index e2bd63271..62d75d61f 100644 --- a/test/lit/passes/stack-ir-non-nullable.wast +++ b/test/lit/passes/stack-ir-non-nullable.wast @@ -41,14 +41,18 @@ (i32.const 0) ) ) - (local.set $temp - (i31.new - (i32.const 1) + (then + (local.set $temp + (i31.new + (i32.const 1) + ) ) ) - (local.set $temp - (i31.new - (i32.const 2) + (else + (local.set $temp + (i31.new + (i32.const 2) + ) ) ) ) @@ -86,14 +90,18 @@ (i32.const 0) ) ) - (local.set $temp - (i31.new - (i32.const 1) + (then + (local.set $temp + (i31.new + (i32.const 1) + ) ) ) - (local.set $temp - (i31.new - (i32.const 2) + (else + (local.set $temp + (i31.new + (i32.const 2) + ) ) ) ) @@ -131,14 +139,18 @@ (i32.const 0) ) ) - (local.set $temp - (i31.new - (i32.const 1) + (then + (local.set $temp + (i31.new + (i32.const 1) + ) ) ) - (local.set $temp - (i31.new - (i32.const 2) + (else + (local.set $temp + (i31.new + (i32.const 2) + ) ) ) ) @@ -183,14 +195,18 @@ (i32.const 0) ) ) - (local.set $temp - (i31.new - (i32.const 1) + (then + (local.set $temp + (i31.new + (i32.const 1) + ) ) ) - (local.set $temp - (i31.new - (i32.const 2) + (else + (local.set $temp + (i31.new + (i32.const 2) + ) ) ) ) @@ -233,14 +249,18 @@ (i32.const 0) ) ) - (local.set $temp - (i31.new - (i32.const 1) + (then + (local.set $temp + (i31.new + (i32.const 1) + ) ) ) - (local.set $temp - (i31.new - (i32.const 2) + (else + (local.set $temp + (i31.new + (i32.const 2) + ) ) ) ) @@ -280,14 +300,18 @@ (i32.const 0) ) ) - (local.set $temp - (i31.new - (i32.const 1) + (then + (local.set $temp + (i31.new + (i32.const 1) + ) ) ) - (local.set $temp - (i31.new - (i32.const 2) + (else + (local.set $temp + (i31.new + (i32.const 2) + ) ) ) ) @@ -325,14 +349,18 @@ (i32.const 0) ) ) - (local.set $temp - (i31.new - (i32.const 1) + (then + (local.set $temp + (i31.new + (i32.const 1) + ) ) ) - (local.set $temp - (i31.new - (i32.const 2) + (else + (local.set $temp + (i31.new + (i32.const 2) + ) ) ) ) @@ -386,19 +414,23 @@ (i32.const 1) ) ) - (local.set $temp - (tuple.make 2 - (i32.const 2) - (i31.new - (i32.const 3) + (then + (local.set $temp + (tuple.make 2 + (i32.const 2) + (i31.new + (i32.const 3) + ) ) ) ) - (local.set $temp - (tuple.make 2 - (i32.const 4) - (i31.new - (i32.const 5) + (else + (local.set $temp + (tuple.make 2 + (i32.const 4) + (i31.new + (i32.const 5) + ) ) ) ) @@ -454,19 +486,23 @@ (i32.const 1) ) ) - (local.set $temp - (tuple.make 2 - (i32.const 2) - (i31.new - (i32.const 3) + (then + (local.set $temp + (tuple.make 2 + (i32.const 2) + (i31.new + (i32.const 3) + ) ) ) ) - (local.set $temp - (tuple.make 2 - (i32.const 4) - (i31.new - (i32.const 5) + (else + (local.set $temp + (tuple.make 2 + (i32.const 4) + (i31.new + (i32.const 5) + ) ) ) ) @@ -501,11 +537,15 @@ (local.get $temp) (i32.const 0) ) - (local.set $temp - (i32.const 1) + (then + (local.set $temp + (i32.const 1) + ) ) - (local.set $temp - (i32.const 2) + (else + (local.set $temp + (i32.const 2) + ) ) ) (local.get $temp) @@ -544,26 +584,30 @@ ) (if (i32.const 0) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) - ) - (drop - (local.get $temp) + (then + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) + (drop + (local.get $temp) + ) ) ) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) - ) - (drop - (local.get $temp) + (else + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) + (drop + (local.get $temp) + ) ) ) ) @@ -597,24 +641,28 @@ ) (if (i32.const 0) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) + (then + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) + ;; A get was removed here. ) - ;; A get was removed here. ) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) - ) - (drop - (local.get $temp) + (else + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) + (drop + (local.get $temp) + ) ) ) ) @@ -645,25 +693,29 @@ ) (if (i32.const 0) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) - ) - (drop - (local.get $temp) + (then + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) + (drop + (local.get $temp) + ) ) ) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) + (else + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) + ;; A get was removed here. ) - ;; A get was removed here. ) ) ) @@ -689,23 +741,27 @@ ) (if (i32.const 0) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) + (then + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) + ;; A get was removed here. ) - ;; A get was removed here. ) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) + (else + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) + ;; A get was removed here. ) - ;; A get was removed here. ) ) ) @@ -727,20 +783,24 @@ ;; optimize both arms. (if (i32.const 0) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) + (then + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) ) ) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) + (else + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) ) ) ) @@ -766,20 +826,24 @@ ;; them as well. (if (i32.const 0) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) + (then + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) ) ) - (block - (local.set $temp - (local.get $param) - ) - (drop - (local.get $temp) + (else + (block + (local.set $temp + (local.get $param) + ) + (drop + (local.get $temp) + ) ) ) ) @@ -959,13 +1023,17 @@ ;; In this if arm we write to $temp twice. That shouldn't confuse us; there's ;; still a use after the if, and we should not remove the set-get pair before ;; the if. - (local.set $temp - (local.tee $temp - (local.get $param) + (then + (local.set $temp + (local.tee $temp + (local.get $param) + ) ) ) - (local.set $temp - (local.get $param) + (else + (local.set $temp + (local.get $param) + ) ) ) (local.get $temp) diff --git a/test/lit/passes/type-generalizing.wast b/test/lit/passes/type-generalizing.wast index c874cc76c..502f57235 100644 --- a/test/lit/passes/type-generalizing.wast +++ b/test/lit/passes/type-generalizing.wast @@ -93,8 +93,12 @@ ;; CHECK-NEXT: (local $y eqref) ;; CHECK-NEXT: (if (result eqref) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (local.get $x) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (local.get $y) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if (result eqref) @@ -103,9 +107,13 @@ (if (result i31ref) (i32.const 0) ;; Require that typeof($x) <: eqref. - (local.get $x) + (then + (local.get $x) + ) ;; Require that typeof($y) <: eqref. - (local.get $y) + (else + (local.get $y) + ) ) ) diff --git a/test/lit/passes/type-merging.wast b/test/lit/passes/type-merging.wast index 34f156a2b..9327ebdb1 100644 --- a/test/lit/passes/type-merging.wast +++ b/test/lit/passes/type-merging.wast @@ -1019,10 +1019,6 @@ (global $g2 (ref $C') (struct.new_default $D2')) ) - (global $g1 (ref $B) (struct.new_default $D1)) - (global $g2 (ref $C) (struct.new_default $D2)) -) - ;; Check that a ref.test inhibits merging (ref.cast is already checked above). (module ;; CHECK: (rec diff --git a/test/lit/passes/type-refining.wast b/test/lit/passes/type-refining.wast index 0a133d7a0..8ce95c46d 100644 --- a/test/lit/passes/type-refining.wast +++ b/test/lit/passes/type-refining.wast @@ -1026,20 +1026,28 @@ ;; CHECK-NEXT: (local.get $A) ;; CHECK-NEXT: (if (result (ref $A)) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (struct.get $A 0 - ;; CHECK-NEXT: (local.get $A) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (struct.get $A 0 + ;; CHECK-NEXT: (local.get $A) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (struct.new $A ;; CHECK-NEXT: (if (result (ref $A)) ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (struct.get $A 0 - ;; CHECK-NEXT: (local.get $A) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (struct.get $A 0 + ;; CHECK-NEXT: (local.get $A) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1056,20 +1064,28 @@ (local.get $A) (if (result (ref null $A)) (i32.const 1) - (struct.get $A 0 - (local.get $A) + (then + (struct.get $A 0 + (local.get $A) + ) + ) + (else + (unreachable) ) - (unreachable) ) ) (drop (struct.new $A (if (result (ref null $A)) (i32.const 1) - (struct.get $A 0 - (local.get $A) + (then + (struct.get $A 0 + (local.get $A) + ) + ) + (else + (unreachable) ) - (unreachable) ) ) ) diff --git a/test/lit/passes/type-ssa_and_merging.wast b/test/lit/passes/type-ssa_and_merging.wast index 3fbff170d..670de31ac 100644 --- a/test/lit/passes/type-ssa_and_merging.wast +++ b/test/lit/passes/type-ssa_and_merging.wast @@ -80,9 +80,11 @@ ;; NOP: (func $get-a-1 (type $0) (; has Stack IR ;) (param $0 (ref $A)) (result i32) ;; NOP-NEXT: (if ;; NOP-NEXT: (call $import) - ;; NOP-NEXT: (return - ;; NOP-NEXT: (call $get-a-1 - ;; NOP-NEXT: (local.get $0) + ;; NOP-NEXT: (then + ;; NOP-NEXT: (return + ;; NOP-NEXT: (call $get-a-1 + ;; NOP-NEXT: (local.get $0) + ;; NOP-NEXT: ) ;; NOP-NEXT: ) ;; NOP-NEXT: ) ;; NOP-NEXT: ) @@ -93,8 +95,10 @@ ;; YES: (func $get-a-1 (type $1) (param $0 (ref $A)) ;; YES-NEXT: (if ;; YES-NEXT: (call $import) - ;; YES-NEXT: (call $get-a-1 - ;; YES-NEXT: (local.get $0) + ;; YES-NEXT: (then + ;; YES-NEXT: (call $get-a-1 + ;; YES-NEXT: (local.get $0) + ;; YES-NEXT: ) ;; YES-NEXT: ) ;; YES-NEXT: ) ;; YES-NEXT: ) @@ -104,9 +108,11 @@ ;; is necessary to avoid inlining making this testcase trivial even in NOP). (if (call $import) - (return - (call $get-a-1 - (local.get $ref) + (then + (return + (call $get-a-1 + (local.get $ref) + ) ) ) ) @@ -116,9 +122,11 @@ ;; NOP: (func $get-a-2 (type $0) (; has Stack IR ;) (param $0 (ref $A)) (result i32) ;; NOP-NEXT: (if ;; NOP-NEXT: (call $import) - ;; NOP-NEXT: (return - ;; NOP-NEXT: (call $get-a-2 - ;; NOP-NEXT: (local.get $0) + ;; NOP-NEXT: (then + ;; NOP-NEXT: (return + ;; NOP-NEXT: (call $get-a-2 + ;; NOP-NEXT: (local.get $0) + ;; NOP-NEXT: ) ;; NOP-NEXT: ) ;; NOP-NEXT: ) ;; NOP-NEXT: ) @@ -129,8 +137,10 @@ ;; YES: (func $get-a-2 (type $1) (param $0 (ref $A)) ;; YES-NEXT: (if ;; YES-NEXT: (call $import) - ;; YES-NEXT: (call $get-a-2 - ;; YES-NEXT: (local.get $0) + ;; YES-NEXT: (then + ;; YES-NEXT: (call $get-a-2 + ;; YES-NEXT: (local.get $0) + ;; YES-NEXT: ) ;; YES-NEXT: ) ;; YES-NEXT: ) ;; YES-NEXT: ) @@ -138,9 +148,11 @@ ;; Parallel to the above. (if (call $import) - (return - (call $get-a-2 - (local.get $ref) + (then + (return + (call $get-a-2 + (local.get $ref) + ) ) ) ) diff --git a/test/lit/passes/unsubtyping.wast b/test/lit/passes/unsubtyping.wast index df7e6c033..38549504e 100644 --- a/test/lit/passes/unsubtyping.wast +++ b/test/lit/passes/unsubtyping.wast @@ -275,8 +275,12 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result (ref $sub)) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (struct.new_default $sub) - ;; CHECK-NEXT: (struct.new_default $sub) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (struct.new_default $sub) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (struct.new_default $sub) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -285,8 +289,12 @@ (if (result (ref $super)) (i32.const 0) ;; This requires $sub <: $super. - (struct.new $sub) - (struct.new $sub) + (then + (struct.new $sub) + ) + (else + (struct.new $sub) + ) ) ) ) diff --git a/test/lit/passes/vacuum-eh.wast b/test/lit/passes/vacuum-eh.wast index b6b4629cd..68b5f7b1e 100644 --- a/test/lit/passes/vacuum-eh.wast +++ b/test/lit/passes/vacuum-eh.wast @@ -185,10 +185,14 @@ ;; CHECK-NEXT: (do ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (throw $e - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (throw $e + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (catch_all @@ -210,8 +214,12 @@ (do (if (local.get $0) - (throw $e (i32.const 0)) - (unreachable) + (then + (throw $e (i32.const 0)) + ) + (else + (unreachable) + ) ) ) (catch_all) diff --git a/test/lit/passes/vacuum-func.wast b/test/lit/passes/vacuum-func.wast index 6f93e4002..6181a662d 100644 --- a/test/lit/passes/vacuum-func.wast +++ b/test/lit/passes/vacuum-func.wast @@ -59,7 +59,9 @@ ;; CHECK-NEXT: (local $y i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (i32.const 1) @@ -78,7 +80,9 @@ ;; test at least.) (if (local.get $x) - (unreachable) + (then + (unreachable) + ) ) (local.set $x diff --git a/test/lit/passes/vacuum-gc.wast b/test/lit/passes/vacuum-gc.wast index be49bf1cf..27cd6f52d 100644 --- a/test/lit/passes/vacuum-gc.wast +++ b/test/lit/passes/vacuum-gc.wast @@ -51,10 +51,14 @@ ;; synthesize and allocate a new struct value. Vacuum should not error ;; on this case, though. Instead, the end result of this function should ;; simply be empty, as everything here can be vacuumed away. - (block (result (ref ${})) - (struct.new ${}) + (then + (block (result (ref ${})) + (struct.new ${}) + ) + ) + (else + (unreachable) ) - (unreachable) ) ) ) diff --git a/test/lit/passes/vacuum-intrinsics.wast b/test/lit/passes/vacuum-intrinsics.wast index 6b0654fb7..8ae5c0a33 100644 --- a/test/lit/passes/vacuum-intrinsics.wast +++ b/test/lit/passes/vacuum-intrinsics.wast @@ -97,16 +97,20 @@ ;; CHECK-NEXT: (ref.func $i) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $ifTrue (result i32) - ;; CHECK-NEXT: (call $nop) - ;; CHECK-NEXT: (call $call.without.effects - ;; CHECK-NEXT: (ref.func $i) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $ifTrue (result i32) + ;; CHECK-NEXT: (call $nop) + ;; CHECK-NEXT: (call $call.without.effects + ;; CHECK-NEXT: (ref.func $i) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $ifFalse (result i32) - ;; CHECK-NEXT: (call $nop) - ;; CHECK-NEXT: (call $call.without.effects - ;; CHECK-NEXT: (ref.func $i) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $ifFalse (result i32) + ;; CHECK-NEXT: (call $nop) + ;; CHECK-NEXT: (call $call.without.effects + ;; CHECK-NEXT: (ref.func $i) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -124,13 +128,17 @@ ) ;; The arms fall through their blocks and also through the if, and end ;; up used by the set. - (block $ifTrue (result i32) - (call $nop) - (call $call.without.effects (ref.func $i)) + (then + (block $ifTrue (result i32) + (call $nop) + (call $call.without.effects (ref.func $i)) + ) ) - (block $ifFalse (result i32) - (call $nop) - (call $call.without.effects (ref.func $i)) + (else + (block $ifFalse (result i32) + (call $nop) + (call $call.without.effects (ref.func $i)) + ) ) ) ) @@ -145,13 +153,17 @@ ;; CHECK-NEXT: (ref.func $i) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $ifTrue (result i32) - ;; CHECK-NEXT: (call $nop) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (block $ifTrue (result i32) + ;; CHECK-NEXT: (call $nop) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block $ifFalse (result i32) - ;; CHECK-NEXT: (call $nop) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (block $ifFalse (result i32) + ;; CHECK-NEXT: (call $nop) + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -165,13 +177,17 @@ ) ;; As above, but now there is a drop outside the if, so the arms are ;; unused and we can optimize them. - (block $ifTrue (result i32) - (call $nop) - (call $call.without.effects (ref.func $i)) + (then + (block $ifTrue (result i32) + (call $nop) + (call $call.without.effects (ref.func $i)) + ) ) - (block $ifFalse (result i32) - (call $nop) - (call $call.without.effects (ref.func $i)) + (else + (block $ifFalse (result i32) + (call $nop) + (call $call.without.effects (ref.func $i)) + ) ) ) ) @@ -181,11 +197,15 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result (ref any)) ;; CHECK-NEXT: (call $i) - ;; CHECK-NEXT: (call $call.without.effects-ref - ;; CHECK-NEXT: (ref.func $ref) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $call.without.effects-ref + ;; CHECK-NEXT: (ref.func $ref) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (call $call.without.effects-ref - ;; CHECK-NEXT: (ref.func $ref) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $call.without.effects-ref + ;; CHECK-NEXT: (ref.func $ref) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -196,8 +216,12 @@ (call $i) ;; As above, but the type of these unused values prevents us from ;; optimizing as we cannot create a "zero" for them. - (call $call.without.effects-ref (ref.func $ref)) - (call $call.without.effects-ref (ref.func $ref)) + (then + (call $call.without.effects-ref (ref.func $ref)) + ) + (else + (call $call.without.effects-ref (ref.func $ref)) + ) ) ) ) diff --git a/test/lit/passes/vacuum-tnh.wast b/test/lit/passes/vacuum-tnh.wast index f6d30a2c5..f74dc3c87 100644 --- a/test/lit/passes/vacuum-tnh.wast +++ b/test/lit/passes/vacuum-tnh.wast @@ -286,47 +286,71 @@ ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: (if ;; YESTNH-NEXT: (local.get $p) - ;; YESTNH-NEXT: (unreachable) - ;; YESTNH-NEXT: (unreachable) + ;; YESTNH-NEXT: (then + ;; YESTNH-NEXT: (unreachable) + ;; YESTNH-NEXT: ) + ;; YESTNH-NEXT: (else + ;; YESTNH-NEXT: (unreachable) + ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: ) ;; NO_TNH: (func $if-unreachable (type $0) (param $p i32) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (call $if-unreachable - ;; NO_TNH-NEXT: (i32.const 0) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (call $if-unreachable + ;; NO_TNH-NEXT: (i32.const 0) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (unreachable) ;; NO_TNH-NEXT: ) - ;; NO_TNH-NEXT: (unreachable) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (unreachable) - ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) (func $if-unreachable (param $p i32) ;; The if arm can be nopped, as in tnh we assume we never reach it. (if (local.get $p) - (unreachable) + (then + (unreachable) + ) ) ;; This else arm can be removed. (if (local.get $p) - (call $if-unreachable - (i32.const 0) + (then + (call $if-unreachable + (i32.const 0) + ) + ) + (else + (unreachable) ) - (unreachable) ) ;; Both of these can be removed, but we leave this for DCE to handle. (if (local.get $p) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) @@ -339,8 +363,12 @@ ;; NO_TNH: (func $if-unreachable-value (type $3) (param $p i32) (result i32) ;; NO_TNH-NEXT: (if (result i32) ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (unreachable) - ;; NO_TNH-NEXT: (i32.const 1) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (i32.const 1) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) (func $if-unreachable-value (param $p i32) (result i32) @@ -348,8 +376,12 @@ ;; cannot have a nop there. (if (result i32) (local.get $p) - (unreachable) - (i32.const 1) + (then + (unreachable) + ) + (else + (i32.const 1) + ) ) ) @@ -362,30 +394,40 @@ ;; NO_TNH: (func $if-unreachable-value-2 (type $3) (param $p i32) (result i32) ;; NO_TNH-NEXT: (if (result i32) ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (i32.const 1) - ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (i32.const 1) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (else + ;; NO_TNH-NEXT: (unreachable) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) (func $if-unreachable-value-2 (param $p i32) (result i32) ;; As above but in the other arm. (if (result i32) (local.get $p) - (i32.const 1) - (unreachable) + (then + (i32.const 1) + ) + (else + (unreachable) + ) ) ) ;; YESTNH: (func $block-unreachable (type $0) (param $p i32) ;; YESTNH-NEXT: (if ;; YESTNH-NEXT: (local.get $p) - ;; YESTNH-NEXT: (block + ;; YESTNH-NEXT: (then ;; YESTNH-NEXT: (i32.store ;; YESTNH-NEXT: (i32.const 0) ;; YESTNH-NEXT: (i32.const 1) ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: (if ;; YESTNH-NEXT: (local.get $p) - ;; YESTNH-NEXT: (return) + ;; YESTNH-NEXT: (then + ;; YESTNH-NEXT: (return) + ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: (unreachable) ;; YESTNH-NEXT: ) @@ -394,14 +436,16 @@ ;; NO_TNH: (func $block-unreachable (type $0) (param $p i32) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (block + ;; NO_TNH-NEXT: (then ;; NO_TNH-NEXT: (i32.store ;; NO_TNH-NEXT: (i32.const 0) ;; NO_TNH-NEXT: (i32.const 1) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (return) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (return) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (i32.store ;; NO_TNH-NEXT: (i32.const 2) @@ -414,22 +458,26 @@ (func $block-unreachable (param $p i32) (if (local.get $p) - (block - (i32.store - (i32.const 0) - (i32.const 1) - ) - (if - (local.get $p) - (return) - ) - ;; This store can be removed as it leads up to an unreachable which we - ;; assume is never reached. - (i32.store - (i32.const 2) - (i32.const 3) + (then + (block + (i32.store + (i32.const 0) + (i32.const 1) + ) + (if + (local.get $p) + (then + (return) + ) + ) + ;; This store can be removed as it leads up to an unreachable which we + ;; assume is never reached. + (i32.store + (i32.const 2) + (i32.const 3) + ) + (unreachable) ) - (unreachable) ) ) ) @@ -437,55 +485,61 @@ ;; YESTNH: (func $block-unreachable-named (type $0) (param $p i32) ;; YESTNH-NEXT: (if ;; YESTNH-NEXT: (local.get $p) - ;; YESTNH-NEXT: (block $named - ;; YESTNH-NEXT: (i32.store - ;; YESTNH-NEXT: (i32.const 0) - ;; YESTNH-NEXT: (i32.const 1) - ;; YESTNH-NEXT: ) - ;; YESTNH-NEXT: (br_if $named - ;; YESTNH-NEXT: (local.get $p) + ;; YESTNH-NEXT: (then + ;; YESTNH-NEXT: (block $named + ;; YESTNH-NEXT: (i32.store + ;; YESTNH-NEXT: (i32.const 0) + ;; YESTNH-NEXT: (i32.const 1) + ;; YESTNH-NEXT: ) + ;; YESTNH-NEXT: (br_if $named + ;; YESTNH-NEXT: (local.get $p) + ;; YESTNH-NEXT: ) + ;; YESTNH-NEXT: (unreachable) ;; YESTNH-NEXT: ) - ;; YESTNH-NEXT: (unreachable) ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: ) ;; NO_TNH: (func $block-unreachable-named (type $0) (param $p i32) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (block $named - ;; NO_TNH-NEXT: (i32.store - ;; NO_TNH-NEXT: (i32.const 0) - ;; NO_TNH-NEXT: (i32.const 1) - ;; NO_TNH-NEXT: ) - ;; NO_TNH-NEXT: (br_if $named - ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: ) - ;; NO_TNH-NEXT: (i32.store - ;; NO_TNH-NEXT: (i32.const 2) - ;; NO_TNH-NEXT: (i32.const 3) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (block $named + ;; NO_TNH-NEXT: (i32.store + ;; NO_TNH-NEXT: (i32.const 0) + ;; NO_TNH-NEXT: (i32.const 1) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (br_if $named + ;; NO_TNH-NEXT: (local.get $p) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (i32.store + ;; NO_TNH-NEXT: (i32.const 2) + ;; NO_TNH-NEXT: (i32.const 3) + ;; NO_TNH-NEXT: ) + ;; NO_TNH-NEXT: (unreachable) ;; NO_TNH-NEXT: ) - ;; NO_TNH-NEXT: (unreachable) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) (func $block-unreachable-named (param $p i32) (if (local.get $p) - (block $named - (i32.store - (i32.const 0) - (i32.const 1) - ) - ;; As above, but now the block is named and we use a br_if. We should - ;; again only remove the last store. - (br_if $named - (local.get $p) - ) - (i32.store - (i32.const 2) - (i32.const 3) + (then + (block $named + (i32.store + (i32.const 0) + (i32.const 1) + ) + ;; As above, but now the block is named and we use a br_if. We should + ;; again only remove the last store. + (br_if $named + (local.get $p) + ) + (i32.store + (i32.const 2) + (i32.const 3) + ) + (unreachable) ) - (unreachable) ) ) ) @@ -496,7 +550,7 @@ ;; NO_TNH: (func $block-unreachable-all (type $0) (param $p i32) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (block + ;; NO_TNH-NEXT: (then ;; NO_TNH-NEXT: (i32.store ;; NO_TNH-NEXT: (i32.const 0) ;; NO_TNH-NEXT: (i32.const 1) @@ -512,18 +566,20 @@ (func $block-unreachable-all (param $p i32) (if (local.get $p) - (block - ;; Both stores can be removed, and even the entire if arm and then the - ;; entire if. - (i32.store - (i32.const 0) - (i32.const 1) - ) - (i32.store - (i32.const 2) - (i32.const 3) + (then + (block + ;; Both stores can be removed, and even the entire if arm and then the + ;; entire if. + (i32.store + (i32.const 0) + (i32.const 1) + ) + (i32.store + (i32.const 2) + (i32.const 3) + ) + (unreachable) ) - (unreachable) ) ) ) @@ -625,7 +681,9 @@ ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: (if ;; YESTNH-NEXT: (local.get $p) - ;; YESTNH-NEXT: (br $loop) + ;; YESTNH-NEXT: (then + ;; YESTNH-NEXT: (br $loop) + ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: ) ;; YESTNH-NEXT: (unreachable) ;; YESTNH-NEXT: ) @@ -638,7 +696,9 @@ ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (if ;; NO_TNH-NEXT: (local.get $p) - ;; NO_TNH-NEXT: (br $loop) + ;; NO_TNH-NEXT: (then + ;; NO_TNH-NEXT: (br $loop) + ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: ) ;; NO_TNH-NEXT: (i32.store ;; NO_TNH-NEXT: (i32.const 2) @@ -655,7 +715,9 @@ ) (if (local.get $p) - (br $loop) + (then + (br $loop) + ) ) ;; This store can be removed as it leads up to an unreachable which we ;; assume is never reached. diff --git a/test/lit/passes/vacuum_all-features.wast b/test/lit/passes/vacuum_all-features.wast index b228d13ee..e4b183663 100644 --- a/test/lit/passes/vacuum_all-features.wast +++ b/test/lit/passes/vacuum_all-features.wast @@ -69,22 +69,34 @@ ) (if (i32.const 100) - (nop) - (drop - (i32.const 101) + (then + (nop) + ) + (else + (drop + (i32.const 101) + ) ) ) (if (i32.const 102) - (drop - (i32.const 103) + (then + (drop + (i32.const 103) + ) + ) + (else + (nop) ) - (nop) ) (if (i32.const 104) - (nop) - (nop) + (then + (nop) + ) + (else + (nop) + ) ) ) ;; CHECK: (func $l (type $3) (result i32) @@ -350,63 +362,83 @@ ;; CHECK-NEXT: (if ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (local.get $d) - ;; CHECK-NEXT: (f64.ne - ;; CHECK-NEXT: (f64.promote_f32 - ;; CHECK-NEXT: (f32.load - ;; CHECK-NEXT: (local.tee $l - ;; CHECK-NEXT: (i32.add - ;; CHECK-NEXT: (local.get $b) - ;; CHECK-NEXT: (i32.const 60) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (f64.ne + ;; CHECK-NEXT: (f64.promote_f32 + ;; CHECK-NEXT: (f32.load + ;; CHECK-NEXT: (local.tee $l + ;; CHECK-NEXT: (i32.add + ;; CHECK-NEXT: (local.get $b) + ;; CHECK-NEXT: (i32.const 60) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (local.get $e) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (local.get $e) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 0) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (unreachable) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $Gu (type $4) (param $b i32) (param $e f64) (param $l i32) (param $d i32) (if (if (result i32) (local.get $d) - (block $block1 (result i32) - (nop) - (f64.ne - (f64.promote_f32 - (f32.load - (local.tee $l - (i32.add - (local.get $b) - (i32.const 60) + (then + (block $block1 (result i32) + (nop) + (f64.ne + (f64.promote_f32 + (f32.load + (local.tee $l + (i32.add + (local.get $b) + (i32.const 60) + ) ) ) ) + (local.get $e) ) - (local.get $e) ) ) - (i32.const 0) + (else + (i32.const 0) + ) + ) + (then + (unreachable) ) - (unreachable) ) ) ;; CHECK: (func $if-drop (type $3) (result i32) ;; CHECK-NEXT: (block $out ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $if-drop) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $int) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $int) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $out) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $out) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $if-drop) - ;; CHECK-NEXT: (br $out) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $int) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $out) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $int) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -417,15 +449,23 @@ (drop (if (result i32) (call $if-drop) - (call $int) - (br $out) + (then + (call $int) + ) + (else + (br $out) + ) ) ) (drop (if (result i32) (call $if-drop) - (br $out) - (call $int) + (then + (br $out) + ) + (else + (call $int) + ) ) ) ) @@ -565,8 +605,12 @@ ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (call $if2drops) - ;; CHECK-NEXT: (call $if2drops) - ;; CHECK-NEXT: (call $if2drops) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (call $if2drops) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (call $if2drops) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2) @@ -574,11 +618,15 @@ (func $if2drops (result i32) (if (call $if2drops) - (drop - (call $if2drops) + (then + (drop + (call $if2drops) + ) ) - (drop - (call $if2drops) + (else + (drop + (call $if2drops) + ) ) ) (i32.const 2) @@ -586,11 +634,15 @@ ;; CHECK: (func $if2drops-different (type $3) (result i32) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (call $if2drops) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $if2drops) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $if2drops) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (call $unary) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (call $unary) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 2) @@ -598,11 +650,15 @@ (func $if2drops-different (result i32) (if (call $if2drops) - (drop - (call $if2drops) ;; i32 + (then + (drop + (call $if2drops) ;; i32 + ) ) - (drop - (call $unary) ;; f32! + (else + (drop + (call $unary) ;; f32! + ) ) ) (i32.const 2) @@ -619,26 +675,34 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-const (param $x i32) - (if (i32.const 0) (call $if-const (i32.const 1))) - (if (i32.const 2) (call $if-const (i32.const 3))) - (if (i32.const 0) (call $if-const (i32.const 4)) (call $if-const (i32.const 5))) - (if (i32.const 6) (call $if-const (i32.const 7)) (call $if-const (i32.const 8))) + (if (i32.const 0) (then (call $if-const (i32.const 1)))) + (if (i32.const 2) (then (call $if-const (i32.const 3)))) + (if (i32.const 0) (then (call $if-const (i32.const 4)) )(else (call $if-const (i32.const 5)))) + (if (i32.const 6) (then (call $if-const (i32.const 7)) )(else (call $if-const (i32.const 8)))) ) ;; CHECK: (func $drop-if-both-unreachable (type $1) (param $0 i32) ;; CHECK-NEXT: (block $out ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (br $out) - ;; CHECK-NEXT: (br $out) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $out) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $out) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $0) - ;; CHECK-NEXT: (unreachable) - ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (unreachable) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -647,16 +711,24 @@ (drop (if (result i32) (local.get $0) - (br $out) - (br $out) + (then + (br $out) + ) + (else + (br $out) + ) ) ) ) (drop (if (result i32) (local.get $0) - (unreachable) - (unreachable) + (then + (unreachable) + ) + (else + (unreachable) + ) ) ) ) @@ -664,7 +736,7 @@ ;; CHECK-NEXT: (block $out ;; CHECK-NEXT: (if ;; CHECK-NEXT: (local.get $x) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (local.set $x ;; CHECK-NEXT: (local.get $x) ;; CHECK-NEXT: ) @@ -678,14 +750,18 @@ (block $out (if (local.get $x) - (block - (if - (i32.const 1) - (block - (local.set $x - (local.get $x) + (then + (block + (if + (i32.const 1) + (then + (block + (local.set $x + (local.get $x) + ) + (br $out) + ) ) - (br $out) ) ) ) @@ -804,8 +880,12 @@ (block $label$0 (if (i32.const 170996275) - (unreachable) - (br $label$0) + (then + (unreachable) + ) + (else + (br $label$0) + ) ) ) (unreachable) @@ -817,8 +897,12 @@ (block $label$0 (if (i32.const 170996275) - (nop) - (br $label$0) + (then + (nop) + ) + (else + (br $label$0) + ) ) ) (unreachable) @@ -833,8 +917,12 @@ (block $label$0 (if (i32.const 170996275) - (br $label$0) - (nop) + (then + (br $label$0) + ) + (else + (nop) + ) ) ) (unreachable) @@ -911,8 +999,12 @@ (br $label$9) ) ) - (unreachable) - (i32.const 1920103026) + (then + (unreachable) + ) + (else + (i32.const 1920103026) + ) ) ) ) @@ -932,7 +1024,9 @@ (br $label$0 (i32.const 1) ) - (br $label$1) + (then + (br $label$1) + ) ) ) (i32.const 1579493952) @@ -952,7 +1046,9 @@ (br $label$0 (i32.const 1) ) - (br $label$1) + (then + (br $label$1) + ) ) ) (i32.const 1579493952) @@ -969,16 +1065,20 @@ (i32.eqz (local.get $0) ) - (block $label$1 - (block - (if ;; we nop this if, which has a type change for block $label$1, no more brs to it - (i32.const 0) - (br_if $label$1 - (i32.const 1717966400) + (then + (block $label$1 + (block + (if ;; we nop this if, which has a type change for block $label$1, no more brs to it + (i32.const 0) + (then + (br_if $label$1 + (i32.const 1717966400) + ) + ) + ) + (drop + (br $label$0) ) - ) - (drop - (br $label$0) ) ) ) @@ -1111,7 +1211,7 @@ ;; CHECK-NEXT: (call $_deflateInit2_ ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $global$1 ;; CHECK-NEXT: (local.get $3) ;; CHECK-NEXT: ) @@ -1128,7 +1228,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (i32.store ;; CHECK-NEXT: (local.get $1) ;; CHECK-NEXT: (i32.load offset=20 @@ -1145,7 +1245,7 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block (result i32) + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (drop ;; CHECK-NEXT: (call $_deflateEnd ;; CHECK-NEXT: (local.get $3) @@ -1204,11 +1304,13 @@ (call $_deflateInit2_ (local.get $3) ) - (block - (global.set $global$1 - (local.get $3) + (then + (block + (global.set $global$1 + (local.get $3) + ) + (return) ) - (return) ) ) (drop @@ -1221,36 +1323,40 @@ ) (i32.const 1) ) - (block (result i32) - (i32.store - (local.get $1) - (i32.load offset=20 - (local.get $3) + (then + (block (result i32) + (i32.store + (local.get $1) + (i32.load offset=20 + (local.get $3) + ) ) - ) - (local.set $0 - (call $_deflateEnd + (local.set $0 + (call $_deflateEnd + (local.get $3) + ) + ) + (global.set $global$1 (local.get $3) ) + (local.get $0) ) - (global.set $global$1 - (local.get $3) - ) - (local.get $0) ) - (block (result i32) - (drop - (call $_deflateEnd + (else + (block (result i32) + (drop + (call $_deflateEnd + (local.get $3) + ) + ) + (global.set $global$1 (local.get $3) ) - ) - (global.set $global$1 - (local.get $3) - ) - (select - (local.get $0) - (i32.const -5) - (local.get $0) + (select + (local.get $0) + (i32.const -5) + (local.get $0) + ) ) ) ) diff --git a/test/lit/source-map.wast b/test/lit/source-map.wast index fcb5e1dd3..8d22360ad 100644 --- a/test/lit/source-map.wast +++ b/test/lit/source-map.wast @@ -13,7 +13,9 @@ (local.get $y) ) ;;@ src.cpp:50:1 - (return) + (then + (return) + ) ) ;;@ src.cpp:60:1 (call $foo @@ -35,8 +37,10 @@ ;; CHECK-NEXT: ;;@ src.cpp:40:1 ;; CHECK-NEXT: (local.get $y) ;; CHECK-NEXT: ) -;; CHECK-NEXT: ;;@ src.cpp:50:1 -;; CHECK-NEXT: (return) +;; CHECK-NEXT: (then +;; CHECK-NEXT: ;;@ src.cpp:50:1 +;; CHECK-NEXT: (return) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ;;@ src.cpp:60:1 ;; CHECK-NEXT: (call $foo diff --git a/test/lit/validation/bad-non-nullable-locals.wast b/test/lit/validation/bad-non-nullable-locals.wast index e34970fde..558759aeb 100644 --- a/test/lit/validation/bad-non-nullable-locals.wast +++ b/test/lit/validation/bad-non-nullable-locals.wast @@ -49,10 +49,14 @@ (if (i32.const 1) ;; Superficially the order is right, but not really. - (local.set $x - (ref.func $helper) + (then + (local.set $x + (ref.func $helper) + ) + ) + (else + (local.get $x) ) - (local.get $x) ) ) diff --git a/test/lit/wasm-split/instrument-funcs.wast b/test/lit/wasm-split/instrument-funcs.wast index cf3ca4af7..2dbd578f3 100644 --- a/test/lit/wasm-split/instrument-funcs.wast +++ b/test/lit/wasm-split/instrument-funcs.wast @@ -36,7 +36,7 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (global.get $baz_timestamp) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (block +;; CHECK-NEXT: (then ;; CHECK-NEXT: (global.set $monotonic_counter ;; CHECK-NEXT: (i32.add ;; CHECK-NEXT: (global.get $monotonic_counter) @@ -59,7 +59,7 @@ ;; CHECK-NEXT: (local.get $size) ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (block +;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store align=1 ;; CHECK-NEXT: (local.get $addr) ;; CHECK-NEXT: (i64.const {{.*}}) diff --git a/test/lit/wasm-split/instrument-in-memory.wast b/test/lit/wasm-split/instrument-in-memory.wast index 3208b0b5d..91433d424 100644 --- a/test/lit/wasm-split/instrument-in-memory.wast +++ b/test/lit/wasm-split/instrument-in-memory.wast @@ -49,7 +49,7 @@ ;; CHECK-NEXT: (local.get $size) ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (block +;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store align=1 ;; CHECK-NEXT: (local.get $addr) ;; CHECK-NEXT: (i64.const {{.*}}) diff --git a/test/lit/wasm-split/instrument-in-secondary-memory.wast b/test/lit/wasm-split/instrument-in-secondary-memory.wast index 26ac0ad18..18a8b0a4f 100644 --- a/test/lit/wasm-split/instrument-in-secondary-memory.wast +++ b/test/lit/wasm-split/instrument-in-secondary-memory.wast @@ -52,7 +52,7 @@ ;; CHECK-NEXT: (local.get $size) ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (block +;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store $0 align=1 ;; CHECK-NEXT: (local.get $addr) ;; CHECK-NEXT: (i64.const {{.*}}) diff --git a/test/lit/wasm-split/instrument-memory64.wast b/test/lit/wasm-split/instrument-memory64.wast index ff2a56cad..65560d29e 100644 --- a/test/lit/wasm-split/instrument-memory64.wast +++ b/test/lit/wasm-split/instrument-memory64.wast @@ -30,7 +30,7 @@ ;; CHECK-NEXT: (local.get $size) ;; CHECK-NEXT: (i32.const 16) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (block +;; CHECK-NEXT: (then ;; CHECK-NEXT: (i64.store align=1 ;; CHECK-NEXT: (local.get $addr) ;; CHECK-NEXT: (i64.const {{.*}}) diff --git a/test/lit/wasm-split/jspi-secondary-export.wast b/test/lit/wasm-split/jspi-secondary-export.wast index 57fe849a9..3729ec00e 100644 --- a/test/lit/wasm-split/jspi-secondary-export.wast +++ b/test/lit/wasm-split/jspi-secondary-export.wast @@ -62,7 +62,9 @@ ;; PRIMARY-NEXT: (i32.eqz ;; PRIMARY-NEXT: (global.get $global$1) ;; PRIMARY-NEXT: ) -;; PRIMARY-NEXT: (call $__load_secondary_module) +;; PRIMARY-NEXT: (then +;; PRIMARY-NEXT: (call $__load_secondary_module) +;; PRIMARY-NEXT: ) ;; PRIMARY-NEXT: ) ;; PRIMARY-NEXT: (call_indirect (type $0) ;; PRIMARY-NEXT: (local.get $0) diff --git a/test/lit/wasm-split/jspi.wast b/test/lit/wasm-split/jspi.wast index 340b2acec..6866f02ff 100644 --- a/test/lit/wasm-split/jspi.wast +++ b/test/lit/wasm-split/jspi.wast @@ -43,7 +43,9 @@ ;; PRIMARY-NEXT: (i32.eqz ;; PRIMARY-NEXT: (global.get $global$1) ;; PRIMARY-NEXT: ) - ;; PRIMARY-NEXT: (call $__load_secondary_module) + ;; PRIMARY-NEXT: (then + ;; PRIMARY-NEXT: (call $__load_secondary_module) + ;; PRIMARY-NEXT: ) ;; PRIMARY-NEXT: ) ;; PRIMARY-NEXT: (call_indirect (type $0) ;; PRIMARY-NEXT: (i32.const 0) diff --git a/test/lit/wasm-split/multi-memory-lowering-export.wast b/test/lit/wasm-split/multi-memory-lowering-export.wast index 0721ba2a4..152aaf723 100644 --- a/test/lit/wasm-split/multi-memory-lowering-export.wast +++ b/test/lit/wasm-split/multi-memory-lowering-export.wast @@ -55,8 +55,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (return -;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (return +;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.copy @@ -100,8 +102,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (return -;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (return +;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $return_size) diff --git a/test/lit/wasm-split/multi-memory-lowering-import.wast b/test/lit/wasm-split/multi-memory-lowering-import.wast index d62609108..37ccfa16c 100644 --- a/test/lit/wasm-split/multi-memory-lowering-import.wast +++ b/test/lit/wasm-split/multi-memory-lowering-import.wast @@ -52,8 +52,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (return -;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (return +;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (memory.copy @@ -97,8 +99,10 @@ ;; CHECK-NEXT: ) ;; CHECK-NEXT: (i32.const -1) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (return -;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (return +;; CHECK-NEXT: (i32.const -1) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (local.get $return_size) diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast index 05aedd519..19915b130 100644 --- a/test/lit/wat-kitchen-sink.wast +++ b/test/lit/wat-kitchen-sink.wast @@ -1024,8 +1024,12 @@ ;; CHECK: (func $if-else (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else @@ -1040,8 +1044,12 @@ ;; CHECK: (func $if-else-empty (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else-empty @@ -1054,11 +1062,11 @@ ;; CHECK: (func $if-else-many (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) @@ -1078,11 +1086,15 @@ ;; CHECK: (func $if-else-single-nested (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (f32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (f32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (f64.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (f64.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1100,11 +1112,15 @@ ;; CHECK: (func $if-else-folded-body (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (f32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (f32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (f32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (f32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1125,8 +1141,12 @@ ;; CHECK-NEXT: (block $l ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1142,7 +1162,9 @@ ;; CHECK: (func $if-no-else (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-no-else @@ -1155,8 +1177,12 @@ ;; CHECK: (func $if-else-result (type $1) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else-result (result i32) @@ -1172,8 +1198,12 @@ ;; CHECK-NEXT: (block $l (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1189,8 +1219,12 @@ ;; CHECK: (func $if-else-folded (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else-folded @@ -1208,8 +1242,12 @@ ;; CHECK: (func $if-else-folded-empty (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else-folded-empty @@ -1223,11 +1261,11 @@ ;; CHECK: (func $if-else-folded-many (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (block + ;; CHECK-NEXT: (else ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: (nop) ;; CHECK-NEXT: ) @@ -1252,11 +1290,15 @@ ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1282,8 +1324,12 @@ ;; CHECK-NEXT: (block $l ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1302,7 +1348,9 @@ ;; CHECK: (func $if-no-else-folded (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (nop) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-no-else-folded @@ -1317,8 +1365,12 @@ ;; CHECK: (func $if-else-folded-result (type $1) (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else-folded-result (result i32) @@ -1337,8 +1389,12 @@ ;; CHECK-NEXT: (block $l (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1357,15 +1413,23 @@ ;; CHECK: (func $if-else-atypical-condition (type $void) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) -;; CHECK-NEXT: (nop) -;; CHECK-NEXT: (nop) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) +;; CHECK-NEXT: (else +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.eqz ;; CHECK-NEXT: (i32.const 0) ;; CHECK-NEXT: ) -;; CHECK-NEXT: (nop) -;; CHECK-NEXT: (nop) +;; CHECK-NEXT: (then +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) +;; CHECK-NEXT: (else +;; CHECK-NEXT: (nop) +;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) (func $if-else-atypical-condition @@ -1378,19 +1442,33 @@ ;; CHECK-NEXT: (if ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (i32.const 1) - ;; CHECK-NEXT: (i32.const 2) - ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (if (result i32) - ;; CHECK-NEXT: (i32.const 3) - ;; CHECK-NEXT: (i32.const 4) - ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 1) ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then ;; CHECK-NEXT: (if - ;; CHECK-NEXT: (i32.const 6) - ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: (if (result i32) + ;; CHECK-NEXT: (i32.const 3) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (i32.const 4) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (i32.const 5) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (if + ;; CHECK-NEXT: (i32.const 6) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (drop + ;; CHECK-NEXT: (i32.const 7) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1429,8 +1507,12 @@ ;; CHECK-NEXT: (block $label ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $label) - ;; CHECK-NEXT: (br $label) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $label) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $label) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -1447,11 +1529,15 @@ ;; CHECK-NEXT: (block $label (result i32) ;; CHECK-NEXT: (if (result i32) ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $label - ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $label + ;; CHECK-NEXT: (i32.const 1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) - ;; CHECK-NEXT: (br $label - ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: (else + ;; CHECK-NEXT: (br $label + ;; CHECK-NEXT: (i32.const 2) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2264,7 +2350,9 @@ ;; CHECK-NEXT: (block $l_1 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $l_1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $l_1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) @@ -2289,7 +2377,9 @@ ;; CHECK-NEXT: (block $l_1 ;; CHECK-NEXT: (if ;; CHECK-NEXT: (i32.const 0) - ;; CHECK-NEXT: (br $l_1) + ;; CHECK-NEXT: (then + ;; CHECK-NEXT: (br $l_1) + ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: ) ;; CHECK-NEXT: (br $l_0) |