-
Notifications
You must be signed in to change notification settings - Fork 200
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 refactor): Fix no returns & duplicate main #1243
Conversation
Co-authored-by: kevaundray <kevtheappdev@gmail.com>
…r-lang/noir into jf/ssa-first-class-functions
Its also showing the intrinsics PR as new, so it may be a bad merge |
@kevaundray Since this was based off the intrinsics PR it looked like it includes that change as well. I've just merged master again so it should be fixed now |
Nevermind, it was indeed a bad automatic merge. Not sure why there weren't merge conflicts there. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the Option<Function>
changes to the builder. I instead opted for popping from the function queue within the builder's constructor
* master: (223 commits) chore(noir): Release 0.5.0 (#1202) chore(ci): Utilize new workflow to build binaries (#1250) chore(ssa refactor): Fix loading from mutable parameters (#1248) fix(wasm): add std after dependencies (#1245) chore(ssa refactor): Fix no returns & duplicate main (#1243) chore(ssa refactor): Implement intrinsics (#1241) chore(ssa refactor): Implement first-class functions (#1238) chore: address clippy warnings (#1239) chore(ssa refactor): Implement function calls (#1235) chore(ssa refactor): Implement mutable and immutable variables (#1234) chore(ssa refactor): Fix recursive printing of blocks (#1230) feat(noir): added assert keyword (#1227) chore(ssa refactor): Implement ssa-gen for indexing, cast, constrain, if, unary (#1225) feat(noir): added `distinct` keyword (#1219) chore(nargo): update panic message to suggest searching for similar issues (#1224) chore(ssa refactor): Update how instruction result types are retrieved (#1222) chore(ssa refactor): Implement ssa-gen for binary, block, tuple, extract-tuple-field, and semi expressions (#1217) chore: add RUST_BACKTRACE environment variable to nix config (#1216) chore(ssa): Add intial control flow graph (#1200) chore(ssa refactor): Handle codegen for literals (#1209) ...
* master: (63 commits) feat(nargo): Remove usage of `CompiledProgram` in CLI code and use separate ABI/bytecode (#1269) feat: add integration tests for bitshift operators (#1272) chore: Replace explicit if-elses with `FieldElement::from<bool>()` for boolean fields (#1266) chore(noir): constrain expr; -> assert(expr); (#1276) chore: fix clippy warning (#1270) chore(ssa refactor): Add all remaining doc comments to ssa generation pass (#1256) chore(noir): Release 0.5.1 (#1264) fix: Add Poseidon examples into integration tests (#1257) chore(nargo): replace `aztec_backend` with `acvm-backend-barretenberg` (#1226) chore(noir): Release 0.5.0 (#1202) chore(ci): Utilize new workflow to build binaries (#1250) chore(ssa refactor): Fix loading from mutable parameters (#1248) fix(wasm): add std after dependencies (#1245) chore(ssa refactor): Fix no returns & duplicate main (#1243) chore(ssa refactor): Implement intrinsics (#1241) chore(ssa refactor): Implement first-class functions (#1238) chore: address clippy warnings (#1239) chore(ssa refactor): Implement function calls (#1235) chore(ssa refactor): Implement mutable and immutable variables (#1234) chore(ssa refactor): Fix recursive printing of blocks (#1230) ...
Related issue(s)
Resolves #
Description
Summary of changes
Some initial testing of the SSA-gen pass revealed it was mostly working as intended but had two obvious bugs so far:
main
function was duplicated twice.This PR fixes these. The first was a simple oversight, and the second was because we created our FunctionBuilder object initialized to build the main function, but in calling
SharedContext::get_or_queue_function
with main's id to retrieve its translated ID, main was also queued to compile again, leaving us with 2 main functions. I've adjusted the flow here a bit to initialize FunctionBuilder to no function initially. The downside of this is that nowcurrent_function
andcurrent_block
must be optional inside of it.Dependency additions / changes
Test additions / changes
Checklist
cargo fmt
with default settings.Documentation needs
Additional context