diff options
author | Alon Zakai <azakai@google.com> | 2022-12-07 10:46:32 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-07 18:46:32 +0000 |
commit | 4957d29fab26d235ed035a59441d74c9e4a4f561 (patch) | |
tree | c9c4ddc55c9f7a100ac6818bf70a8b6dc571b95c /src/passes/pass.cpp | |
parent | 2590620a32190f98b29c7d9726865aa8082b4023 (diff) | |
download | binaryen-4957d29fab26d235ed035a59441d74c9e4a4f561.tar.gz binaryen-4957d29fab26d235ed035a59441d74c9e4a4f561.tar.bz2 binaryen-4957d29fab26d235ed035a59441d74c9e4a4f561.zip |
[Wasm GC] Add TypeMerging pass (#5321)
This finds types that can be merged into their super: types that add no
fields, and are not used in casts, etc. - so we might as well use the super.
This complements TypeSSA, in that it can merge back the new types that
TypeSSA created, if we never found a use for them. Without this, TypeSSA
can bloat binary size quite a lot (I see 10-20%).
Diffstat (limited to 'src/passes/pass.cpp')
-rw-r--r-- | src/passes/pass.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/passes/pass.cpp b/src/passes/pass.cpp index b97d182c6..d7f2a310f 100644 --- a/src/passes/pass.cpp +++ b/src/passes/pass.cpp @@ -461,6 +461,9 @@ void PassRegistry::registerPasses() { registerPass("trap-mode-js", "replace trapping operations with js semantics", createTrapModeJS); + registerPass("type-merging", + "merge types to their supertypes where possible", + createTypeMergingPass); registerPass("type-ssa", "create new nominal types to help other optimizations", createTypeSSAPass); |