Skip to content

Open-world store-to-load forward optimization for globals #8016

@mkustermann

Description

@mkustermann

This is basically the issue I filed in #8002 - with the extra requirement that this should also work in an open-world setting.

The same reproduction still applies and fails to optimize the global.get + struct.get pattern if optimized via

% wasm-opt --enable-gc --enable-reference-types --enable-multivalue --enable-exception-handling \
     --enable-nontrapping-float-to-int --enable-sign-ext --enable-bulk-memory \
     --enable-threads '--no-inline=*<noInline>*' --traps-never-happen -g \
     -Os \
     bad.wasm -o bad.opt.wasm

From the change in PR #8005 it seems that this works with --gsi which requires --closed-world.

For background: We have some use cases where our compiler emits multiple wasm modules and we'd like to locally optimize each of them. Some simple analysis suggests we'd save 3.5 KB on one of the modules.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions