- Split expr lowering into ; route calls from stmt lowering
- Implement ternary/peek lowering (MIR13 PHI-off=Copy, PHI-on=Phi)
- Extend JSON v0 AST (ExprV0::{Ternary,Peek}, PeekArmV0)
- Selfhost parser_box: emit Peek JSON; add Stage-2 'Peek basic' smoke
- Reduce warnings: remove unused imports/vars in several modules
- current_task: update plan for legacy VM/Interpreter offboarding
23 lines
732 B
Rust
23 lines
732 B
Rust
use crate::mir::optimizer::MirOptimizer;
|
|
use crate::mir::optimizer_stats::OptimizationStats;
|
|
use crate::mir::MirModule;
|
|
|
|
/// Reorder pure instructions for better locality (scaffolding)
|
|
pub fn reorder_pure_instructions(
|
|
opt: &mut MirOptimizer,
|
|
module: &mut MirModule,
|
|
) -> OptimizationStats {
|
|
let stats = OptimizationStats::new();
|
|
for (func_name, _function) in &mut module.functions {
|
|
if opt.debug_enabled() {
|
|
println!(
|
|
" 🔀 Pure instruction reordering in function: {}",
|
|
func_name
|
|
);
|
|
}
|
|
// Placeholder: keep behavior identical (no reordering yet)
|
|
// When implemented, set stats.reorderings += N per function.
|
|
}
|
|
stats
|
|
}
|