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

fix(ssa refactor): safe to query cfg for single block programs #1401

Merged
merged 2 commits into from
May 25, 2023

Conversation

joss-aztec
Copy link
Contributor

Description

Problem*

Loop unrolling was crashing on single block programs due the cfg not holding a node for the entry block (which had no edges)

Message:  ICE: Attempted to iterate predecessors of block not found within cfg.
Location: crates/noirc_evaluator/src/ssa_refactor/ir/cfg.rs:102
...
  18: noirc_evaluator::ssa_refactor::ir::cfg::ControlFlowGraph::predecessors::h40675d9252c86030
      at /Users/aztec/Documents/GitHub/noir-lang/noir/crates/noirc_evaluator/src/ssa_refactor/ir/cfg.rs:100
  19: noirc_evaluator::ssa_refactor::opt::unrolling::find_all_loops::h750f7171170cccd7

Summary*

Init the cfg with an empty node for the entry block

Documentation

  • This PR requires documentation updates when merged.

    • I will submit a noir-lang/docs PR.
    • I will request for and support Dev Rel's help in documenting this PR.

Additional Context

PR Checklist*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.

@joss-aztec joss-aztec requested a review from jfecher May 25, 2023 11:39
Copy link
Contributor

@jfecher jfecher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@jfecher jfecher added this pull request to the merge queue May 25, 2023
Merged via the queue into master with commit e2a23b3 May 25, 2023
@jfecher jfecher deleted the joss/fix-empty-cfg branch May 25, 2023 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants