Add an AIR pass for Algebraic expressions optimization
- Lenguaje dominante
- Rust
- Estrellas
- 96
- Forks
- 39
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
The current optimization passes (common subexpression elimination, constant propagation / folding, match arms combination..) do not yet reduce algebraic expressions effectively.
For instance, `b - a - 1 + a` would not be reduced into `b - 1`.
We should check what expressions we would like to optimize, and introduce a pass to do it.
One approach is described in https://github.com/0xMiden/air-script/pull/419#discussion_r2268817994
Note: See also https://github.com/0xMiden/air-script/issues/354 for more optimizations.
Guía de contribución
Línea de trabajo
The issue references existing optimization passes and a linked PR comment for an approach. Start by examining the AIR pass infrastructure in the codebase, likely in a directory like `src/opt/` or `src/passes/`. Review the linked PR #419 discussion for implementation details. Understand the algebraic expression representation and how to pattern-match transformations like simplifying `b - a - 1 + a` to `b - 1`. Write tests to verify the optimization works correctly within the AIR constraint system.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- rust
- Área
- compilers
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Estancado
- Claridad
- Bastante claro
- Aptitud para principiantes
- 35/100