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

chore(ssa): rename codegen to ssa_gen + reorg of Value struct #797

Merged
merged 10 commits into from
Feb 11, 2023

Conversation

kevaundray
Copy link
Contributor

Related issue(s)

Description

This PR does the following things:

  • Move Value into its own file. This is an important struct as its the base descriptor for items in SSA.

  • In Value we were using a match statement with an _. This was expanded out. (I plan to document the behavior here)

  • Rename codegen to ssa_gen (To further disambiguate between acir_gen and ssa_gen) []

  • Rename methods which start with codegen to now be ssa_gen

Summary of changes

Dependency additions / changes

Test additions / changes

Checklist

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt with default settings.
  • I have linked this PR to the issue(s) that it resolves.
  • I have reviewed the changes on GitHub, line by line.
  • I have ensured all changes are covered in the description.
  • This PR requires documentation updates when merged.

Additional context

Copy link
Contributor

@guipublic guipublic left a comment

Choose a reason for hiding this comment

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

You have moved a bunch of functions from functions.rs to ssa_gen.rs, but they were related to function.rs so they should stay inside this file

@kevaundray
Copy link
Contributor Author

You have moved a bunch of functions from functions.rs to ssa_gen.rs, but they were related to function.rs so they should stay inside this file

I'm not a fan of having impls for a struct live in multiple files, unless there is a compelling reason. We could make those methods relating to a function take an IRGenerator parameter instead?

@guipublic
Copy link
Contributor

It was as you suggested before, but this was changed following a PR review from @jfecher.
I prefer the current formulation but I don't have a strong preference so I don't mind if we change this. However I do mind if we go back and forth depending on the reviewer.

@kevaundray
Copy link
Contributor Author

It was as you suggested before, but this was changed following a PR review from @jfecher.
I prefer the current formulation but I don't have a strong preference so I don't mind if we change this. However I do mind if we go back and forth depending on the reviewer.

This is a part of a bigger refactor, so we won't be going back and forth. I'll speak with Jake regarding his motivations and how it fits into the bigger picture

crates/noirc_evaluator/src/ssa/value.rs Outdated Show resolved Hide resolved
crates/noirc_evaluator/src/ssa/ssa_gen.rs Outdated Show resolved Hide resolved
@kevaundray kevaundray dismissed guipublic’s stale review February 11, 2023 16:48

functions have been moved back, so this PR can be merged

@kevaundray kevaundray added this pull request to the merge queue Feb 11, 2023
Merged via the queue into master with commit 1f2d2b7 Feb 11, 2023
@kevaundray kevaundray deleted the kw/ssa-ref-value branch February 11, 2023 17:23
TomAFrench added a commit that referenced this pull request Feb 14, 2023
* master: (28 commits)
  chore(ci): Add release token to enable runs against release PR (#840)
  feat(ssa): array sort (#754)
  chore: update readme (#811)
  chore: fix clippy (#825)
  chore: remove stale comment on HirFunction.unchecked_from_expr (#827)
  chore: Getter naming refactor (#803)
  chore: updated "HirFunction::unsafe_from_expr" to "HirFunction::unchecked_from_expr" (#823)
  chore: Forbid unsafe code (#824)
  chore: Follow rust naming convention (#801)
  feat(ci): Add concurrency group for rust workflow (#806)
  chore(ssa): rename impl method to follow Rust guideline (#782)
  fix(nargo): `nargo test` now only runs test functions defined in the current module (#805)
  chore(nargo): Remove outdated error message when Prover/Verifier.toml is missing (#807)
  chore(ssa): rename codegen to ssa_gen + reorg of `Value` struct (#797)
  chore(nargo): abstract paths from nargo's working directory (#761)
  chore(ci): Rename workflows (#804)
  feat: Impls with generics (#798)
  chore(ssa): Add doc comments on `Opcode` struct (#778)
  fix: operators issuing type errors when used with matching integer types arising from generic code (#789)
  chore(nargo)!: bump MSRV to 1.66.0 (#799)
  ...
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.

3 participants