-
Notifications
You must be signed in to change notification settings - Fork 219
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: Separate unconstrained functions during monomorphization #6894
base: master
Are you sure you want to change the base?
Conversation
Changes to Brillig bytecode sizes
🧾 Summary (10% most significant diffs)
Full diff report 👇
|
Peak Memory Sample
|
Compilation Sample
|
Execution Sample
|
@@ -276,19 +271,12 @@ pub fn create_program( | |||
(generated_acirs, generated_brillig, brillig_function_names, error_types), | |||
ssa_level_warnings, | |||
) = optimize_into_acir(program, options)?; | |||
if options.force_brillig_output { |
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.
I do think this assert is correct and should remain.
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.
I'd rather remove the force_brillig option from SSA entirely since otherwise it'd only be used for this one assert
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.
We could remove the option but case on whether we have a single main function that is marked unconstrained
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.
As otherwise we are going to error out when asserting the number of acir artifacts against the number of function signatures.
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.
We can also just update how we collect function sigs
if f.inline_type.is_entry_point() || f.id == Program::main_id() { |
is_entry_point
is going to return true for functions marked with #[fold]
. However, if we are force compiling to Brillig we do not need to collect this signature. The func sigs are only used for constructing acir artifacts. This feels like the best solution here.
Description
Problem*
Resolves #6841
Summary*
Adds a boolean is_unconstrained as an extra key during monomorphization. This should separate constrained from unconstrained functions. This key is infectious so every function called from an unconstrained function will also be unconstrained.
Additional Context
Documentation*
Check one:
PR Checklist*
cargo fmt
on default settings.