fix(joinir): stabilize Phase 256 merge (jump_args, DCE, func names)

This commit is contained in:
2025-12-20 11:01:48 +09:00
parent 2c4268b691
commit 1028bd419c
11 changed files with 499 additions and 50 deletions

View File

@ -8,12 +8,13 @@ Related:
## Current Status (SSOT)
- Current first FAIL: `StringUtils.split/2``jump_args length mismatch``Carrier 'i' has no latch incoming set`
- Current first FAIL: `StringUtils.split/2`MIR verification: “Value defined multiple times” + SSA undef
- Pattern6 は PASS 維持
- 直近の完了:
- P1.10: DCE が `jump_args` 参照を保持し、`instruction_spans` と同期するよう修正(回帰テスト追加)
- P1.7: SSA undef`%49/%67`根治continuation 関数名の SSOT 不一致)
- P1.6: pipeline contract checks を `run_all_pipeline_checks()` に集約
- 次の作業: P1.8Pattern7 の carrier PHI wiring / ExitLine + jump_args 契約の修正
- 次の作業: P1.11merge 側の ExitLine/PHI/dominance を `--verify` で緑に戻す
---
@ -384,6 +385,35 @@ Option APattern 7 新設)を推奨。
結果:
- `./target/release/hakorune --backend vm --verify apps/tests/phase256_p0_split_min.hako` で SSA undef は消滅
---
## 進捗P1.8
### P1.8: ExitLine/jump_args と関数名マッピング整流(完了)
変更(要旨):
- ExitArgsCollector 側で「余剰 jump_argsinvariants」を許容し、`expected 3 or 4 but got 5` を解消
- JoinIR→MIR bridge 側で “join_func_N” 由来の名前と “JoinFunction.name” の不一致を解消するため、関数名マッピングを導入/伝播
結果:
- 旧 first FAILjump_args length mismatchは解消
### P1.9: Jump を tail call として表現(完了)
変更(要旨):
- JoinIR→MIR bridge で `JoinInst::Jump` を “continuation への tail call” として落とす
- `BasicBlock.jump_args` を tail call と同様に SSOT として保持ExitLine/collector の復元入力)
結果:
- `JoinInst::Jump` が “ret args[0]” 相当になり continuation が失われる問題は解消
### P1.10: DCE の jump_args + spans 同期(完了)
変更(要旨):
- DCE が `jump_args` で使われる値を used として扱い、純命令の除去で Copy が消えないようにする
- `instruction_spans``instructions` の同期不変条件を維持SPAN MISMATCH 根治)
- 回帰テストを追加(`test_dce_keeps_jump_args_values`, `test_dce_syncs_instruction_spans`
### リファクタリング方針P1.6候補 / 先送り推奨)
現時点split がまだ FAILでは、箱化のための箱化で複雑さが増えやすいので、以下を推奨する: