Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ssa refactor): Implement dominator tree #1278

Merged
merged 12 commits into from
May 3, 2023
2 changes: 2 additions & 0 deletions crates/noirc_evaluator/src/ssa_refactor/ir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@ pub(crate) mod basic_block;
pub(crate) mod cfg;
pub(crate) mod constant;
pub(crate) mod dfg;
pub(crate) mod dom;
pub(crate) mod function;
pub(crate) mod instruction;
pub(crate) mod map;
pub(crate) mod post_order;
pub(crate) mod printer;
pub(crate) mod types;
pub(crate) mod value;
4 changes: 3 additions & 1 deletion crates/noirc_evaluator/src/ssa_refactor/ir/basic_block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ impl BasicBlock {
/// Iterate over all the successors of the currently block, as determined by
/// the blocks jumped to in the terminator instruction. If there is no terminator
/// instruction yet, this will iterate 0 times.
pub(crate) fn successors(&self) -> impl ExactSizeIterator<Item = BasicBlockId> {
pub(crate) fn successors(
&self,
) -> impl ExactSizeIterator<Item = BasicBlockId> + DoubleEndedIterator {
match &self.terminator {
Some(TerminatorInstruction::Jmp { destination, .. }) => vec![*destination].into_iter(),
Some(TerminatorInstruction::JmpIf { then_destination, else_destination, .. }) => {
Expand Down
Loading