feat(phi): Phase 26-F-2 - 箱理論による責務分離(IfBodyLocalMergeBox新設)

**箱理論による問題解決**:
-  問題: LoopVarClassBox(ループスコープ分析)とif-merge処理が混在
-  解決: if-merge専用箱を新設して責務分離

**新箱: IfBodyLocalMergeBox**:
- 責務: if-merge専用のbody-local φ候補決定
- ロジック:
  - 両腕に存在する変数を検出
  - pre_ifと比較して値が変わった変数のみ
  - empty elseは空リスト返す
- 特徴: LocalScopeInspector不要、LoopVarClassBox不使用

**変更ファイル**:
- src/mir/phi_core/if_body_local_merge.rs: 新規作成(IfBodyLocalMergeBox)
- src/mir/phi_core/phi_builder_box.rs: IfBodyLocalMergeBox使用に切り替え
- src/mir/phi_core/body_local_phi_builder.rs: filter_if_merge_candidates()削除
- src/mir/loop_builder.rs: BodyLocalPhiBuilder setup削除
- src/mir/phi_core/mod.rs: if_body_local_merge追加

**テスト結果**:
- Passed: 353→354 (+1) 
- Failed: 14→14 (退行なし)

**既知の問題**:
- domination error依然残存(%48 in bb48 from bb52)
- 次フェーズで調査・修正予定

技術詳細:
- ChatGPT箱理論分析による設計
- A案ベースのシンプル実装
- 責務明確化: ループスコープ分析 vs if-merge専用処理
This commit is contained in:
nyash-codex
2025-11-22 11:03:21 +09:00
parent cbe6bf0140
commit 948f22a03a
15 changed files with 634 additions and 353 deletions

View File

@ -32,6 +32,12 @@ pub mod exit_phi_builder;
// Phase 26-E: PHI SSOT Unification - PhiBuilderBox
pub mod phi_builder_box;
// Phase 26-F-2: If Body-Local Merge Box - if-merge専用φ候補決定箱
pub mod if_body_local_merge;
// Phase 26-F-3: PHI invariants guard boxFail-Fast共通化
pub mod phi_invariants;
// 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