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): Expand PR #1535 to resolve ValueIds in all SSA passes #1642

Merged
merged 3 commits into from
Jun 12, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/noirc_evaluator/src/ssa_refactor/acir_gen/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,7 @@ impl Context {
/// involving such values are evaluated via a separate path and stored in
/// `ssa_value_to_array_address` instead.
fn convert_value(&mut self, value_id: ValueId, dfg: &DataFlowGraph) -> AcirValue {
let value_id = dfg.resolve(value_id);
let value = &dfg[value_id];
if let Some(acir_value) = self.ssa_values.get(&value_id) {
return acir_value.clone();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@ impl Context {
for instruction in instructions {
self.push_instruction(function, block, instruction);
}

let terminator =
function.dfg[block].unwrap_terminator().map_values(|value| self.get_value(value));
let terminator = function.dfg[block]
.unwrap_terminator()
.map_values(|value| self.get_value(function.dfg.resolve(value)));
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are there any other terminator mappings we need to update as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

There will be in DIE, once that PR's merged in these changes.


function.dfg.set_block_terminator(block, terminator);
self.block_queue.extend(function.dfg[block].successors());
Expand Down