diff options
author | Thomas Lively <tlively@google.com> | 2024-03-05 14:37:46 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-05 14:37:46 -0800 |
commit | 71bf4b3fa2716d5c54e04f7e76c2463b1adddeae (patch) | |
tree | eb1bc867c7b561387d685ea4ae457d8e1755c3a8 /test | |
parent | d1a7d4b8c8965a1f1c4bb22510631c28334581cb (diff) | |
download | binaryen-71bf4b3fa2716d5c54e04f7e76c2463b1adddeae.tar.gz binaryen-71bf4b3fa2716d5c54e04f7e76c2463b1adddeae.tar.bz2 binaryen-71bf4b3fa2716d5c54e04f7e76c2463b1adddeae.zip |
[Parser] Improve parsed IR for multivalue returns (#6378)
Rather than reassembling a tuple from multiple pops, let the pop implementation
assemble the tuple. This produces less code in cases where there is already a
tuple of the proper size on top of the stack. It also simplifies the code.
Diffstat (limited to 'test')
-rw-r--r-- | test/lit/wat-kitchen-sink.wast | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/test/lit/wat-kitchen-sink.wast b/test/lit/wat-kitchen-sink.wast index 33f570702..af9ce7ff0 100644 --- a/test/lit/wat-kitchen-sink.wast +++ b/test/lit/wat-kitchen-sink.wast @@ -3662,6 +3662,16 @@ return ) + ;; CHECK: (func $return-multivalue (type $4) (result i32 i64) + ;; CHECK-NEXT: (return + ;; CHECK-NEXT: (call $return-multivalue) + ;; CHECK-NEXT: ) + ;; CHECK-NEXT: ) + (func $return-multivalue (result i32 i64) + call $return-multivalue + return + ) + ;; CHECK: (func $ref-is-null (type $45) (param $0 anyref) (result i32) ;; CHECK-NEXT: (ref.is_null ;; CHECK-NEXT: (local.get $0) @@ -3683,7 +3693,7 @@ (func $ref-func ref.func $ref-func drop - ref.func 156 + ref.func 157 drop ) |