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
Currently, we don't explicitly identify side-effect-free functions. This can make it difficult to identify all of the sources of side effects individually and is related to multiple bugs where side effects run in non-executed branches, for example #5462
The branch condition is a simple function applied to a dynamic/unknown input
There are side effects inside the branch
The side effects erroneously run when the condition is false
iffoo(x){// side effects in `bar`bar();}
Happy Case
Identify side-effects in functions when calculating the control-flow graph (CFG) during SSA.
Add side-effect metadata to the CFG during construction
Add a method to check whether a function has side effects from the completed CFG
Use this check to ensure predicates (i.e. EnableSideEffectsIf conditions) are handled properly
Evaluate whether this allows us to remove the no_predicates attribute
Problem
Currently, we don't explicitly identify side-effect-free functions. This can make it difficult to identify all of the sources of side effects individually and is related to multiple bugs where side effects run in non-executed branches, for example #5462
false
Happy Case
Identify side-effects in functions when calculating the control-flow graph (CFG) during SSA.
EnableSideEffectsIf
conditions) are handled properlyno_predicates
attributeSee @jfecher's comment for a partial list of side effects to handle.
Project Impact
Nice-to-have
Impact Context
no_predicates
properly is hard, because currently you need to check all dependent functions for side effects manually.no_predicates
is useful for performance.no_predicates
could change.Workaround
Yes
Workaround Description
For Noir users:
Manually ensure there are no
predicates
and use theno_predicates
attribute.For developing Noir:
[T]::pop_front()
panics when inside non-executedif
#5462)Additional Context
No response
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: