Consider moving MIR's constant propagation to the AIR
- Dominant language
- Rust
- Stars
- 96
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
In https://github.com/0xMiden/air-script/pull/439, we've added a Constant Propagation / Folding pass at the end of the MIR. If it were in the AIR instead, it may be easier to implement (less node types and simpler graph structure).
We should check if it is possible to move it, and do so if it is.
A potential reason to keep it where it is is to ensure that computed indices (https://github.com/0xMiden/air-script/pull/444) are folded before the end of MIR. This ensures that we do not have to handle vectors in the AIR (or during lowering of MIR to AIR). But we could also implement index folding separately and move the full constant folding pass.
_Originally posted by @bobbinth in https://github.com/0xMiden/air-script/pull/439#pullrequestreview-3134694529_
Contributor guide
Assessment
This issue has not been assessed yet.