WASM-METADCE(1)

๐Ÿ“ฆ
version 131 ยท 3 versions
, in ubuntu stonking

โœจ NAME โœจ

wasm-metadce โ€” the tool from the wasm-metadce(1) manual page that does dead code elimination (DCE) on a bigger space than just the wasm module ๐Ÿ’– it's giving very "I see the whole graph, not just the wasm" energy.


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay bestie, buckle up, because this one's a whole vibe โœจ

wasm-metadce INFILE

So here's the tea ๐Ÿ“: this tool performs dead code elimination (DCE) on a larger space that the wasm module is just a part of. Like, if you have JS and wasm that are connected, this can DCE the combined graph. And by doing that, it's able to eliminate wasm module exports, which otherwise regular optimizations cannot. periodt ๐Ÿ’…

This tool receives a representation of the reachability graph that the wasm module resides in, which contains abstract nodes and connections showing what they reach. Some of those nodes can represent the wasm module's imports and exports. The tool then completes the graph by adding the internal parts of the module, and does DCE on the entire thing. iconic behavior, honestly ๐Ÿ‘‘

This tool will output a wasm module with dead code eliminated, and metadata describing the things in the rest of the graph that can be eliminated as well. ๐ŸŽ€

The graph description file should represent the graph in the following JSON-like notation โ€” and note, bestie, this is not true JSON: things like comments, escaping, single-quotes, etc. are not supported ๐Ÿ™ˆ

[

{

"name": "entity1", "reaches": ["entity2, "entity3"], "root": true

}, {

"name": "entity2", "reaches": ["entity1, "entity4"]

}, {

"name": "entity3", "reaches": ["entity1"], "export": "export1"

}, {

"name": "entity4", "import": ["module", "import1"]

},

]

Each entity has a name and an optional list of the other entities it reaches. It can also be marked as a root, export (with the export string), or import (with the module and import strings). DCE then computes what is reachable from the roots. ๐ŸŒˆ


๐Ÿ› ๏ธ wasm-opt options

  • --output, -o โ€” the output file, aka where the slay goes ๐Ÿ’พ
  • --input-source-map, -ism โ€” consume source map from the specified file
  • --output-source-map, -osm โ€” emit source map to the specified file
  • --output-source-map-url, -osu โ€” emit specified string as source map URL
  • --emit-text, -S โ€” emit text instead of binary for the output file
  • --debuginfo, -g โ€” emit names section and debug info ๐Ÿ›
  • --graph-file, -f โ€” filename of the graph description file (the very graph we're DCE-ing, bestie)
  • --dump, -d โ€” dump the combined graph file (useful for debugging) ๐Ÿ”

๐Ÿ’… Optimization passes

like. there are SO many. and every single one of them matters, so we're not skipping a single one fr fr ๐Ÿซถ

  • --abstract-type-refining โ€” refine and merge abstract (never-created) types
  • --alignment-lowering โ€” lower unaligned loads and stores to smaller aligned ones
  • --asyncify โ€” async/await style transform, allowing pausing and resuming โธ๏ธโ–ถ๏ธ
  • --avoid-reinterprets โ€” tries to avoid reinterpret operations via more loads
  • --cfp โ€” propagate constant struct field values
  • --cfp-reftest โ€” propagate constant struct field values, using ref.test
  • --coalesce-locals โ€” reduce # of locals by coalescing
  • --coalesce-locals-learning โ€” reduce # of locals by coalescing and learning ๐Ÿง 
  • --code-folding โ€” fold code, merging duplicates
  • --code-pushing โ€” push code forward, potentially making it not always execute
  • --const-hoisting โ€” hoist repeated constants to a local
  • --constraint-analysis โ€” finds and uses mathematical constraints on locals ๐Ÿ“
  • --dae โ€” removes arguments to calls in an lto-like manner
  • --dae-optimizing โ€” removes arguments to calls in an lto-like manner, and optimizes where we removed
  • --dae2 โ€” Experimental reimplementation of DAE ๐Ÿงช
  • --dce โ€” removes unreachable code (our main character, lowkey ๐Ÿ’€)
  • --dealign โ€” forces all loads and stores to have alignment 1
  • --denan โ€” instrument the wasm to convert NaNs into 0 at runtime
  • --dfo โ€” optimizes using the DataFlow SSA IR
  • --directize โ€” turns indirect calls into direct ones
  • --discard-global-effects โ€” discards global effect info
  • --duplicate-function-elimination โ€” removes duplicate functions
  • --duplicate-import-elimination โ€” removes duplicate imports
  • --dwarfdump โ€” dump DWARF debug info sections from the read binary
  • --emit-target-features โ€” emit the target features section in the output
  • --enclose-world โ€” modify the wasm (destructively) for closed-world โš ๏ธ yes, destructively, we said what we said
  • --extract-function โ€” leaves just one function (useful for debugging)
  • --extract-function-index โ€” leaves just one function selected by index
  • --flatten โ€” flattens out code, removing nesting
  • --fpcast-emu โ€” emulates function pointer casts, allowing incorrect indirect calls to (sometimes) work ๐Ÿ™ˆ
  • --func-metrics โ€” reports function metrics ๐Ÿ“Š
  • --generate-dyncalls โ€” generate dynCall functions used by emscripten ABI
  • --generate-global-effects โ€” generate global effect info (helps later passes)
  • --generate-i64-dyncalls โ€” generate dynCall functions used by emscripten ABI, but only for functions with i64 in their signature (which cannot be invoked via the wasm table without JavaScript BigInt support).
  • --global-refining โ€” refine the types of globals
  • --gsi โ€” globally optimize struct values
  • --gsi-desc-cast โ€” globally optimize struct values, also emitting ref.cast_desc_eq
  • --gto โ€” globally optimize GC types
  • --gufa โ€” Grand Unified Flow Analysis: optimize the entire program using information about what content can actually appear in each location ๐Ÿ”ฎ
  • --gufa-cast-all โ€” GUFA plus add casts for all inferences
  • --gufa-optimizing โ€” GUFA plus local optimizations in functions we modified
  • --heap-store-optimization โ€” optimize heap (GC) stores
  • --heap2local โ€” replace GC allocations with locals
  • --i64-to-i32-lowering โ€” lower all uses of i64s to use i32s instead
  • --inline-main โ€” inline __original_main into main
  • --inlining โ€” inline functions (you probably want inlining-optimizing)
  • --inlining-optimizing โ€” inline functions and optimizes where we inlined
  • --instrument-branch-hints โ€” instrument branch hints so we can see which guessed right
  • --instrument-locals โ€” instrument the build with code to intercept all loads and stores
  • --instrument-memory โ€” instrument the build with code to intercept all loads and stores
  • --intrinsic-lowering โ€” lower away binaryen intrinsics
  • --legalize-and-prune-js-interface โ€” legalizes the import/export boundary and prunes when needed
  • --legalize-js-interface โ€” legalizes i64 types on the import/export boundary
  • --licm โ€” loop invariant code motion
  • --limit-segments โ€” attempt to merge segments to fit within web limits ๐ŸŒ
  • --llvm-memory-copy-fill-lowering โ€” Lower memory.copy and memory.fill to wasm mvp and disable the bulk-memory feature.
  • --llvm-nontrapping-fptoint-lowering โ€” lower nontrapping float-to-int operations to wasm mvp and disable the nontrapping fptoint feature
  • --local-cse โ€” common subexpression elimination inside basic blocks
  • --local-subtyping โ€” apply more specific subtypes to locals where possible
  • --log-execution โ€” instrument the build with logging of where execution goes ๐Ÿ“
  • --mark-js-called โ€” mark js called functions (using configureAll) as doing so
  • --memory-packing โ€” packs memory into separate segments, skipping zeros
  • --memory64-lowering โ€” lower loads and stores to a 64-bit memory to instead use a 32-bit one
  • --merge-blocks โ€” merges blocks to their parents
  • --merge-j2cl-itables โ€” Merges itable structures into vtables to make types more compact
  • --merge-locals โ€” merges locals when beneficial
  • --merge-similar-functions โ€” merges similar functions when benefical (yes that's the spelling, no we will not be fixing it, respect the source bestie)
  • --metrics โ€” reports metrics (with an optional title, --metrics[=TITLE])
  • --minify-imports โ€” minifies import names (only those, and not export names), and emits a mapping to the minified ones
  • --minify-imports-and-exports โ€” minifies both import and export names, and emits a mapping to the minified ones
  • --minify-imports-and-exports-and-modules โ€” minifies both import and export names, and emits a mapping to the minified ones, and minifies the modules as well
  • --minimize-rec-groups โ€” Split types into minimal recursion groups
  • --monomorphize โ€” creates specialized versions of functions
  • --monomorphize-always โ€” creates specialized versions of functions (even if unhelpful) ๐Ÿ˜ญ
  • --multi-memory-lowering โ€” combines multiple memories into a single memory
  • --multi-memory-lowering-with-bounds-checks โ€” combines multiple memories into a single memory, trapping if the read or write is larger than the length of the memory's data
  • --name-types โ€” (re)name all heap types
  • --nm โ€” name list
  • --no-full-inline โ€” mark functions as no-inline (for full inlining only)
  • --no-inline โ€” mark functions as no-inline
  • --no-partial-inline โ€” mark functions as no-inline (for partial inlining only)
  • --once-reduction โ€” reduces calls to code that only runs once
  • --optimize-added-constants โ€” optimizes added constants into load/store offsets
  • --optimize-added-constants-propagate โ€” optimizes added constants into load/store offsets, propagating them across locals too
  • --optimize-casts โ€” eliminate and reuse casts
  • --optimize-for-js โ€” early optimize of the instruction combinations for js
  • --optimize-instructions โ€” optimizes instruction combinations
  • --optimize-j2cl โ€” optimizes J2CL specific constructs.
  • --outlining โ€” outline instructions
  • --pick-load-signs โ€” pick load signs based on their uses
  • --poppify โ€” Transform Binaryen IR into Poppy IR ๐ŸŒธ
  • --post-emscripten โ€” miscellaneous optimizations for Emscripten-generated code
  • --precompute โ€” computes compile-time evaluatable expressions
  • --precompute-propagate โ€” computes compile-time evaluatable expressions and propagates them through locals
  • --print โ€” print in s-expression format
  • --print-boundary โ€” print boundary in JSON format
  • --print-call-graph โ€” print call graph
  • --print-features โ€” print options for enabled features
  • --print-full โ€” print in full s-expression format

  • --print-function-map โ€” prints a map that links function indexes to their names. It's literally the backstage pass of function identity ๐ŸŽŸ๏ธโœจ
  • --print-minified โ€” prints in minified s-expression format. Tiny text, zero fluff, maximum compactness ๐Ÿ’…
  • --propagate-debug-locs โ€” propagates debug location from parents or previous siblings down to child nodes. Debug info said pass it down and it did ๐Ÿงš
  • --propagate-globals-globally โ€” propagates global values to other globals (useful for tests). Globals helping globals, we love to see it ๐Ÿซถ
  • --remove-exports โ€” removes exports using a wildcard. Wildcard said begone ๐Ÿ‘‹
  • --remove-imports โ€” removes imports and replaces them with nops. Imports? Never heard of her ๐Ÿ’€
  • --remove-memory โ€” removes memory init (legacy name). Bestie this is the legacy name, so it's giving old-school ๐Ÿ˜ญ
  • --remove-memory-init โ€” removes memory initialization. The glow-up version of the legacy one โœจ
  • --remove-non-js-ops โ€” removes operations that are incompatible with js. If JS can't sit with it, it's out ๐Ÿšซ
  • --remove-relaxed-simd โ€” replaces relaxed SIMD instructions with unreachable. Relaxed? Not anymore, bestie ๐Ÿ’…
  • --remove-unused-brs โ€” removes breaks from locations that are not needed. Unnecessary breaks? We don't know them ๐Ÿ™ˆ
  • --remove-unused-module-elements โ€” removes unused module elements. Decluttered, organized, iconic โœจ
  • --remove-unused-names โ€” removes names from locations that are never branched to. If nobody branches to you, why are you named? ๐Ÿ’€
  • --remove-unused-nonfunction-module-elements โ€” removes unused module elements that are not functions. Non-function elements, you are dismissed ๐Ÿซก
  • --remove-unused-types โ€” remove unused private GC types. Private types that nobody uses? Bye ๐Ÿ‘‹
  • --reorder-functions โ€” sorts functions by access frequency. Most-used functions first, main character energy ๐Ÿ‘‘
  • --reorder-functions-by-name โ€” sorts functions by name (useful for debugging). Alphabetical order said let me cook ๐Ÿณ
  • --reorder-globals โ€” sorts globals by access frequency. Globals getting reordered by how popular they are ๐Ÿ’…
  • --reorder-locals โ€” sorts locals by access frequency. Locals said rate me by my usage ๐Ÿ“ˆ
  • --reorder-types โ€” sorts private types by access frequency. Private types, this is your popularity contest ๐Ÿ†
  • --rereloop โ€” re-optimizes control flow using the relooper algorithm. Control flow said makeover time ๐Ÿฆ‹
  • --roundtrip โ€” writes the module to binary, then reads it. A little binary vacation, then back home ๐Ÿ 
  • --rse โ€” remove redundant local.sets. Three letters, one job, lowkey iconic ๐Ÿ’…
  • --safe-heap โ€” instruments loads and stores to check for invalid behavior. Safety first, bestie ๐Ÿฆบ
  • --separate-data-segments โ€” writes data segments to a file and strips them from the module. Data segments said I need space ๐Ÿ“
  • --set-globals โ€” sets specified globals to specified values. Globals getting assigned, no cap ๐ŸŽฏ
  • --signature-pruning โ€” removes params from function signature types where possible. Params that aren't needed? Pruned โœ‚๏ธ
  • --signature-refining โ€” applies more specific subtypes to signature types where possible. Signature said be more specific ๐Ÿ”
  • --signext-lowering โ€” lowers sign-ext operations to wasm mvp and disables the sign extension feature. Downgraded to mvp, respectfully ๐Ÿ’…
  • --simplify-globals โ€” miscellaneous globals-related optimizations. Globals getting a little self-care ๐Ÿง–
  • --simplify-globals-optimizing โ€” miscellaneous globals-related optimizations, and optimizes where we replaced global.gets with constants. Constants said we ate ๐Ÿฝ๏ธ
  • --simplify-locals โ€” miscellaneous locals-related optimizations. Locals getting simplified, periodt ๐Ÿ’…
  • --simplify-locals-nonesting โ€” miscellaneous locals-related optimizations (no nesting at all; preserves flatness). Flatness preserved, no nesting drama ๐Ÿซถ
  • --simplify-locals-nostructure โ€” miscellaneous locals-related optimizations (no structure). Structure? Never met her ๐Ÿ’€
  • --simplify-locals-notee โ€” miscellaneous locals-related optimizations (no tees). Tees are not invited to this party ๐Ÿšซ
  • --simplify-locals-notee-nostructure โ€” miscellaneous locals-related optimizations (no tees or structure). No tees, no structure, just vibes โœจ
  • --souperify โ€” emit Souper IR in text form. Souper IR said read me ๐Ÿ“
  • --souperify-single-use โ€” emit Souper IR in text form (single-use nodes only). Single-use nodes only, exclusive club ๐Ÿ’…
  • --spill-pointers โ€” spill pointers to the C stack (useful for Boehm-style GC). Pointers said spill the tea โ˜•
  • --ssa โ€” ssa-ify variables so that they have a single assignment. One variable, one assignment, one destiny ๐Ÿ’ซ
  • --ssa-nomerge โ€” ssa-ify variables so that they have a single assignment, ignoring merges. Single assignment, but merges are ignored ๐Ÿ™ˆ
  • --stack-check โ€” enforce limits on llvm's __stack_pointer global. Stack pointer said boundaries, bestie ๐Ÿšง
  • --string-gathering โ€” gathers wasm strings to globals. Strings said come together right now ๐ŸŽถ
  • --string-lifting โ€” lift string imports to wasm strings. Imports getting lifted up, glow-up style โœจ
  • --string-lowering โ€” lowers wasm strings and operations to imports. Strings going down to imports, respectfully ๐Ÿ’…
  • --string-lowering-magic-imports โ€” same as string-lowering, but encodes well-formed strings as magic imports. Magic imports said abracadabra ๐Ÿช„
  • --string-lowering-magic-imports-assert โ€” same as string-lowering-magic-imports, but raise a fatal error if there are invalid strings. Invalid strings? Fatal error, no cap ๐Ÿ’€
  • --strip โ€” deprecated; same as strip-debug. Bestie, deprecated ๐Ÿ˜ญ same energy as strip-debug
  • --strip-debug โ€” strip debug info (including the names section). Debug info stripped, names section included in the yeet ๐Ÿงน
  • --strip-dwarf โ€” strip dwarf debug info. Dwarf debug info said I'm out ๐Ÿ‘‹
  • --strip-eh โ€” strip EH instructions. EH instructions stripped, periodt ๐Ÿ’…
  • --strip-producers โ€” strip the wasm producers section. Producers section? Gone ๐Ÿซก
  • --strip-target-features โ€” strip the wasm target features section. Target features section said not today ๐Ÿšซ
  • --strip-toolchain-annotations โ€” strip all toolchain-specific code annotations. Toolchain annotations, you are dismissed ๐Ÿ’…
  • --stub-unsupported-js โ€” stub out unsupported JS operations. Unsupported JS said stub me out ๐Ÿชต
  • --symbolmap โ€” alias for print-function-map. Same map, different name, iykyk ๐Ÿ—บ๏ธ
  • --table64-lowering โ€” alias for memory64-lowering. Alias behavior, no extra thoughts ๐Ÿ’ญ
  • --trace-calls โ€” instrument the build with code to intercept specific function calls. Calls getting traced like true crime ๐Ÿ”
  • --translate-to-exnref โ€” translate old Phase 3 EH instructions to new ones with exnref. Old Phase 3 said makeover ๐Ÿ’…
  • --translate-to-new-eh โ€” deprecated; same as translate-to-exnref. Deprecated bestie, same as translate-to-exnref ๐Ÿ˜ญ
  • --trap-mode-clamp โ€” replace trapping operations with clamping semantics. Traps said clamp it ๐Ÿ—œ๏ธ
  • --trap-mode-js โ€” replace trapping operations with js semantics. Traps said JS vibes only ๐Ÿ’›
  • --tuple-optimization โ€” optimize trivial tuples away. Trivial tuples said bye ๐Ÿ‘‹
  • --type-finalizing โ€” mark all leaf types as final. Leaf types said final answer โœ…
  • --type-merging โ€” merge types to their supertypes where possible. Types merging like a friend group ๐Ÿค
  • --type-refining โ€” apply more specific subtypes to type fields where possible. Type fields said be more specific ๐Ÿ”
  • --type-refining-gufa โ€” apply more specific subtypes to type fields where possible (using GUFA). Same as above but GUFA said let me help ๐Ÿซถ
  • --type-ssa โ€” create new types to help other optimizations. New types on the block, helping the team ๐Ÿ‘‘
  • --type-unfinalizing โ€” mark all types as non-final (open). Final? Not anymore, we open now ๐Ÿšช
  • --unsubtyping โ€” removes unnecessary subtyping relationships. Unnecessary relationships? Removed ๐Ÿšซ
  • --untee โ€” removes local.tees, replacing them with sets and gets. Tees said we're replaced ๐Ÿ’…
  • --vacuum โ€” removes obviously unneeded code. Code getting vacuumed, obviously ๐Ÿงน

โšก Optimization options โšก

  • -O โ€” execute default optimization passes (equivalent to -Os). Default energy, size-focused slay โœจ
  • -O0 โ€” execute no optimization passes. Optimization said not today ๐Ÿšซ
  • -O1 โ€” execute -O1 optimization passes (quick&useful opts, useful for iteration builds). Quick and useful, perfect for iteration vibes ๐Ÿ”
  • -O2 โ€” execute -O2 optimization passes (most opts, generally gets most perf). Most opts, generally most perf, main character of optimization levels ๐Ÿ‘‘
  • -O3 โ€” execute -O3 optimization passes (spends potentially a lot of time optimizing). It may take a lot of time, but it's committed ๐Ÿ•ฐ๏ธ
  • -O4 โ€” execute -O4 optimization passes (also flatten the IR, which can take a lot more time and memory, but is useful on more nested / complex / less-optimized input). More time, more memory, more nesting support, highkey intense ๐Ÿ”ฅ
  • -Os โ€” execute default optimization passes, focusing on code size. Code size said small is beautiful ๐ŸŽ€
  • -Oz โ€” execute default optimization passes, super-focusing on code size. Super-focusing on size, tiny queen behavior ๐Ÿ’…
  • --optimize-level, -ol โ€” How much to focus on optimizing code. Dial in your optimization obsession level ๐ŸŽ›๏ธ
  • --shrink-level, -s โ€” How much to focus on shrinking code size. Dial in your shrinking obsession level ๐Ÿ“‰
  • --debuginfo, -g โ€” Emit names section in wasm binary (or full debuginfo in wast). Debug info said include me ๐Ÿชช
  • --always-inline-max-function-size, -aimfs โ€” Max size of functions that are always inlined (default 2, which is safe for use with -Os builds). Default 2, safe with -Os builds, no cap ๐Ÿงข
  • --flexible-inline-max-function-size, -fimfs โ€” Max size of functions that are inlined when lightweight (no loops or function calls) when optimizing aggressively for speed (-O3). Default: 20. Lightweight only, no loops or calls, default 20, aggressive speed mode ๐ŸŽ๏ธ
  • --one-caller-inline-max-function-size, -ocimfs โ€” Max size of functions that are inlined when there is only one caller (default -1, which means all such functions are inlined). Default -1, which means all such functions are inlined, only-one-caller energy ๐Ÿ“ž
  • --inline-max-combined-binary-size, -imcbs โ€” Max size of combined functions after inlining. Default: 409600. Default 409600, combined size limit, respect it ๐Ÿ“
  • --inline-functions-with-loops, -ifwl โ€” Allow inlining functions with loops. Loops are invited to the inline party ๐Ÿ”„
  • --partial-inlining-ifs, -pii โ€” Number of ifs allowed in partial inlining (zero means partial inlining is disabled) (default: 0). Default 0, zero ifs means partial inlining is disabled ๐Ÿšซ
  • --ignore-implicit-traps, -iit โ€” Optimize under the helpful assumption that no surprising traps occur (from load, div/mod, etc.). Assumption: no surprising traps, helpful but bold ๐Ÿ˜Œ
  • --traps-never-happen, -tnh โ€” Optimize under the helpful assumption that no trap is reached at runtime (from load, div/mod, etc.). Assumption: no trap is reached at runtime, living dangerously โœจ
  • --low-memory-unused, -lmu โ€” Optimize under the helpful assumption that the low 1K of memory is not used by the application. Assumption: low 1K of memory is unused, okay bestie ๐Ÿง 
  • --fast-math, -ffm โ€” Optimize floats without handling corner cases of NaNs and rounding. Floats optimized, NaNs and rounding corner cases not handled ๐Ÿ’…
  • --zero-filled-memory, -uim โ€” Assume that an imported memory will be zero-initialized. Assumption: imported memory is zero-initialized, clean slate energy ๐Ÿงผ
  • --skip-pass, -sp โ€” Skip a pass (do not run it). Pass said not running ๐Ÿƒโ€โ™€๏ธ

๐Ÿงฐ Tool options ๐Ÿงฐ

  • --mvp-features, -mvp โ€” Disable all non-MVP features. MVP only, non-MVP features said peace out โœŒ๏ธ
  • --all-features, -all โ€” Enable all features. Everything on, all features invited, no exclusions ๐ŸŽ‰
  • --detect-features โ€” (deprecated - this flag does nothing). Deprecated and fr it does absolutely nothing, ghost flag ๐Ÿ‘ป
  • --quiet, -q โ€” Emit less verbose output and hide trivial warnings. Less yapping, trivial warnings hidden ๐Ÿคซ
  • --experimental-poppy โ€” Parse wast files as Poppy IR for testing purposes. Poppy IR said it's giving experimental ๐Ÿงช
  • --emit-module-names โ€” Emit module names, even if not emitting the rest of the names section. Names emitted even without the rest, independent queen ๐Ÿ‘‘
  • --enable-sign-ext โ€” Enable sign extension operations. Sign extension operations enabled โœ…
  • --disable-sign-ext โ€” Disable sign extension operations. Sign extension operations disabled โŒ
  • --enable-threads โ€” Enable atomic operations. Atomic operations enabled โš›๏ธ
  • --disable-threads โ€” Disable atomic operations. Atomic operations disabled ๐Ÿšซ
  • --enable-mutable-globals โ€” Enable mutable globals. Mutable globals enabled ๐Ÿ’…
  • --disable-mutable-globals โ€” Disable mutable globals. Mutable globals disabled ๐Ÿ›‘
  • --enable-nontrapping-float-to-int โ€” Enable nontrapping float-to-int operations. Nontrapping float-to-int enabled โœจ
  • --disable-nontrapping-float-to-int โ€” Disable nontrapping float-to-int operations. Nontrapping float-to-int disabled ๐Ÿ’€
  • --enable-simd โ€” Enable SIMD operations and types. SIMD operations and types enabled ๐Ÿ”ฅ
  • --disable-simd โ€” Disable SIMD operations and types. SIMD operations and types disabled ๐Ÿšซ
  • --enable-bulk-memory โ€” Enable bulk memory operations. Bulk memory operations enabled ๐Ÿง 
  • --disable-bulk-memory โ€” Disable bulk memory operations. Bulk memory operations disabled ๐Ÿ˜ญ
  • --enable-bulk-memory-opt โ€” Enable memory.copy and memory.fill. memory.copy and memory.fill enabled ๐Ÿ’พ
  • --disable-bulk-memory-opt โ€” Disable memory.copy and memory.fill. memory.copy and memory.fill disabled ๐Ÿšซ
  • --enable-call-indirect-overlong โ€” Enable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen). Ignored for compatibility, no effect on Binaryen, so don't stress ๐Ÿง˜
  • --disable-call-indirect-overlong โ€” Disable LEB encoding of call-indirect (Ignored for compatibility as it has no effect on Binaryen). Also ignored for compatibility, also no effect on Binaryen, twins ๐Ÿ’…
  • --enable-exception-handling โ€” Enable exception handling operations. Exception handling operations enabled ๐Ÿšจ
  • --disable-exception-handling โ€” Disable exception handling operations. Exception handling operations disabled ๐Ÿ›‘
  • --enable-tail-call โ€” Enable tail call operations. Tail call operations enabled ๐Ÿพ
  • --disable-tail-call โ€” Disable tail call operations. Tail call operations disabled ๐Ÿšซ
  • --enable-reference-types โ€” Enable reference types. Reference types enabled ๐Ÿซถ
  • --disable-reference-types โ€” Disable reference types. Reference types disabled โŒ
  • --enable-multivalue โ€” Enable multivalue functions. Multivalue functions enabled โœจ
  • --disable-multivalue โ€” Disable multivalue functions. Multivalue functions disabled ๐Ÿ’€
  • --enable-gc โ€” turn garbage collection on ๐Ÿ’š
  • --disable-gc โ€” turn garbage collection off
  • --enable-memory64 โ€” turn 64-bit memory on
  • --disable-memory64 โ€” turn 64-bit memory off
  • --enable-relaxed-simd โ€” turn relaxed SIMD on
  • --disable-relaxed-simd โ€” turn relaxed SIMD off
  • --enable-extended-const โ€” turn extended const expressions on
  • --disable-extended-const โ€” turn extended const expressions off
  • --enable-strings โ€” turn strings on ๐ŸŽ€
  • --disable-strings โ€” turn strings off
  • --enable-multimemory โ€” turn multimemory on
  • --disable-multimemory โ€” turn multimemory off
  • --enable-stack-switching โ€” turn stack switching on
  • --disable-stack-switching โ€” turn stack switching off
  • --enable-shared-everything โ€” turn shared-everything threads on
  • --disable-shared-everything โ€” turn shared-everything threads off
  • --enable-fp16 โ€” turn float 16 operations on
  • --disable-fp16 โ€” turn float 16 operations off
  • --enable-custom-descriptors โ€” turn custom descriptors (RTTs) and exact references on
  • --disable-custom-descriptors โ€” turn custom descriptors (RTTs) and exact references off
  • --enable-multibyte โ€” turn multibyte array loads and stores on
  • --disable-multibyte โ€” turn multibyte array loads and stores off
  • --enable-relaxed-atomics โ€” turn acquire/release atomic memory operations on
  • --disable-relaxed-atomics โ€” turn acquire/release atomic memory operations off
  • --enable-custom-page-sizes โ€” turn custom page sizes on
  • --disable-custom-page-sizes โ€” turn custom page sizes off
  • --enable-wide-arithmetic โ€” turn wide arithmetic on
  • --disable-wide-arithmetic โ€” turn wide arithmetic off
  • --enable-compact-imports โ€” turn the compact import section on
  • --disable-compact-imports โ€” turn the compact import section off
  • --enable-typed-function-references โ€” deprecated compatibility flag ๐Ÿ‘€ it's giving "legacy era", bestie
  • --disable-typed-function-references โ€” deprecated compatibility flag ๐Ÿ‘€ same vibe, other direction
  • --no-validation, -n โ€” no cap, this one just turns validation ALL the way off. It straight up assumes your inputs are correct, whichโ€ฆ girl. If they're not, that's between you and the consequences ๐Ÿ’€
  • --pass-arg, -pa โ€” an argument you hand off to the optimization passes that are running. Has to be shaped like KEY@VALUE. If KEY matches the name of a pass, it lands on the closest instance of that pass sitting before us. If KEY isn't a pass name, then it's a global option, and it applies to literally every pass instance that reads it โœจ
  • --closed-world, -cw โ€” assume the code outside the module does not inspect or interact with GC and function references, even if they get passed out. The outside can hold on to them and pass them back in, but it can't peek inside them or call them ๐Ÿ‘‘
  • --preserve-type-order โ€” keep the types in the same order they came in from the input (so useful for debugging and testing, fr fr) ๐Ÿงš
  • --generate-stack-ir โ€” generate StackIR while writing
  • --optimize-stack-ir โ€” optimize StackIR while writing
  • --print-stack-ir โ€” print StackIR while writing
  • --no-stack-ir โ€” don't use StackIR at all (even when it's the default) ๐Ÿ™ˆ

๐ŸŒˆ General options ๐ŸŒˆ

  • --version โ€” spit out the version info and dip ๐Ÿฆ‹
  • --help, -h โ€” show this help message and exit, bestie's always got you ๐Ÿซถ
  • --debug, -d โ€” print debug information to stderr ๐Ÿ”ฅ

And that's the whole page, babes โ€” part 3 done, we ate and left no crumbs ๐Ÿ’…<br> This one's wasm-metadce, version 131, dated August 2026, and it lives at WASM-METADCE(1). Go forth and debug, queen ๐Ÿ‘‘โญ

๐Ÿ“ฆ where this page comes from