package binaryen

  1. Overview
  2. Docs
OCaml bindings for Binaryen

Install

Dune Dependency

Authors

Maintainers

Sources

binaryen-archive-v0.25.0.tar.gz
md5=9995941f04c211047dcfdd21a7613013
sha512=98a0f7dd181feec963209996e1a8cb6a62a90f9d54860a81c162ca77909f219de851a854ab263c351b10a54e9f4a600596dd71b0bd93cc71a1da5b99b74eb4a4

doc/binaryen/Binaryen/Passes/index.html

Module Binaryen.PassesSource

Sourcetype t
Sourceval alignment_lowering : t

lower unaligned loads and stores to smaller aligned ones

Sourceval asyncify : t

async/await style transform, allowing pausing and resuming

Sourceval avoid_reinterprets : t

Tries to avoid reinterpret operations via more loads

Sourceval dae : t

removes arguments to calls in an lto-like manner

Sourceval dae_optimizing : t

removes arguments to calls in an lto-like manner, and optimizes where we removed

Sourceval abstract_type_refining : t

refine and merge abstract (never-created) types

Sourceval coalesce_locals : t

reduce # of locals by coalescing

Sourceval coalesce_locals_learning : t

reduce # of locals by coalescing and learning

Sourceval code_pushing : t

push code forward, potentially making it not always execute

Sourceval code_folding : t

fold code, merging duplicates

Sourceval const_hoisting : t

hoist repeated constants to a local

Sourceval cfp : t

propagate constant struct field values

Sourceval dce : t

removes unreachable code

Sourceval dealign : t

forces all loads and stores to have alignment 1

Sourceval denan : t

instrument the wasm to convert NaNs into 0 at runtime

Sourceval directize : t

turns indirect calls into direct ones

Sourceval discard_global_effects : t

discards global effect info

Sourceval dfo : t

optimizes using the DataFlow SSA IR

Sourceval dwarfdump : t

dump DWARF debug info sections from the read binary

Sourceval duplicate_import_elimination : t

removes duplicate imports

Sourceval duplicate_function_elimination : t

removes duplicate functions

Sourceval emit_target_features : t

emit the target features section in the output

Sourceval extract_function : t

leaves just one function (useful for debugging)

Sourceval extract_function_index : t

leaves just one function selected by index

Sourceval flatten : t

flattens out code, removing nesting

Sourceval fpcast_emu : t

emulates function pointer casts, allowing incorrect indirect calls to (sometimes) work

Sourceval func_metrics : t

reports function metrics

Sourceval generate_dyncalls : t

generate dynCall fuctions used by emscripten ABI

Sourceval generate_i64_dyncalls : t

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).

Sourceval generate_global_effects : t

generate global effect info (helps later passes)

Sourceval generate_stack_ir : t

generate Stack IR

Sourceval global_refining : t

refine the types of globals

Sourceval gsi : t

globally optimize struct values

Sourceval gto : t

globally optimize GC types

Sourceval gufa : t

Grand Unified Flow Analysis: optimize the entire program using information about what content can actually appear in each location

Sourceval gufa_optimizing : t

GUFA plus local optimizations in functions we modified

Sourceval type_refining : t

apply more specific subtypes to type fields where possible

Sourceval heap2local : t

replace GC allocations with locals

Sourceval inline_main : t

inline __original_main into main

Sourceval inlining : t

inline functions (you probably want inlining-optimizing)

Sourceval inlining_optimizing : t

inline functions and optimizes where we inlined

Sourceval intrinsic_lowering : t

lower away binaryen intrinsics

Sourceval jspi : t

wrap imports and exports for JavaScript promise integration

Sourceval legalize_js_interface : t

legalizes i64 types on the import/export boundary

Sourceval legalize_js_interface_minimally : t

legalizes i64 types on the import/export boundary in a minimal manner, only on things only JS will call

Sourceval local_cse : t

common subexpression elimination inside basic blocks

Sourceval local_subtyping : t

apply more specific subtypes to locals where possible

Sourceval log_execution : t

instrument the build with logging of where execution goes

Sourceval i64_to_i32_lowering : t

lower all uses of i64s to use i32s instead

Sourceval instrument_locals : t

instrument the build with code to intercept all loads and stores

Sourceval instrument_memory : t

instrument the build with code to intercept all loads and stores

Sourceval licm : t

loop invariant code motion

Sourceval limit_segments : t

attempt to merge segments to fit within web limits

Sourceval memory64_lowering : t

lower loads and stores to a 64-bit memory to instead use a 32-bit one

Sourceval memory_packing : t

packs memory into separate segments, skipping zeros

Sourceval merge_blocks : t

merges blocks to their parents

Sourceval merge_similar_functions : t

merges similar functions when benefical

Sourceval merge_locals : t

merges locals when beneficial

Sourceval metrics : t

reports metrics

Sourceval minify_imports : t

minifies import names (only those, and not export names), and emits a mapping to the minified ones

Sourceval minify_imports_and_exports : t

minifies both import and export names, and emits a mapping to the minified ones

Sourceval minify_imports_and_exports_and_modules : t

minifies both import and export names, and emits a mapping to the minified ones, and minifies the modules as well

Sourceval mod_asyncify_always_and_only_unwind : t

apply the assumption that asyncify imports always unwind, and we never rewind

Sourceval mod_asyncify_never_unwind : t

apply the assumption that asyncify never unwinds

Sourceval monomorphize : t

creates specialized versions of functions

Sourceval monomorphize_always : t

creates specialized versions of functions (even if unhelpful)

Sourceval multi_memory_lowering : t

combines multiple memories into a single memory

Sourceval multi_memory_lowering_with_bounds_checks : t

combines multiple memories into a single memory, trapping if the read or write is larger than the length of the memory's data

Sourceval nm : t

name list

Sourceval name_types : t

(re)name all heap types

Sourceval once_reduction : t

reduces calls to code that only runs once

Sourceval optimize_added_constants : t

optimizes added constants into load/store offsets

Sourceval optimize_added_constants_propagate : t

optimizes added constants into load/store offsets, propagating them across locals too

Sourceval optimize_casts : t

eliminate and reuse casts

Sourceval optimize_instructions : t

optimizes instruction combinations

Sourceval optimize_stack_ir : t

optimize Stack IR

Sourceval pick_load_signs : t

pick load signs based on their uses

Sourceval poppify : t

Tranform Binaryen IR into Poppy IR

Sourceval post_emscripten : t

miscellaneous optimizations for Emscripten-generated code

Sourceval optimize_for_js : t

early optimize of the instruction combinations for js

Sourceval precompute : t

computes compile-time evaluatable expressions

Sourceval precompute_propagate : t

computes compile-time evaluatable expressions and propagates them through locals

Sourceval print : t

print in s-expression format

Sourceval print_minified : t

print in minified s-expression format

Sourceval print_features : t

print options for enabled features

Sourceval print_full : t

print in full s-expression format

Sourceval print_call_graph : t

print call graph

Sourceval print_function_map : t

print a map of function indexes to names

Sourceval symbolmap : t

alias for print_function_map

Sourceval print_stack_ir : t

print out Stack IR (useful for internal debugging)

Sourceval remove_non_js_ops : t

removes operations incompatible with js

Sourceval remove_imports : t

removes imports and replaces them with nops

Sourceval remove_memory : t

removes memory segments

Sourceval remove_unused_brs : t

removes breaks from locations that are not needed

Sourceval remove_unused_module_elements : t

removes unused module elements

Sourceval remove_unused_nonfunction_module_elements : t

removes unused module elements that are not functions

Sourceval remove_unused_names : t

removes names from locations that are never branched to

Sourceval remove_unused_types : t

remove unused private GC types

Sourceval reorder_functions : t

sorts functions by access frequency

Sourceval reorder_globals : t

sorts globals by access frequency

Sourceval reorder_globals_always : t

sorts globals by access frequency (even if there are few)

Sourceval reorder_locals : t

sorts locals by access frequency

Sourceval rereloop : t

re-optimize control flow using the relooper algorithm

Sourceval rse : t

remove redundant local.sets

Sourceval roundtrip : t

write the module to binary, then read it

Sourceval safe_heap : t

instrument loads and stores to check for invalid behavior

Sourceval set_globals : t

sets specified globals to specified values

Sourceval signature_pruning : t

remove params from function signature types where possible

Sourceval signature_refining : t

apply more specific subtypes to signature types where possible

Sourceval signext_lowering : t

lower sign-ext operations to wasm mvp

Sourceval simplify_globals : t

miscellaneous globals-related optimizations

Sourceval simplify_globals_optimizing : t

miscellaneous globals-related optimizations, and optimizes where we replaced global.gets with constants

Sourceval simplify_locals : t

miscellaneous locals-related optimizations

Sourceval simplify_locals_nonesting : t

miscellaneous locals-related optimizations (no nesting at all; preserves flatness)

Sourceval simplify_locals_notee : t

miscellaneous locals-related optimizations (no tees)

Sourceval simplify_locals_nostructure : t

miscellaneous locals-related optimizations (no structure)

Sourceval simplify_locals_notee_nostructure : t

miscellaneous locals-related optimizations (no tees or structure)

Sourceval souperify : t

emit Souper IR in text form

Sourceval souperify_single_use : t

emit Souper IR in text form (single-use nodes only)

Sourceval spill_pointers : t

spill pointers to the C stack (useful for Boehm-style GC)

Sourceval stub_unsupported_js : t

stub out unsupported JS operations

Sourceval ssa : t

ssa-ify variables so that they have a single assignment

Sourceval ssa_nomerge : t

ssa-ify variables so that they have a single assignment, ignoring merges

Sourceval strip : t

deprecated; same as strip-debug

Sourceval stack_check : t

enforce limits on llvm's __stack_pointer global

Sourceval strip_debug : t

strip debug info (including the names section)

Sourceval strip_dwarf : t

strip dwarf debug info

Sourceval strip_producers : t

strip the wasm producers section

Sourceval strip_eh : t

strip EH instructions

Sourceval strip_target_features : t

strip the wasm target features section

Sourceval trap_mode_clamp : t

replace trapping operations with clamping semantics

Sourceval trap_mode_js : t

replace trapping operations with js semantics

Sourceval type_merging : t

merge types to their supertypes where possible

Sourceval type_ssa : t

create new nominal types to help other optimizations

Sourceval untee : t

removes local.tees, replacing them with sets and gets

Sourceval vacuum : t

removes obviously unneeded code

OCaml

Innovation. Community. Security.