Struct calyx::passes::CollapseControl [−][src]
pub struct CollapseControl {}Expand description
Collapses and de-nests control constructs.
Running this pass removes unnecessary FSM transitions and compilation groups during the lowering phase.
Example
- Collapses nested
seq:
seq {
seq { A; B }
C;
}into
seq { A; B C; }- Collapses nested
par:
par {
par { A; B }
C;
}into
par { A; B C; }Trait Implementations
Returns the “default value” for a type. Read more
fn finish_seq(
&mut self,
s: &mut Seq,
_comp: &mut Component,
_c: &LibrarySignatures
) -> VisResult
fn finish_seq(
&mut self,
s: &mut Seq,
_comp: &mut Component,
_c: &LibrarySignatures
) -> VisResult
Collapse seq { seq { A }; B } into seq { A; B }.
fn finish_par(
&mut self,
s: &mut Par,
_comp: &mut Component,
_c: &LibrarySignatures
) -> VisResult
fn finish_par(
&mut self,
s: &mut Par,
_comp: &mut Component,
_c: &LibrarySignatures
) -> VisResult
Collapse par { par { A }; B } into par { A; B }.
Returns true if this pass requires a post-order traversal of the
components.
In a post-order traversal, if component B uses a component A,
then A is guaranteed to be traversed before B. Read more
fn traverse_component(
&mut self,
comp: &mut Component,
signatures: &LibrarySignatures
) -> CalyxResult<()> where
Self: Sized,
fn traverse_component(
&mut self,
comp: &mut Component,
signatures: &LibrarySignatures
) -> CalyxResult<()> where
Self: Sized,
Define the traversal over a component. Calls Visitor::start, visits each control node, and finally calls Visitor::finish. Read more
fn do_pass(&mut self, context: &mut Context) -> CalyxResult<()> where
Self: Sized + ConstructVisitor,
fn do_pass(&mut self, context: &mut Context) -> CalyxResult<()> where
Self: Sized + ConstructVisitor,
Run the visitor on a given program ir::Context.
The function mutably borrows the control
program in each component and traverses it. Read more
fn do_pass_default(context: &mut Context) -> CalyxResult<Self> where
Self: ConstructVisitor + Sized,
fn do_pass_default(context: &mut Context) -> CalyxResult<Self> where
Self: ConstructVisitor + Sized,
Build a Default implementation of this pass and call Visitor::do_pass using it. Read more
Executed before the traversal begins.
Executed before visiting the children of a ir::Seq node.
Executed before visiting the children of a ir::Par node.
Executed before visiting the children of a ir::If node.
Executed after visiting the children of a ir::If node.
fn start_while(
&mut self,
_s: &mut While,
_comp: &mut Component,
_sigs: &LibrarySignatures
) -> VisResult
fn start_while(
&mut self,
_s: &mut While,
_comp: &mut Component,
_sigs: &LibrarySignatures
) -> VisResult
Executed before visiting the children of a ir::While node.
fn finish_while(
&mut self,
_s: &mut While,
_comp: &mut Component,
_sigs: &LibrarySignatures
) -> VisResult
fn finish_while(
&mut self,
_s: &mut While,
_comp: &mut Component,
_sigs: &LibrarySignatures
) -> VisResult
Executed after visiting the children of a ir::While node.
Executed at an ir::Enable node.
Executed at an ir::Invoke node.