Phase 9.78h: Stabilize MIR26 pipeline
- Add lib test to sync Core Instruction names with docs (INSTRUCTION_SET.md) - Optimizer: Pass 0 normalizes legacy ops -> unified (TypeCheck/Cast->TypeOp, WeakNew/WeakLoad->WeakRef, BarrierRead/Write->Barrier) - Optimizer: diagnostics for legacy ops; forbid via NYASH_OPT_DIAG_FORBID_LEGACY=1 - Runner: treat diagnostics (unlowered/legacy) as fatal when enabled - Printer: unify legacy print style to TypeOp/WeakRef/Barrier - Verifier: treat Phi inputs correctly (skip merge/dominance violations for Phi) - Docs: update PHI_NORMALIZATION_PLAN; CURRENT_TASK: add risk note for op duplication - Misc: PHI debugging/logs kept stable; snapshots still green
This commit is contained in:
@ -73,8 +73,10 @@ impl MirCompiler {
|
||||
if self.optimize {
|
||||
let mut optimizer = MirOptimizer::new();
|
||||
let stats = optimizer.optimize_module(&mut module);
|
||||
if std::env::var("NYASH_OPT_DIAG_FAIL").is_ok() && stats.diagnostics_reported > 0 {
|
||||
return Err(format!("Diagnostic failure: {} unlowered type-op calls detected", stats.diagnostics_reported));
|
||||
if (std::env::var("NYASH_OPT_DIAG_FAIL").is_ok()
|
||||
|| std::env::var("NYASH_OPT_DIAG_FORBID_LEGACY").is_ok())
|
||||
&& stats.diagnostics_reported > 0 {
|
||||
return Err(format!("Diagnostic failure: {} issues detected (unlowered/legacy)", stats.diagnostics_reported));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user