diff options
author | Alon Zakai <azakai@google.com> | 2022-08-22 13:53:47 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-22 13:53:47 -0700 |
commit | 38c084ee386e257389d44c6200a403f74432e1af (patch) | |
tree | 8e41abd3ad903b9fcb426bf0c4be3dd66a092247 /test/lit/passes/optimize-instructions-gc-iit.wast | |
parent | b24df4d0c4705027fdc6e261aa3f8e4f61dc5c0a (diff) | |
download | binaryen-38c084ee386e257389d44c6200a403f74432e1af.tar.gz binaryen-38c084ee386e257389d44c6200a403f74432e1af.tar.bz2 binaryen-38c084ee386e257389d44c6200a403f74432e1af.zip |
Avoid adding new unneeded names to blocks in text roundtripping (#4943)
Previously the wat parser would turn this input:
(block
(nop)
)
into something like this:
(block $block17
(nop)
)
It just added a name all the time, in case the block is referred to by an index
later even though it doesn't have a name.
This PR makes us rountrip more precisely by not adding such names: if there
was no name before, and there is no break by index, then do not add a name.
In addition, this will be useful for non-nullable locals since whether a block has
a name or not matters there. Like #4912, this makes us more regular in our
usage of block names.
Diffstat (limited to 'test/lit/passes/optimize-instructions-gc-iit.wast')
-rw-r--r-- | test/lit/passes/optimize-instructions-gc-iit.wast | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test/lit/passes/optimize-instructions-gc-iit.wast b/test/lit/passes/optimize-instructions-gc-iit.wast index 3f0c926d3..24c5c6809 100644 --- a/test/lit/passes/optimize-instructions-gc-iit.wast +++ b/test/lit/passes/optimize-instructions-gc-iit.wast @@ -132,7 +132,7 @@ ;; CHECK: (func $ref-cast-iit-bad (param $parent (ref $parent)) ;; CHECK-NEXT: (drop - ;; CHECK-NEXT: (block $block (result (ref $parent)) + ;; CHECK-NEXT: (block (result (ref $parent)) ;; CHECK-NEXT: (call $foo) ;; CHECK-NEXT: (local.get $parent) ;; CHECK-NEXT: ) @@ -145,7 +145,7 @@ ;; CHECK-NEXT: ) ;; NOMNL: (func $ref-cast-iit-bad (type $ref|$parent|_=>_none) (param $parent (ref $parent)) ;; NOMNL-NEXT: (drop - ;; NOMNL-NEXT: (block $block (result (ref $parent)) + ;; NOMNL-NEXT: (block (result (ref $parent)) ;; NOMNL-NEXT: (call $foo) ;; NOMNL-NEXT: (local.get $parent) ;; NOMNL-NEXT: ) @@ -158,7 +158,7 @@ ;; NOMNL-NEXT: ) ;; NOMNL-TNH: (func $ref-cast-iit-bad (type $ref|$parent|_=>_none) (param $parent (ref $parent)) ;; NOMNL-TNH-NEXT: (drop - ;; NOMNL-TNH-NEXT: (block $block (result (ref $parent)) + ;; NOMNL-TNH-NEXT: (block (result (ref $parent)) ;; NOMNL-TNH-NEXT: (call $foo) ;; NOMNL-TNH-NEXT: (local.get $parent) ;; NOMNL-TNH-NEXT: ) |