Enum binaryen_sys::passes::OptimizationPass
source · pub enum OptimizationPass {
Show 152 variants
AlignmentLowering,
Asyncify,
AvoidReinterprets,
Dae,
DaeOptimizing,
AbstractTypeRefining,
CoalesceLocals,
CoalesceLocalsLearning,
CodePushing,
CodeFolding,
ConstHoisting,
Cfp,
Dce,
Dealign,
Denan,
Directize,
DiscardGlobalEffects,
Dfo,
Dwarfdump,
DuplicateImportElimination,
DuplicateFunctionElimination,
EmitTargetFeatures,
ExtractFunction,
ExtractFunctionIndex,
Flatten,
FpcastEmu,
FuncMetrics,
GenerateDyncalls,
GenerateI64Dyncalls,
GenerateGlobalEffects,
GenerateStackIr,
GlobalRefining,
Gsi,
Gto,
Gufa,
GufaCastAll,
GufaOptimizing,
OptimizeJ2cl,
TypeRefining,
Heap2local,
InlineMain,
Inlining,
InliningOptimizing,
IntrinsicLowering,
Jspi,
LegalizeJsInterface,
LegalizeJsInterfaceMinimally,
LegalizeAndPruneJsInterface,
LocalCse,
LocalSubtyping,
LogExecution,
I64ToI32Lowering,
InstrumentLocals,
InstrumentMemory,
Licm,
LimitSegments,
Memory64Lowering,
MemoryPacking,
MergeBlocks,
MergeSimilarFunctions,
MergeLocals,
Metrics,
MinifyImports,
MinifyImportsAndExports,
MinifyImportsAndExportsAndModules,
ModAsyncifyAlwaysAndOnlyUnwind,
ModAsyncifyNeverUnwind,
Monomorphize,
MonomorphizeAlways,
MultiMemoryLowering,
MultiMemoryLoweringWithBoundsChecks,
Nm,
NameTypes,
NoInline,
NoFullInline,
NoPartialInline,
OnceReduction,
OptimizeAddedConstants,
OptimizeAddedConstantsPropagate,
OptimizeCasts,
OptimizeInstructions,
OptimizeStackIr,
Outlining,
PickLoadSigns,
Poppify,
PostEmscripten,
OptimizeForJs,
Precompute,
PrecomputePropagate,
Print,
PrintMinified,
PrintFeatures,
PrintFull,
PrintCallGraph,
PrintFunctionMap,
Symbolmap,
PrintStackIr,
PropagateGlobalsGlobally,
RemoveNonJsOps,
RemoveImports,
RemoveMemory,
RemoveUnusedBrs,
RemoveUnusedModuleElements,
RemoveUnusedNonfunctionModuleElements,
RemoveUnusedNames,
RemoveUnusedTypes,
ReorderFunctionsByName,
ReorderFunctions,
ReorderGlobals,
ReorderLocals,
Rereloop,
Rse,
Roundtrip,
SafeHeap,
SetGlobals,
SeparateDataSegments,
SignaturePruning,
SignatureRefining,
SignextLowering,
SimplifyGlobals,
SimplifyGlobalsOptimizing,
SimplifyLocals,
SimplifyLocalsNonesting,
SimplifyLocalsNotee,
SimplifyLocalsNostructure,
SimplifyLocalsNoteeNostructure,
Souperify,
SouperifySingleUse,
SpillPointers,
StubUnsupportedJs,
Ssa,
SsaNomerge,
StringGathering,
StringLowering,
Strip,
StackCheck,
StripDebug,
StripDwarf,
StripProducers,
StripEh,
StripTargetFeatures,
TranslateToNewEh,
TrapModeClamp,
TrapModeJs,
TupleOptimization,
TypeFinalizing,
TypeMerging,
TypeSsa,
TypeUnfinalizing,
Unsubtyping,
Untee,
Vacuum,
}
Variants§
AlignmentLowering
lower unaligned loads and stores to smaller aligned ones
Asyncify
async/await style transform, allowing pausing and resuming
AvoidReinterprets
Tries to avoid reinterpret operations via more loads
Dae
removes arguments to calls in an lto-like manner
DaeOptimizing
optimizes where we removed
AbstractTypeRefining
refine and merge abstract (never-created) types
CoalesceLocals
reduce # of locals by coalescing
CoalesceLocalsLearning
reduce # of locals by coalescing and learning
CodePushing
push code forward, potentially making it not always execute
CodeFolding
fold code, merging duplicates
ConstHoisting
hoist repeated constants to a local
Cfp
propagate constant struct field values
Dce
removes unreachable code
Dealign
forces all loads and stores to have alignment 1
Denan
instrument the wasm to convert NaNs into 0 at runtime
Directize
turns indirect calls into direct ones
DiscardGlobalEffects
discards global effect info
Dfo
optimizes using the DataFlow SSA IR
Dwarfdump
dump DWARF debug info sections from the read binary
DuplicateImportElimination
removes duplicate imports
DuplicateFunctionElimination
removes duplicate functions
EmitTargetFeatures
emit the target features section in the output
ExtractFunction
leaves just one function (useful for debugging)
ExtractFunctionIndex
leaves just one function selected by index
Flatten
flattens out code, removing nesting
FpcastEmu
calls to (sometimes) work
FuncMetrics
reports function metrics
GenerateDyncalls
generate dynCall fuctions used by emscripten ABI
GenerateI64Dyncalls
via the wasm table without JavaScript BigInt support).
GenerateGlobalEffects
generate global effect info (helps later passes)
GenerateStackIr
generate Stack IR
GlobalRefining
refine the types of globals
Gsi
globally optimize struct values
Gto
globally optimize GC types
Gufa
location
GufaCastAll
GUFA plus add casts for all inferences
GufaOptimizing
GUFA plus local optimizations in functions we modified
OptimizeJ2cl
optimizes J2CL specific constructs.
TypeRefining
apply more specific subtypes to type fields where possible
Heap2local
replace GC allocations with locals
InlineMain
inline __original_main into main
Inlining
inline functions (you probably want inlining-optimizing)
InliningOptimizing
inline functions and optimizes where we inlined
IntrinsicLowering
lower away binaryen intrinsics
Jspi
wrap imports and exports for JavaScript promise integration
LegalizeJsInterface
legalizes i64 types on the import/export boundary
LegalizeJsInterfaceMinimally
manner, only on things only JS will call
LegalizeAndPruneJsInterface
legalizes the import/export boundary and prunes when needed
LocalCse
common subexpression elimination inside basic blocks
LocalSubtyping
apply more specific subtypes to locals where possible
LogExecution
instrument the build with logging of where execution goes
I64ToI32Lowering
lower all uses of i64s to use i32s instead
InstrumentLocals
instrument the build with code to intercept all loads and stores
InstrumentMemory
instrument the build with code to intercept all loads and stores
Licm
loop invariant code motion
LimitSegments
attempt to merge segments to fit within web limits
Memory64Lowering
32-bit one
MemoryPacking
packs memory into separate segments, skipping zeros
MergeBlocks
merges blocks to their parents
MergeSimilarFunctions
merges similar functions when benefical
MergeLocals
merges locals when beneficial
Metrics
reports metrics
MinifyImports
emits a mapping to the minified ones
MinifyImportsAndExports
the minified ones
MinifyImportsAndExportsAndModules
the minified ones, and minifies the modules as well
ModAsyncifyAlwaysAndOnlyUnwind
and we never rewind
ModAsyncifyNeverUnwind
apply the assumption that asyncify never unwinds
Monomorphize
creates specialized versions of functions
MonomorphizeAlways
creates specialized versions of functions (even if unhelpful)
MultiMemoryLowering
combines multiple memories into a single memory
MultiMemoryLoweringWithBoundsChecks
write is larger than the length of the memory’s data
Nm
name list
NameTypes
(re)name all heap types
NoInline
mark functions as no-inline
NoFullInline
mark functions as no-inline (for full inlining only)
NoPartialInline
mark functions as no-inline (for partial inlining only)
OnceReduction
reduces calls to code that only runs once
OptimizeAddedConstants
optimizes added constants into load/store offsets
OptimizeAddedConstantsPropagate
them across locals too
OptimizeCasts
eliminate and reuse casts
OptimizeInstructions
optimizes instruction combinations
OptimizeStackIr
optimize Stack IR
Outlining
outline instructions
PickLoadSigns
pick load signs based on their uses
Poppify
Tranform Binaryen IR into Poppy IR
PostEmscripten
miscellaneous optimizations for Emscripten-generated code
OptimizeForJs
early optimize of the instruction combinations for js
Precompute
computes compile-time evaluatable expressions
PrecomputePropagate
them through locals
print in s-expression format
PrintMinified
print in minified s-expression format
PrintFeatures
print options for enabled features
PrintFull
print in full s-expression format
PrintCallGraph
print call graph
PrintFunctionMap
print a map of function indexes to names
Symbolmap
(alias for print-function-map)
PrintStackIr
print out Stack IR (useful for internal debugging)
PropagateGlobalsGlobally
propagate global values to other globals (useful for tests)
RemoveNonJsOps
removes operations incompatible with js
RemoveImports
removes imports and replaces them with nops
RemoveMemory
removes memory segments
RemoveUnusedBrs
removes breaks from locations that are not needed
RemoveUnusedModuleElements
removes unused module elements
RemoveUnusedNonfunctionModuleElements
removes unused module elements that are not functions
RemoveUnusedNames
removes names from locations that are never branched to
RemoveUnusedTypes
remove unused private GC types
ReorderFunctionsByName
sorts functions by name (useful for debugging)
ReorderFunctions
sorts functions by access frequency
ReorderGlobals
sorts globals by access frequency
ReorderLocals
sorts locals by access frequency
Rereloop
re-optimize control flow using the relooper algorithm
Rse
remove redundant local.sets
Roundtrip
write the module to binary, then read it
SafeHeap
instrument loads and stores to check for invalid behavior
SetGlobals
sets specified globals to specified values
SeparateDataSegments
write data segments to a file and strip them from the module
SignaturePruning
remove params from function signature types where possible
SignatureRefining
apply more specific subtypes to signature types where possible
SignextLowering
extension feature
SimplifyGlobals
miscellaneous globals-related optimizations
SimplifyGlobalsOptimizing
where we replaced global.gets with constants
SimplifyLocals
miscellaneous locals-related optimizations
SimplifyLocalsNonesting
preserves flatness)
SimplifyLocalsNotee
miscellaneous locals-related optimizations (no tees)
SimplifyLocalsNostructure
miscellaneous locals-related optimizations (no structure)
SimplifyLocalsNoteeNostructure
miscellaneous locals-related optimizations (no tees or structure)
Souperify
emit Souper IR in text form
SouperifySingleUse
emit Souper IR in text form (single-use nodes only)
SpillPointers
spill pointers to the C stack (useful for Boehm-style GC)
StubUnsupportedJs
stub out unsupported JS operations
Ssa
ssa-ify variables so that they have a single assignment
SsaNomerge
ssa-ify variables so that they have a single assignment, ignoring merges
StringGathering
gathers wasm strings to globals
StringLowering
lowers wasm strings and operations to imports
Strip
deprecated; same as strip-debug
StackCheck
enforce limits on llvm’s __stack_pointer global
StripDebug
strip debug info (including the names section)
StripDwarf
strip dwarf debug info
StripProducers
strip the wasm producers section
StripEh
strip EH instructions
StripTargetFeatures
strip the wasm target features section
TranslateToNewEh
translate old EH instructions to new ones
TrapModeClamp
replace trapping operations with clamping semantics
TrapModeJs
replace trapping operations with js semantics
TupleOptimization
optimize trivial tuples away
TypeFinalizing
mark all leaf types as final
TypeMerging
merge types to their supertypes where possible
TypeSsa
create new nominal types to help other optimizations
TypeUnfinalizing
mark all types as non-final (open)
Unsubtyping
removes unnecessary subtyping relationships
Untee
removes local.tees, replacing them with sets and gets
Vacuum
removes obviously unneeded code
Trait Implementations§
source§impl Debug for OptimizationPass
impl Debug for OptimizationPass
source§impl FromStr for OptimizationPass
impl FromStr for OptimizationPass
source§impl PartialEq for OptimizationPass
impl PartialEq for OptimizationPass
source§fn eq(&self, other: &OptimizationPass) -> bool
fn eq(&self, other: &OptimizationPass) -> bool
self
and other
values to be equal, and is used
by ==
.