683281363d
Optimizing Forth 2012 compiler targeting WebAssembly with IR-based compilation pipeline, multi-typed stack inference, subroutine threading, and JIT/consolidation modes. Rust kernel with ~35 primitives and Forth standard library for core/core-ext word sets.
20 lines
453 B
Rust
20 lines
453 B
Rust
//! Optimization passes for WAFER's IR.
|
|
//!
|
|
//! Each pass is a function `Vec<IrOp> -> Vec<IrOp>`, composable in sequence:
|
|
//! 1. Constant folding
|
|
//! 2. Strength reduction
|
|
//! 3. Peephole optimization
|
|
//! 4. Inlining
|
|
//! 5. Dead code elimination
|
|
//! 6. Stack-to-local promotion
|
|
|
|
// TODO: Step 11 - Optimization pass implementations
|
|
|
|
#[cfg(test)]
|
|
mod tests {
|
|
#[test]
|
|
fn placeholder() {
|
|
// Optimizer tests will be added in Step 11
|
|
}
|
|
}
|