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): Const folding array handling #1640

Closed
wants to merge 2 commits into from

Conversation

joss-aztec
Copy link
Contributor

@joss-aztec joss-aztec commented Jun 12, 2023

Description

Problem*

Resolves GH-1618

Summary*

Arrays for which the underlying elements had changed were not being updated as part of the constant folding pass.

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.

/// and it isn't already in the cache, it will be recursively resolved and added to the cache.
/// This is necessary because processing instruction results alone is not sufficient for
/// catching all arrays that have been affected by the pass.
fn resolve_value(&mut self, function: &mut Function, value: ValueId) -> ValueId {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can this function can be removed if we use .set_value_from_id on any updated results?

It seems either way that this fix would need to apply to every pass that changes ValueIds.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, true

@joss-aztec
Copy link
Contributor Author

Closing in favour of #1674

@joss-aztec joss-aztec closed this Jun 13, 2023
@TomAFrench TomAFrench deleted the joss/const-fold-array-fix branch November 20, 2024 12:01
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.

Constant folding doesn't update result value references
2 participants