forked from WebAssembly/binaryen
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MergeBlocks: Optimize all dropped blocks (WebAssembly#6984)
Just call optimizeDroppedBlock from visitDrop to handle that. Followup to WebAssembly#6982. This optimizes the new testcase added there. Some older tests also improve.
- Loading branch information
Showing
7 changed files
with
76 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
;; NOTE: Assertions have been generated by update_lit_checks.py and should not be edited. | ||
;; RUN: wasm-opt %s --merge-blocks -all -S -o - | filecheck %s | ||
;; | ||
;; Similar to merge-blocks.wast, but without --remove-unused-names. This tests | ||
;; the pass entirely by itself. | ||
|
||
(module | ||
;; CHECK: (func $nested-dropped-blocks (type $0) | ||
;; CHECK-NEXT: (drop | ||
;; CHECK-NEXT: (i32.const 42) | ||
;; CHECK-NEXT: ) | ||
;; CHECK-NEXT: ) | ||
(func $nested-dropped-blocks | ||
;; Fully removing unneeded blocks here requires multiple operations to happen. | ||
;; Specifically, we remove all the outer blocks first, and only then get to | ||
;; the inner named block, which we can then infer is not needed either. | ||
(block | ||
(drop | ||
(block (result i32) | ||
(block $named (result i32) | ||
(i32.const 42) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters