-
Notifications
You must be signed in to change notification settings - Fork 4
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
Should we track functions with side-effects? #778
Comments
See also CQCL/tket2#748 . Having a linear "state" type passed through these calls seems like a good solution. (We would need several such types, one per type of state). |
But should we expose this to the user? Having to pass the state around seems very cumbersome for things like |
Agree it would be nice to avoid exposing to the user if we can. |
Some thoughts on how to do this:
|
MLIR has something similar with their "categorization" of side-effect types, but they use numeric "stages" to order execution inside a single basic block. Mind that we may want separate shared vs unique side-effect producers. |
Interesting note from that MLIR page:
|
We need to ensure the ordering of side-effectful functions like
result
,panic
,rng_seed
,rng_next
, etc.Since there are no dataflow dependencies between those functions, we have to emit extra order-edges between them within a basic block. This requires tracking of these effects by the compiler and is not trivial:
result
andrng_next
since their side-effects don't interferThe text was updated successfully, but these errors were encountered: