Crate hugr_passes

Crate hugr_passes 

Source
Expand description

Compilation passes acting on the HUGR program representation.

Re-exports§

pub use composable::ComposablePass;
pub use dead_code::DeadCodeElimPass;
pub use inline_funcs::inline_acyclic;
pub use linearize_array::LinearizeArrayPass;
pub use replace_types::ReplaceTypes;
pub use force_order::force_order;
pub use force_order::force_order_by_key;
pub use lower::lower_ops;
pub use lower::replace_many_ops;
pub use non_local::ensure_no_nonlocal_edges;
pub use non_local::nonlocal_edges;
pub use untuple::UntuplePass;

Modules§

call_graph
Data structure for call graphs of a Hugr
composable
Compiler passes and utilities for composing them
const_fold
Constant-folding pass. An (example) use of the dataflow analysis framework.
dataflow
Dataflow analysis of Hugrs.
dead_code
Pass for removing dead code, i.e. that computes values that are then discarded
force_order
Provides force_order, a tool for fixing the order of nodes in a Hugr.
inline_dfgs
Provides InlineDFGsPass, a pass for inlining all DFGs in a Hugr.
inline_funcs
Contains a pass to inline calls to selected functions in a Hugr.
linearize_array
Provides LinearizeArrayPass which turns ’value_arrays into regular linear array`s.
lower
Passes to lower operations in a HUGR.
merge_bbs
Merge BBs along control-flow edges where the source BB has no other successors and the target BB has no other predecessors.
nest_cfgs
Nest CFGs
non_local
This module provides functions for finding non-local edges in a Hugr and converting them to local edges.
replace_types
Replace types with other types across the Hugr. See ReplaceTypes and Linearizer.
untuple
Pass for removing redundant tuple pack->unpack operations.

Structs§

MonomorphizePass
Replaces calls to polymorphic functions with calls to new monomorphic instantiations of the polymorphic ones.
RemoveDeadFuncsPass
A configuration for the Dead Function Removal pass.

Enums§

RemoveDeadFuncsError
Errors produced by RemoveDeadFuncsPass.

Functions§

mangle_name
Produce a mangled name for a monomorphized instance of a function.
monomorphize
Replaces calls to polymorphic functions with calls to new monomorphic instantiations of the polymorphic ones.
remove_dead_funcs
Deletes from the Hugr any functions that are not used by either Call or LoadFunction nodes in reachable parts.