Files
hakorune/docs/development/current/main
tomoaki f07c2e7874 feat(mir): Phase 279 P0 - Type propagation pipeline SSOT unification
Eliminate "2本のコンパイラ" problem by unifying type propagation into single SSOT entry.

SSOT implementation:
- src/mir/type_propagation/pipeline.rs - SSOT type propagation pipeline
- TypePropagationPipeline::run() - Single entry point for all routes

Pipeline steps (fixed order):
1. Copy propagation (initial)
2. BinOp re-propagation (numeric promotion: Int+Float→Float)
3. Copy propagation (propagate promoted types)
4. PHI type inference (private step - cannot bypass)

Callers (both routes now use SSOT):
- lifecycle.rs::finalize_module() - Builder lifecycle route
- joinir_function_converter.rs::propagate_types() - JoinIR bridge route

Fail-fast guard (structural guarantee):
- PHI type inference is private step inside TypePropagationPipeline
- lifecycle.rs and joinir_function_converter.rs cannot call PhiTypeResolver directly
- Only public API: TypePropagationPipeline::run()
- Order drift is structurally impossible (private encapsulation)

Code reduction:
- ~500 lines of duplicate BinOp re-propagation logic removed
- 2 implementations consolidated into 1 SSOT

Files changed:
- New: src/mir/type_propagation/mod.rs
- New: src/mir/type_propagation/pipeline.rs (~300 lines)
- Modified: src/mir/mod.rs
- Modified: src/mir/builder/lifecycle.rs (~400 lines removed)
- Modified: src/mir/join_ir_vm_bridge/joinir_function_converter.rs (~100 lines removed)

Regression testing:
 Lifecycle route (VM backend): Phase 275 fixture
 JoinIR route (VM backend): loop_min_while.hako
 LLVM harness: Phase 275 fixture

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-22 15:34:03 +09:00
..