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:
- A function calling another side-effectful function becomes side-effectful itself
- A call of a higher-order function could also be side-effectful, so we need to track this in the function type, not only the function definition. Or be conservative and assume that any indirect call can have any side-effects.
- There are different kinds of side effects: E.g. it's not required to specify the order between
result and rng_next since their side-effects don't interfer
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:
resultandrng_nextsince their side-effects don't interfer