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

Execute any Brillig opcodes which have constant inputs at compile time #2189

Closed
TomAFrench opened this issue Aug 4, 2023 · 3 comments · Fixed by #2190
Closed

Execute any Brillig opcodes which have constant inputs at compile time #2189

TomAFrench opened this issue Aug 4, 2023 · 3 comments · Fixed by #2190
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@TomAFrench
Copy link
Member

Problem

The brillig_integer_binary_operations integration test has zero arguments so should be able to be compiled down to an empty circuit. However, because of our usage of brillig opcodes we have 43 gates which need to be handled by the backend.

This is low-hanging fruit for compiler optimisation.

Happy Case

When performing ACIR gen on brillig opcodes we should check to see if all of the inputs are known constants. If so then we should execute the brillig opcode within the compiler and return constant AcirVars for the opcode outputs. This will allow us to use these values to perform later optimisations.

Alternatives Considered

No response

Additional Context

No response

Would you like to submit a PR for this Issue?

Yes

Support Needs

No response

@kevaundray
Copy link
Contributor

Changing to P-LOW since we have an issue open to optimize brillig functions which may supercede this

@TomAFrench
Copy link
Member Author

@sirasistant @kevaundray Do you think it's worth merging #2190 as a stop-gap measure while #2066 is being worked on?

@sirasistant
Copy link
Contributor

Looks like a good stop-gap to me yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants