Scroll to navigation

WASM-SPLIT(1) User Commands WASM-SPLIT(1)

NAME

wasm-split - manual page for wasm-split 122

DESCRIPTION

================================================================================ wasm-split INFILES

Split a module into a primary module and a secondary module, or instrument a module to gather a profile that can inform future splitting, or manage such profiles. Options that are only accepted in particular modes are marked with the accepted "[<modes>]" in their descriptions. ================================================================================

wasm-split options: -------------------

Split an input module into two output modules. The default mode.
Split an input module into an arbitrary number of output modules.
Instrument an input module to allow it to generate a profile that can be used to guide splitting.
Merge multiple profiles for the same module into a single profile.
[print-profile] Print profile contents in a human-readable format.
[split] The profile to use to guide splitting.
[split] Comma-separated list of functions to keep in the primary module. The rest will be split out. Can be used alongside --profile and --split-funcs. You can also pass a file with one function per line by passing @filename.
[split] Comma-separated list of functions to split out to the secondary module. The rest will be kept. Can be used alongside --profile and --keep-funcs. This takes precedence over other split options. You can also pass a file with one function per line by passing @filename.
[multi-split] File describing the functions to be split into each module. Each section separated by a blank line begins with the base name of an output module, which is followed by a list of functions to place in that module, one per line.
[multi-split] Prefix prepended to module names in the manifest file to create output file names.
[split] Output file for the primary module.
[split] Output file for the secondary module.
[split] Write a symbol map file for each of the output modules.
[split] Do not import placeholder functions. Calls to secondary functions will fail before the secondary module has been instantiated.
[split] Write a file mapping placeholder indices to the function names.
[split, instrument] When provided as an option for module splitting, the namespace from which to import objects from the primary module into the secondary module. In instrument mode, refers to the namespace from which to import the secondary memory, if any.
[split] The namespace from which to import placeholder functions into the primary module.
[split] Transform the module to support asynchronously loading the secondary module before any placeholder functions have been called.
[split] An identifying prefix to prepend to new export names created by module splitting.
[instrument] The export name of the function the embedder calls to write the profile into memory. Defaults to `__write_profile`.
[instrument] Store profile information in memory (starting at address 0 and taking one byte per function) rather than globals (the default) so that it can be shared between multiple threads. Users are responsible for ensuring that the module does not use the initial memory region for anything else.
[instrument] Store profile information in a separate memory, rather than in module main memory or globals (the default). With this option, users do not need to reserve the initial memory region for profile data and the data can be shared between multiple threads.
[instrument] The name of the secondary memory created to store profile information.
[split, instrument] Emit module names, even if not emitting the rest of the names section. Can help differentiate the modules in stack traces. This option will be removed once simpler ways of naming modules are widely available. See https://bugs.chromium.org/p/v8/issues/detail?id=11808.
[split, instrument] A hack to ensure the split and instrumented modules have the same table size when using Emscripten's SPLIT_MODULE mode with dynamic linking. TODO: Figure out a more elegant solution for that use case and remove this.
[split, instrument] Emit text instead of binary for the output file or files.
[split, multi-split, instrument] Emit names section in wasm binary (or full debuginfo in wast)
[instrument, merge-profiles, multi-split] Output file.
Un-escape function names (in print-profile output)
Verbose output mode. Prints the functions that will be kept and split out when splitting a module.

Tool options: -------------

Disable all non-MVP features
Enable all features
(deprecated - this flag does nothing)
Emit less verbose output and hide trivial warnings.
Parse wast files as Poppy IR for testing purposes.
Enable sign extension operations
Disable sign extension operations
Enable atomic operations
Disable atomic operations
Enable mutable globals
Disable mutable globals
Enable nontrapping float-to-int operations
Disable nontrapping float-to-int operations
Enable SIMD operations and types
Disable SIMD operations and types
Enable bulk memory operations
Disable bulk memory operations
Enable memory.copy and memory.fill
Disable memory.copy and memory.fill
Enable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen)
Disable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen)
Enable exception handling operations
Disable exception handling operations
Enable tail call operations
Disable tail call operations
Enable reference types
Disable reference types
Enable multivalue functions
Disable multivalue functions
Enable garbage collection
Disable garbage collection
Enable memory64
Disable memory64
Enable relaxed SIMD
Disable relaxed SIMD
Enable extended const expressions
Disable extended const expressions
Enable strings
Disable strings
Enable multimemory
Disable multimemory
Enable stack switching
Disable stack switching
Enable shared-everything threads
Disable shared-everything threads
Enable float 16 operations
Disable float 16 operations
Deprecated compatibility flag
Deprecated compatibility flag
Disables validation, assumes inputs are correct
An argument passed along to optimization passes being run. Must be in the form KEY@VALUE. If KEY is the name of a pass then it applies to the closest instance of that pass before us. If KEY is not the name of a pass then it is a global option that applies to all pass instances that read it.
Assume code outside of the module does not inspect or interact with GC and function references, even if they are passed out. The outside may hold on to them and pass them back in, but not inspect their contents or call them.
Preserve the order of types from the input (useful for debugging and testing)
generate StackIR during writing
optimize StackIR during writing
print StackIR during writing

General options: ----------------

Output version information and exit
Show this help message and exit
Print debug information to stderr
February 2025 wasm-split 122