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 bad constant type caching #1593

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

joss-aztec
Copy link
Contributor

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

Description

Problem*

Bad type information was used when creating a constant that matched a previously cached constant without considering its type

Summary*

Cache constants by both numeric value and type

Example

fn main(x: u2) -> pub u2 {
    0 - x
}

Before:

Initial SSA:
fn main f0 {
  b0(v0: u2):
    v2 = sub unit 0, v0
    return v2
}

After:

Initial SSA:
fn main f0 {
  b0(v0: u2):
    v2 = sub u2 0, v0
    return v2
}

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 June 7, 2023 16:06
@jfecher jfecher added this pull request to the merge queue Jun 7, 2023
Merged via the queue into master with commit 37c0be6 Jun 7, 2023
@jfecher jfecher deleted the joss/fix-constant-type branch June 7, 2023 20:21
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