================================================================================
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 Split an input module into two output
modules. The default mode.
--multi-split Split an input module into an arbitrary
number of output modules.
--instrument Instrument an input module to allow it to
generate a profile that can be used to
guide splitting.
--merge-profiles Merge multiple profiles for the same
module into a single profile.
--print-profile [print-profile] Print profile contents in
a human-readable format.
--profile [split] The profile to use to guide
splitting.
--keep-funcs [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-funcs [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.
--manifest [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.
--out-prefix [multi-split] Prefix prepended to module
names in the manifest file to create
output file names.
--primary-output,-o1 [split] Output file for the primary
module.
--secondary-output,-o2 [split] Output file for the secondary
module.
--symbolmap [split, multi-split] Write a symbol map
file for each of the output modules.
--no-placeholders [split, multi-split] Do not import
placeholder functions. Calls to secondary
functions will fail before the secondary
module has been instantiated.
--placeholdermap [split, multi-split] Write a file mapping
placeholder indices to the function
names.
--import-namespace [split, multi-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.
--placeholder-namespace-prefix [split, multi-split] The prefix for the
namespaces from which to import
placeholder functions into the primary
module. The namespaces will be
concatenations of the prefix and the
module name.
--placeholder-namespace [split, multi-split] The same as
--placeholder-namespace-prefix.
--export-prefix [split, multi-split] An identifying
prefix to prepend to new export names
created by module splitting.
--profile-export [instrument] The export name of the
function the embedder calls to write the
profile into memory. Defaults to
`__write_profile`.
--in-memory [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.
--in-secondary-memory [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.
--secondary-memory-name [instrument] The name of the secondary
memory created to store profile
information.
--initial-table [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.
--emit-text,-S [split, multi-split, instrument] Emit
text instead of binary for the output
file or files.
--debuginfo,-g [split, multi-split, instrument] Emit
names section in wasm binary (or full
debuginfo in wast)
--strip-debug [split, multi-split, instrument] Strip
debug info (including the names section)
--traps-never-happen,-tnh [split, multi-split] Split under the
helpful assumption that no trap is
reached at runtime (from load, div/mod,
etc.)
--output,-o [instrument, merge-profiles, multi-split]
Output file.
--verbose,-v Verbose output mode. Prints the functions
that will be kept and split out when
splitting a module.
Tool options:
-------------
--mvp-features,-mvp Disable all non-MVP features
--all-features,-all Enable all features
--detect-features (deprecated - this flag does nothing)
--quiet,-q Emit less verbose output and hide trivial
warnings.
--experimental-poppy Parse wast files as Poppy IR for testing
purposes.
--emit-module-names Emit module names, even if not emitting
the rest of the names section.
--enable-sign-ext Enable sign extension operations
--disable-sign-ext Disable sign extension operations
--enable-threads Enable atomic operations
--disable-threads Disable atomic operations
--enable-mutable-globals Enable mutable globals
--disable-mutable-globals Disable mutable globals
--enable-nontrapping-float-to-int Enable nontrapping float-to-int
operations
--disable-nontrapping-float-to-int Disable nontrapping float-to-int
operations
--enable-simd Enable SIMD operations and types
--disable-simd Disable SIMD operations and types
--enable-bulk-memory Enable bulk memory operations
--disable-bulk-memory Disable bulk memory operations
--enable-bulk-memory-opt Enable memory.copy and memory.fill
--disable-bulk-memory-opt Disable memory.copy and memory.fill
--enable-call-indirect-overlong Enable LEB encoding of call-indirect
(Ignored for compatibility as it has no
effect on Binaryen)
--disable-call-indirect-overlong Disable LEB encoding of call-indirect
(Ignored for compatibility as it has no
effect on Binaryen)
--enable-exception-handling Enable exception handling operations
--disable-exception-handling Disable exception handling operations
--enable-tail-call Enable tail call operations
--disable-tail-call Disable tail call operations
--enable-reference-types Enable reference types
--disable-reference-types Disable reference types
--enable-multivalue Enable multivalue functions
--disable-multivalue Disable multivalue functions
--enable-gc Enable garbage collection
--disable-gc Disable garbage collection
--enable-memory64 Enable memory64
--disable-memory64 Disable memory64
--enable-relaxed-simd Enable relaxed SIMD
--disable-relaxed-simd Disable relaxed SIMD
--enable-extended-const Enable extended const expressions
--disable-extended-const Disable extended const expressions
--enable-strings Enable strings
--disable-strings Disable strings
--enable-multimemory Enable multimemory
--disable-multimemory Disable multimemory
--enable-stack-switching Enable stack switching
--disable-stack-switching Disable stack switching
--enable-shared-everything Enable shared-everything threads
--disable-shared-everything Disable shared-everything threads
--enable-fp16 Enable float 16 operations
--disable-fp16 Disable float 16 operations
--enable-custom-descriptors Enable custom descriptors (RTTs) and
exact references
--disable-custom-descriptors Disable custom descriptors (RTTs) and
exact references
--enable-multibyte Enable multibyte array loads and stores
--disable-multibyte Disable multibyte array loads and stores
--enable-acquire-release-atomics Enable acquire/release atomic memory
operations
--disable-acquire-release-atomics Disable acquire/release atomic memory
operations
--enable-custom-page-sizes Enable custom page sizes
--disable-custom-page-sizes Disable custom page sizes
--enable-wide-arithmetic Enable wide arithmetic
--disable-wide-arithmetic Disable wide arithmetic
--enable-compact-imports Enable compact import section
--disable-compact-imports Disable compact import section
--enable-relaxed-atomics Enable relaxed atomic memory operations
--disable-relaxed-atomics Disable relaxed atomic memory operations
--enable-typed-function-references Deprecated compatibility flag
--disable-typed-function-references Deprecated compatibility flag
--no-validation,-n Disables validation, assumes inputs are
correct
--pass-arg,-pa 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.
--closed-world,-cw 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-type-order Preserve the order of types from the
input (useful for debugging and testing)
--generate-stack-ir generate StackIR during writing
--optimize-stack-ir optimize StackIR during writing
--print-stack-ir print StackIR during writing
General options:
----------------
--version Output version information and exit
--help,-h Show this help message and exit
--debug,-d Print debug information to stderr
Options (104)
| Option | Description | Source |
|---|---|---|
--split | Split an input module into two output modules. | help |
--multi-split | Split an input module into an arbitrary number of output modules. | help |
--instrument | Instrument an input module to allow it to generate a profile that can be used to guide splitting. | help |
--merge-profiles | Merge multiple profiles for the same module into a single profile. | help |
--print-profile | [print-profile] Print profile contents in a human-readable format. | help |
--profile | [split] The profile to use to guide splitting. | help |
--keep-funcs | [split] Comma-separated list of functions to keep in the primary module. | help |
--split-funcs | [split] Comma-separated list of functions to split out to the secondary module. | help |
--manifest | [multi-split] File describing the functions to be split into each module. | help |
--out-prefix | [multi-split] Prefix prepended to module names in the manifest file to create output file names. | help |
--primary-output, -o1 | [split] Output file for the primary module. | help |
--secondary-output, -o2 | [split] Output file for the secondary module. | help |
--symbolmap | [split, multi-split] Write a symbol map file for each of the output modules. | help |
--no-placeholders | [split, multi-split] Do not import placeholder functions. | help |
--placeholdermap | [split, multi-split] Write a file mapping placeholder indices to the function names. | help |
--import-namespace | [split, multi-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. | help |
--placeholder-namespace-prefix | [split, multi-split] The prefix for the namespaces from which to import placeholder functions into the primary module. | help |
--placeholder-namespace | [split, multi-split] The same as | help |
--export-prefix | [split, multi-split] An identifying prefix to prepend to new export names created by module splitting. | help |
--profile-export | [instrument] The export name of the function the embedder calls to write the profile into memory. | help |
--in-memory | [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. | help |
--in-secondary-memory | [instrument] Store profile information in a separate memory, rather than in module main memory or globals (the default). | help |
--secondary-memory-name | [instrument] The name of the secondary memory created to store profile information. | help |
--initial-table | [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. | help |
--emit-text, -S | [split, multi-split, instrument] Emit text instead of binary for the output file or files. | help |
--debuginfo, -g | [split, multi-split, instrument] Emit names section in wasm binary (or full debuginfo in wast) | help |
--strip-debug | [split, multi-split, instrument] Strip debug info (including the names section) | help |
--traps-never-happen, -tnh | [split, multi-split] Split under the helpful assumption that no trap is reached at runtime (from load, div/mod, etc.) | help |
--output, -o | [instrument, merge-profiles, multi-split] Output file. | help |
--verbose, -v | Verbose output mode. | help |
--mvp-features, -mvp | Disable all non-MVP features | help |
--all-features, -all | Enable all features | help |
--detect-features | (deprecated - this flag does nothing) | help |
--quiet, -q | Emit less verbose output and hide trivial warnings. | help |
--experimental-poppy | Parse wast files as Poppy IR for testing purposes. | help |
--emit-module-names | Emit module names, even if not emitting the rest of the names section. | help |
--enable-sign-ext | Enable sign extension operations | help |
--disable-sign-ext | Disable sign extension operations | help |
--enable-threads | Enable atomic operations | help |
--disable-threads | Disable atomic operations | help |
--enable-mutable-globals | Enable mutable globals | help |
--disable-mutable-globals | Disable mutable globals | help |
--enable-nontrapping-float-to-int | Enable nontrapping float-to-int operations | help |
--disable-nontrapping-float-to-int | Disable nontrapping float-to-int operations | help |
--enable-simd | Enable SIMD operations and types | help |
--disable-simd | Disable SIMD operations and types | help |
--enable-bulk-memory | Enable bulk memory operations | help |
--disable-bulk-memory | Disable bulk memory operations | help |
--enable-bulk-memory-opt | Enable memory.copy and memory.fill | help |
--disable-bulk-memory-opt | Disable memory.copy and memory.fill | help |
--enable-call-indirect-overlong | Enable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen) | help |
--disable-call-indirect-overlong | Disable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen) | help |
--enable-exception-handling | Enable exception handling operations | help |
--disable-exception-handling | Disable exception handling operations | help |
--enable-tail-call | Enable tail call operations | help |
--disable-tail-call | Disable tail call operations | help |
--enable-reference-types | Enable reference types | help |
--disable-reference-types | Disable reference types | help |
--enable-multivalue | Enable multivalue functions | help |
--disable-multivalue | Disable multivalue functions | help |
--enable-gc | Enable garbage collection | help |
--disable-gc | Disable garbage collection | help |
--enable-memory64 | Enable memory64 | help |
--disable-memory64 | Disable memory64 | help |
--enable-relaxed-simd | Enable relaxed SIMD | help |
--disable-relaxed-simd | Disable relaxed SIMD | help |
--enable-extended-const | Enable extended const expressions | help |
--disable-extended-const | Disable extended const expressions | help |
--enable-strings | Enable strings | help |
--disable-strings | Disable strings | help |
--enable-multimemory | Enable multimemory | help |
--disable-multimemory | Disable multimemory | help |
--enable-stack-switching | Enable stack switching | help |
--disable-stack-switching | Disable stack switching | help |
--enable-shared-everything | Enable shared-everything threads | help |
--disable-shared-everything | Disable shared-everything threads | help |
--enable-fp16 | Enable float 16 operations | help |
--disable-fp16 | Disable float 16 operations | help |
--enable-custom-descriptors | Enable custom descriptors (RTTs) and exact references | help |
--disable-custom-descriptors | Disable custom descriptors (RTTs) and exact references | help |
--enable-multibyte | Enable multibyte array loads and stores | help |
--disable-multibyte | Disable multibyte array loads and stores | help |
--enable-acquire-release-atomics | Enable acquire/release atomic memory operations | help |
--disable-acquire-release-atomics | Disable acquire/release atomic memory operations | help |
--enable-custom-page-sizes | Enable custom page sizes | help |
--disable-custom-page-sizes | Disable custom page sizes | help |
--enable-wide-arithmetic | Enable wide arithmetic | help |
--disable-wide-arithmetic | Disable wide arithmetic | help |
--enable-compact-imports | Enable compact import section | help |
--disable-compact-imports | Disable compact import section | help |
--enable-relaxed-atomics | Enable relaxed atomic memory operations | help |
--disable-relaxed-atomics | Disable relaxed atomic memory operations | help |
--enable-typed-function-references | Deprecated compatibility flag | help |
--disable-typed-function-references | Deprecated compatibility flag | help |
--no-validation, -n | Disables validation, assumes inputs are correct | help |
--pass-arg, -pa | An argument passed along to optimization passes being run. | help |
--closed-world, -cw | Assume code outside of the module does not inspect or interact with GC and function references, even if they are passed out. | help |
--preserve-type-order | Preserve the order of types from the input (useful for debugging and testing) | help |
--generate-stack-ir | generate StackIR during writing | help |
--optimize-stack-ir | optimize StackIR during writing | help |
--print-stack-ir | print StackIR during writing | help |
--version | Output version information and exit | help |
--help, -h | Show this help message and exit | help |
--debug, -d | Print debug information to stderr | help |