Skip to content

Only run --low-memory-unused when optimizing #11999

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 23, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion emcc.py
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,9 @@ def backend_binaryen_passes():
# even if not optimizing, make an effort to remove all unused imports and
# exports, to make the wasm as standalone as possible
passes += ['--remove-unused-module-elements']
if shared.Settings.GLOBAL_BASE >= 1024: # hardcoded value in the binaryen pass
# when optimizing, use the fact that low memory is never used (1024 is a
# hardcoded value in the binaryen pass)
if shared.Settings.OPT_LEVEL > 0 and shared.Settings.GLOBAL_BASE >= 1024:
passes += ['--low-memory-unused']
if shared.Settings.DEBUG_LEVEL < 3:
passes += ['--strip-debug']
Expand Down