feat(phi): Phase 26-E-2 - PhiBuilderBox If PHI生成完全実装
Phase 26-E Phase 2 完了: PhiBuilderBox による If PHI生成SSOT統一化 **実装内容:** 1. PhiBuilderBox 作成 (444行) - If PHI生成: generate_if_phis() 完全実装 - Conservative戦略: void emission 含む完全対応 - 決定的順序: BTreeSet/BTreeMap で非決定性排除 2. PhiBuilderOps trait (7メソッド) - 最小PHI生成インターフェース - new_value, emit_phi, update_var, get_block_predecessors - emit_void, set_current_block, block_exists 3. loop_builder.rs 統合 - PhiBuilderOps trait 実装 (Ops構造体) - If PHI呼び出し箇所統合 (line 1136-1144) - Legacy if_phi::merge_modified_with_control 置換完了 **技術的成果:** - Conservative PHI生成: 全経路カバー + void fallback - 決定的変数順序: BTreeSet で変更変数をソート - 決定的PHI入力順序: pred_bb.0 でソート - テスタビリティ: MockOps でユニットテスト可能 **Phase 3 設計方針 (ChatGPT提案):** - trait 階層化: LoopFormOps: PhiBuilderOps - blanket impl: impl<T: LoopFormOps> PhiBuilderOps for T - PhiBuilderBox: PhiBuilderOps 最小セットのみに依存 - 段階的移行: 既存コード保護しながら統一化 **削減見込み:** - Phase 2: -80行 (If側重複削除) - Phase 4: -287行 (loop_phi.rs Legacy削除) - 合計: -367行 (純削減) **関連ファイル:** - src/mir/phi_core/phi_builder_box.rs (新規, 444行) - src/mir/phi_core/mod.rs (module登録) - src/mir/loop_builder.rs (PhiBuilderOps実装) - CURRENT_TASK.md (Phase 26-E記録) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -29,6 +29,9 @@ pub mod loop_snapshot_manager;
|
||||
// Phase 26-D: Exit PHI Management
|
||||
pub mod exit_phi_builder;
|
||||
|
||||
// Phase 26-E: PHI SSOT Unification - PhiBuilderBox
|
||||
pub mod phi_builder_box;
|
||||
|
||||
// Public surface for callers that want a stable path:
|
||||
// Phase 1: No re-exports to avoid touching private builder internals.
|
||||
// Callers should continue using existing paths. Future phases may expose
|
||||
|
||||
Reference in New Issue
Block a user