You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have two types of functions, ACIR and Brillig (constrained vs unconstrained). Brillig functions are simply marked with the unconstrained function modifier.
In Noir code, we allow ACIR functions to be called in the unconstrained environment. The goal was to reduce code duplication and the need to have the user write two different Noir functions for both constrained and unconstrained if they wanted to compute the same thing in both runtimes.
Right now, we separate runtimes during an SSA pass called runtime_separation. This converts any remaining functions with the Brillig runtime. If an ACIR function was called from the Brillig runtime, this pass will clone the function and change its runtime to Brillig. The pass is restricted to only work after defunctionalization.
We should move to have runtime separation occur during monomorphization in the frontend before SSA generation. This would enable us then to code gen different SSA based upon the runtime of a function such as #6231. Logic from other issues such as #6831 could also just be included as part of SSA generation as we will already know the runtime of the function we are generating.
Happy Case
We should be able to safely access function runtimes during SSA generation.
Workaround
Yes
Workaround Description
The workaround is to keep doing what we are doing and work with separated runtimes only after the runtime_separation pass. I find this generally will lead to more complexity.
Additional Context
No response
Project Impact
Blocker
Blocker Context
This work is a blocker for PR #6231. We could probably hack around not having the runtime during SSA gen, but it would be ugly and introduce a lot of complexity.
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered:
Problem
We have two types of functions, ACIR and Brillig (constrained vs unconstrained). Brillig functions are simply marked with the
unconstrained
function modifier.In Noir code, we allow ACIR functions to be called in the unconstrained environment. The goal was to reduce code duplication and the need to have the user write two different Noir functions for both constrained and unconstrained if they wanted to compute the same thing in both runtimes.
Right now, we separate runtimes during an SSA pass called
runtime_separation
. This converts any remaining functions with the Brillig runtime. If an ACIR function was called from the Brillig runtime, this pass will clone the function and change its runtime to Brillig. The pass is restricted to only work after defunctionalization.We should move to have runtime separation occur during monomorphization in the frontend before SSA generation. This would enable us then to code gen different SSA based upon the runtime of a function such as #6231. Logic from other issues such as #6831 could also just be included as part of SSA generation as we will already know the runtime of the function we are generating.
Happy Case
We should be able to safely access function runtimes during SSA generation.
Workaround
Yes
Workaround Description
The workaround is to keep doing what we are doing and work with separated runtimes only after the
runtime_separation
pass. I find this generally will lead to more complexity.Additional Context
No response
Project Impact
Blocker
Blocker Context
This work is a blocker for PR #6231. We could probably hack around not having the runtime during SSA gen, but it would be ugly and introduce a lot of complexity.
Would you like to submit a PR for this Issue?
None
Support Needs
No response
The text was updated successfully, but these errors were encountered: