diff options
author | Alon Zakai <azakai@google.com> | 2021-11-10 13:40:34 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-10 21:40:34 +0000 |
commit | a113d39fe87e098c5b19ca75002b6995a3f69e3e (patch) | |
tree | 3002447053ed49d3248a80e43d51b3c7e4d635e8 /src/passes/passes.h | |
parent | 7075d2e217d67a7a8ec76927817300f801a57b22 (diff) | |
download | binaryen-a113d39fe87e098c5b19ca75002b6995a3f69e3e.tar.gz binaryen-a113d39fe87e098c5b19ca75002b6995a3f69e3e.tar.bz2 binaryen-a113d39fe87e098c5b19ca75002b6995a3f69e3e.zip |
Add GlobalSubtyping pass (#4306)
This specializes the fields of structs based on the types written to them. That is,
if a field is of type A but in practice we always write some subtype B to it
then we can change the type of the field to that.
On j2wasm this manages to improve at least one field in 2% of types. Not a
large amount, but this does lead to further benefits in later opts (e.g. about a third
of the improvements are to turn a field non-nullable).
Diffstat (limited to 'src/passes/passes.h')
-rw-r--r-- | src/passes/passes.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/passes/passes.h b/src/passes/passes.h index a08e42f62..b9ba566d0 100644 --- a/src/passes/passes.h +++ b/src/passes/passes.h @@ -51,6 +51,8 @@ Pass* createFunctionMetricsPass(); Pass* createGenerateDynCallsPass(); Pass* createGenerateI64DynCallsPass(); Pass* createGenerateStackIRPass(); +Pass* createGlobalSubtypingPass(); +Pass* createGlobalTypeOptimizationPass(); Pass* createHeap2LocalPass(); Pass* createI64ToI32LoweringPass(); Pass* createInlineMainPass(); @@ -131,7 +133,6 @@ Pass* createTrapModeClamp(); Pass* createTrapModeJS(); Pass* createUnteePass(); Pass* createVacuumPass(); -Pass* createGlobalTypeOptimizationPass(); } // namespace wasm |