-
Notifications
You must be signed in to change notification settings - Fork 199
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
Inline results from brillig function calls for which all arguments are known during SSA #6453
Comments
One thought on this (can also be done in a follow up). If we're partially solving a brillig function call then we need to consider whether we have other calls to the same function. We'll want to avoid blowing up the amounts of bytecode we have for unconstrained functions. |
Sorry, I couldn't understand this. |
Essentially, imagine we have a brillig function If we have 100 calls to |
We currently execution any brillig function calls for which all arguments are known during ACIR gen at compile-time in order to optimize the generated circuit by replacing the call with its intended results.
Performing this optimization during ACIR-gen however means that this occurs after most of our optimization passes have already run (and so they cannot benefit from the removal of these brillig calls). In SSA we retain the brillig calls which completely block any constant propagation from occurring.
An example of this is shown in the SSA below where the program should be able to be optimized down to an empty program in SSA but because we have some brillig calls we're unable to propagate these results forwards.
We can address this by
There will be a couple of gotchas related to failing assertions or oracle calls which will need to be handled with some care. As a first cut we can just abort this process if we hit these cases for now.
We started touching on this work with #5839
The text was updated successfully, but these errors were encountered: