Expand description
Shared optimization passes for WAFFLE (used by both backend and passes crates).
Re-exports§
pub use waffle_entity as entity;pub use waffle_ir as ir;pub use maxssa::*;pub use resolve_aliases::*;
Modules§
- cfg
- Lightweight CFG analyses.
- entity
- Type-safe indices and indexed containers for WAFFLE.
- interp
- Waffle IR interpreter.
- maxssa
- Conversion pass that creates “maximal SSA”: only local uses (no uses of defs in other blocks), with all values explicitly passed through blockparams. This makes some other transforms easier because it removes the need to worry about adding blockparams when mutating the CFG (all possible blockparams are already there!).
- op_
traits - Metadata on operators.
- resolve_
aliases - Resolve all aliases.
- scoped_
map - Scoped hashmap.
- util
- wasm_
encoder - A WebAssembly encoder.
- wasmparser
- A simple event-driven library for parsing WebAssembly binary files (or streams).
Macros§
Structs§
- Block
- Block
Def - Block
Target - CFGInfo
- Auxiliary analyses of the control-flow graph.
- Control
Tag - Control
TagData - Debug
- Debug
Map - A map from ranges of offsets in the original Wasm file to source locations.
- Entity
Vec - Export
- Func
- Function
Body - The body of a function, as an SSA-based intermediate representation.
- Function
Body Display - A wrapper around a
FunctionBodytogether with some auxiliary information to perform a pretty-print of that function. - Global
- Global
Data - Hole
Target - Ieee32
- An IEEE binary32 immediate floating point value, represented as a u32 containing the bit pattern.
- Ieee64
- An IEEE binary64 immediate floating point value, represented as a u64 containing the bit pattern.
- Import
- Interp
Context - Context for the IR interpreter. Corresponds roughly to Wasm module state.
- Interp
Memory - The state of one interpreter memory.
- Interp
Stack Frame - One stack frame in the interpreted execution context.
- Interp
Table - The state of one interpreter table.
- List
Pool - A “storage pool” backing many
ListRefs of the given type. - ListRef
- A handle to a list stored in a
ListPool. - Local
- Memory
- Memory
Arg - An argument to a memory load or store, specifying which memory, alignment and an optional offset.
- Memory
Data - A memory definition.
- Memory
Segment - Module
- Module
Display - PerEntity
- Vector of state per entity in an index-space that does not define the index-space. In other words, this container will not pass out new indices, it will only allow associating state with existing indices; and it requires a default value for data at an index not yet assigned.
- Signature
- Source
File - Source
Loc - Source
LocData - A “source location”: a filename (interned to an ID), a line, and a column.
- Table
- Table
Data - Value
- Value
Record - With
Mutablility - Something, alsong with whether it can be mutated
- With
Nullable - Something, alsong with whether it can be
null
Enums§
- Const
Val - A constant concrete value during interpretation.
- Export
Kind - Frontend
Error - An error that occurs when translating Wasm to IR.
- Func
Decl FuncDeclrepresents the various forms in which we can hold a function body: not yet parsed, parsed into full IR, recompiled into new bytecode, or an import (none of the above).- Handler
- An exception’s handler
- Heap
Type - a
Typethat can be stored on the heap - Import
Kind - Interp
Result - The result of an interpreter session.
- Operator
- An operator in the IR, consuming arguments and producing results when executed.
- Side
Effect - Side-effects that an operator may have.
- Signature
Data - Storage
Type - A storage type
- Terminator
- Type
- Types in waffle’s IR.
- Value
Def - A definition of an SSA value.
Constants§
- WASM_
PAGE - The size of a single Wasm page, used in memory definitions.
Traits§
- Entity
Ref - An index into an index-space of entities.
- Func
Collector - Subtypes
Functions§
- const_
eval - Constant-evaluate the given operator with the given arguments, returning a constant result if possible to know.
- i2x
- op_
inputs - Given a module and an existing operand stack for context, provide the type(s) that a given operator requires as inputs.
- op_
outputs - Given a module and an existing operand stack for context, provide the type(s) that a given operator provides as outputs.
- value_
is_ pure - x2i