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): fix array element propagation through constant folding and DIE #1674

Merged
merged 1 commit into from
Jun 13, 2023

Conversation

joss-aztec
Copy link
Contributor

Description

Problem*

Resolves GH-1618

Summary*

Ensure that array value elements are considered during constant folding and DIE passes.

Constant folding now directly replaces old instruction result values with their new counterparts (instead of attempting to map them). This requires that the subsequent DIE pass calls dfg.resolve to identify these substitutions correctly.

The DIE pass now considers the contents of array values when marking used instructions.

Due to the brittle natural of the dfg.resolve pattern, I've tested this change with an additional integration test. Once we've replaced dfg.resolve with another pattern such as aliasing, this test could be decomposed into per-pass unit tests.

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.

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.

LGTM

@jfecher jfecher enabled auto-merge June 13, 2023 17:39
@jfecher jfecher added this pull request to the merge queue Jun 13, 2023
Merged via the queue into master with commit 301e244 Jun 13, 2023
9 checks passed
@jfecher jfecher deleted the joss/fix-1618 branch June 13, 2023 18:58
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