Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file passes.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412typet=string(** lower unaligned loads and stores to smaller aligned ones *)letalignment_lowering="alignment-lowering"(** async/await style transform, allowing pausing and resuming *)letasyncify="asyncify"(** Tries to avoid reinterpret operations via more loads *)letavoid_reinterprets="avoid-reinterprets"(** removes arguments to calls in an lto-like manner *)letdae="dae"(** removes arguments to calls in an lto-like manner, and optimizes where we removed *)letdae_optimizing="dae-optimizing"(** refine and merge abstract (never-created) types *)letabstract_type_refining="abstract-type-refining"(** reduce # of locals by coalescing *)letcoalesce_locals="coalesce-locals"(** reduce # of locals by coalescing and learning *)letcoalesce_locals_learning="coalesce-locals-learning"(** push code forward, potentially making it not always execute *)letcode_pushing="code-pushing"(** fold code, merging duplicates *)letcode_folding="code-folding"(** hoist repeated constants to a local *)letconst_hoisting="const-hoisting"(** propagate constant struct field values *)letcfp="cfp"(** removes unreachable code *)letdce="dce"(** forces all loads and stores to have alignment 1 *)letdealign="dealign"(** instrument the wasm to convert NaNs into 0 at runtime *)letdenan="denan"(** turns indirect calls into direct ones *)letdirectize="directize"(** discards global effect info *)letdiscard_global_effects="discard-global-effects"(** optimizes using the DataFlow SSA IR *)letdfo="dfo"(** dump DWARF debug info sections from the read binary *)letdwarfdump="dwarfdump"(** removes duplicate imports *)letduplicate_import_elimination="duplicate-import-elimination"(** removes duplicate functions *)letduplicate_function_elimination="duplicate-function-elimination"(** emit the target features section in the output *)letemit_target_features="emit-target-features"(** leaves just one function (useful for debugging) *)letextract_function="extract-function"(** leaves just one function selected by index *)letextract_function_index="extract-function-index"(** flattens out code, removing nesting *)letflatten="flatten"(** emulates function pointer casts, allowing incorrect indirect calls to (sometimes) work *)letfpcast_emu="fpcast-emu"(** reports function metrics *)letfunc_metrics="func-metrics"(** generate dynCall fuctions used by emscripten ABI *)letgenerate_dyncalls="generate-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). *)letgenerate_i64_dyncalls="generate-i64-dyncalls"(** generate global effect info (helps later passes) *)letgenerate_global_effects="generate-global-effects"(** generate Stack IR *)letgenerate_stack_ir="generate-stack-ir"(** refine the types of globals *)letglobal_refining="global-refining"(** globally optimize struct values *)letgsi="gsi"(** globally optimize GC types *)letgto="gto"(** Grand Unified Flow Analysis: optimize the entire program using information about what content can actually appear in each location *)letgufa="gufa"(** GUFA plus local optimizations in functions we modified *)letgufa_optimizing="gufa-optimizing"(** apply more specific subtypes to type fields where possible *)lettype_refining="type-refining"(** replace GC allocations with locals *)letheap2local="heap2local"(** inline __original_main into main *)letinline_main="inline-main"(** inline functions (you probably want inlining-optimizing) *)letinlining="inlining"(** inline functions and optimizes where we inlined *)letinlining_optimizing="inlining-optimizing"(** lower away binaryen intrinsics *)letintrinsic_lowering="intrinsic-lowering"(** wrap imports and exports for JavaScript promise integration *)letjspi="jspi"(** legalizes i64 types on the import/export boundary *)letlegalize_js_interface="legalize-js-interface"(** legalizes i64 types on the import/export boundary in a minimal manner, only on things only JS will call *)letlegalize_js_interface_minimally="legalize-js-interface-minimally"(** common subexpression elimination inside basic blocks *)letlocal_cse="local-cse"(** apply more specific subtypes to locals where possible *)letlocal_subtyping="local-subtyping"(** instrument the build with logging of where execution goes *)letlog_execution="log-execution"(** lower all uses of i64s to use i32s instead *)leti64_to_i32_lowering="i64-to-i32-lowering"(** instrument the build with code to intercept all loads and stores *)letinstrument_locals="instrument-locals"(** instrument the build with code to intercept all loads and stores *)letinstrument_memory="instrument-memory"(** loop invariant code motion *)letlicm="licm"(** attempt to merge segments to fit within web limits *)letlimit_segments="limit-segments"(** lower loads and stores to a 64-bit memory to instead use a 32-bit one *)letmemory64_lowering="memory64-lowering"(** packs memory into separate segments, skipping zeros *)letmemory_packing="memory-packing"(** merges blocks to their parents *)letmerge_blocks="merge-blocks"(** merges similar functions when benefical *)letmerge_similar_functions="merge-similar-functions"(** merges locals when beneficial *)letmerge_locals="merge-locals"(** reports metrics *)letmetrics="metrics"(** minifies import names (only those, and not export names), and emits a mapping to the minified ones *)letminify_imports="minify-imports"(** minifies both import and export names, and emits a mapping to the minified ones *)letminify_imports_and_exports="minify-imports-and-exports"(** minifies both import and export names, and emits a mapping to the minified ones, and minifies the modules as well *)letminify_imports_and_exports_and_modules="minify-imports-and-exports-and-modules"(** apply the assumption that asyncify imports always unwind, and we never rewind *)letmod_asyncify_always_and_only_unwind="mod-asyncify-always-and-only-unwind"(** apply the assumption that asyncify never unwinds *)letmod_asyncify_never_unwind="mod-asyncify-never-unwind"(** creates specialized versions of functions *)letmonomorphize="monomorphize"(** creates specialized versions of functions (even if unhelpful) *)letmonomorphize_always="monomorphize-always"(** combines multiple memories into a single memory *)letmulti_memory_lowering="multi-memory-lowering"(** combines multiple memories into a single memory, trapping if the read or write is larger than the length of the memory's data *)letmulti_memory_lowering_with_bounds_checks="multi-memory-lowering-with-bounds-checks"(** name list *)letnm="nm"(** (re)name all heap types *)letname_types="name-types"(** reduces calls to code that only runs once *)letonce_reduction="once-reduction"(** optimizes added constants into load/store offsets *)letoptimize_added_constants="optimize-added-constants"(** optimizes added constants into load/store offsets, propagating them across locals too *)letoptimize_added_constants_propagate="optimize-added-constants-propagate"(** eliminate and reuse casts *)letoptimize_casts="optimize-casts"(** optimizes instruction combinations *)letoptimize_instructions="optimize-instructions"(** optimize Stack IR *)letoptimize_stack_ir="optimize-stack-ir"(** pick load signs based on their uses *)letpick_load_signs="pick-load-signs"(** Tranform Binaryen IR into Poppy IR *)letpoppify="poppify"(** miscellaneous optimizations for Emscripten-generated code *)letpost_emscripten="post-emscripten"(** early optimize of the instruction combinations for js *)letoptimize_for_js="optimize-for-js"(** computes compile-time evaluatable expressions *)letprecompute="precompute"(** computes compile-time evaluatable expressions and propagates them through locals *)letprecompute_propagate="precompute-propagate"(** print in s-expression format *)letprint="print"(** print in minified s-expression format *)letprint_minified="print-minified"(** print options for enabled features *)letprint_features="print-features"(** print in full s-expression format *)letprint_full="print-full"(** print call graph *)letprint_call_graph="print-call-graph"(** print a map of function indexes to names *)letprint_function_map="print-function-map"(** alias for print_function_map *)letsymbolmap="symbolmap"(** print out Stack IR (useful for internal debugging) *)letprint_stack_ir="print-stack-ir"(** removes operations incompatible with js *)letremove_non_js_ops="remove-non-js-ops"(** removes imports and replaces them with nops *)letremove_imports="remove-imports"(** removes memory segments *)letremove_memory="remove-memory"(** removes breaks from locations that are not needed *)letremove_unused_brs="remove-unused-brs"(** removes unused module elements *)letremove_unused_module_elements="remove-unused-module-elements"(** removes unused module elements that are not functions *)letremove_unused_nonfunction_module_elements="remove-unused-nonfunction-module-elements"(** removes names from locations that are never branched to *)letremove_unused_names="remove-unused-names"(** remove unused private GC types *)letremove_unused_types="remove-unused-types"(** sorts functions by access frequency *)letreorder_functions="reorder-functions"(** sorts globals by access frequency *)letreorder_globals="reorder-globals"(** sorts globals by access frequency (even if there are few) *)letreorder_globals_always="reorder-globals-always"(** sorts locals by access frequency *)letreorder_locals="reorder-locals"(** re-optimize control flow using the relooper algorithm *)letrereloop="rereloop"(** remove redundant local.sets *)letrse="rse"(** write the module to binary, then read it *)letroundtrip="roundtrip"(** instrument loads and stores to check for invalid behavior *)letsafe_heap="safe-heap"(** sets specified globals to specified values *)letset_globals="set-globals"(** remove params from function signature types where possible *)letsignature_pruning="signature-pruning"(** apply more specific subtypes to signature types where possible *)letsignature_refining="signature-refining"(** lower sign-ext operations to wasm mvp and disable the sign extension feature *)letsignext_lowering="signext-lowering"(** miscellaneous globals-related optimizations *)letsimplify_globals="simplify-globals"(** miscellaneous globals-related optimizations, and optimizes where we replaced global.gets with constants *)letsimplify_globals_optimizing="simplify-globals-optimizing"(** miscellaneous locals-related optimizations *)letsimplify_locals="simplify-locals"(** miscellaneous locals-related optimizations (no nesting at all; preserves flatness) *)letsimplify_locals_nonesting="simplify-locals-nonesting"(** miscellaneous locals-related optimizations (no tees) *)letsimplify_locals_notee="simplify-locals-notee"(** miscellaneous locals-related optimizations (no structure) *)letsimplify_locals_nostructure="simplify-locals-nostructure"(** miscellaneous locals-related optimizations (no tees or structure) *)letsimplify_locals_notee_nostructure="simplify-locals-notee-nostructure"(** emit Souper IR in text form *)letsouperify="souperify"(** emit Souper IR in text form (single-use nodes only) *)letsouperify_single_use="souperify-single-use"(** spill pointers to the C stack (useful for Boehm-style GC) *)letspill_pointers="spill-pointers"(** stub out unsupported JS operations *)letstub_unsupported_js="stub-unsupported-js"(** ssa-ify variables so that they have a single assignment *)letssa="ssa"(** ssa-ify variables so that they have a single assignment, ignoring merges *)letssa_nomerge="ssa-nomerge"(** deprecated; same as strip-debug *)letstrip="strip"(** enforce limits on llvm's __stack_pointer global *)letstack_check="stack-check"(** strip debug info (including the names section) *)letstrip_debug="strip-debug"(** strip dwarf debug info *)letstrip_dwarf="strip-dwarf"(** strip the wasm producers section *)letstrip_producers="strip-producers"(** strip EH instructions *)letstrip_eh="strip-eh"(** strip the wasm target features section *)letstrip_target_features="strip-target-features"(** replace trapping operations with clamping semantics *)lettrap_mode_clamp="trap-mode-clamp"(** replace trapping operations with js semantics *)lettrap_mode_js="trap-mode-js"(** merge types to their supertypes where possible *)lettype_merging="type-merging"(** create new nominal types to help other optimizations *)lettype_ssa="type-ssa"(** removes local.tees, replacing them with sets and gets *)letuntee="untee"(** removes obviously unneeded code *)letvacuum="vacuum"