feat(mir/llvm): Phase 273 P0-P1 DomainPlan→CorePlan + LLVM arg fix

Phase 273 P0-P1: Two-layer plan architecture
- DomainPlan: Pattern-specific knowledge (ScanWithInit)
- CorePlan: Fixed vocabulary (Seq, Loop, If, Effect, Exit)
- ValueId references only (String expressions forbidden)
- Pipeline: Extractor→Normalizer→Verifier→Lowerer

New plan/ module:
- mod.rs: Type definitions, SSOT spec
- normalizer.rs: DomainPlan→CorePlan + ID allocation
- verifier.rs: V1-V6 invariant checks (fail-fast)
- lowerer.rs: CorePlan→MIR (pattern-agnostic)

LLVM fix (ChatGPT):
- function_lower.py: Fix argument reference bug
- Phase 258 index_of_string now PASS on LLVM backend

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

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-22 22:42:56 +09:00
parent f07c2e7874
commit 960241795d
20 changed files with 1728 additions and 388 deletions

View File

@ -19,10 +19,8 @@ Related:
- 入口: `docs/development/current/main/phases/phase-278/README.md`
- 実装ガイド: `docs/development/current/main/phases/phase-278/P0-INSTRUCTIONS.md`
- **Phase 279planned, impl: Type propagation pipeline SSOT 統一lifecycle / JoinIR / LLVM の二重化解消)**
- 目的: 型伝播Copy/BinOp/PHI/Compare など)の “順序/入口” を 1 本に固定し、経路差による二重バグを根絶する
- 入口: `docs/development/current/main/phases/phase-279/README.md`
- 実装ガイド: `docs/development/current/main/phases/phase-279/P0-INSTRUCTIONS.md`
(✅ done**Phase 279 P0**: Type propagation pipeline SSOT 統一lifecycle / JoinIR / LLVM の二重化解消)
- 完了: `docs/development/current/main/phases/phase-279/README.md`
- **Phase 272✅ complete: Pattern6/7 を Frag+emit_frag へ吸収(段階適用)**
- 目的: scan系 loop の CFG 構築を `Frag/ExitKind` 合成へ寄せ、pattern列挙の増殖を止める
@ -30,12 +28,15 @@ Related:
- 入口: fixture/smoke を SSOT として固定Pattern6→Pattern7 の順で段階適用)
- 詳細: `phases/phase-272/README.md`
- **Phase 273planned, design-first: Pattern → Plan Extractorpure→ PlanLowerer で収束**
- **Phase 273active, design-first: Pattern → Plan Extractorpure→ PlanLowerer で収束**
- 目的: pattern の裾広がりを止め、`Plan → Frag → emit_frag()` の本線へ一本化するterminator SSOT は維持)
- 相談メモ: `docs/development/current/main/investigations/phase-272-frag-plan-architecture-consult.md`
- 状況:
- ✅ P0PoC完了: `docs/development/current/main/phases/phase-273/README.md`
- 次: P1DomainPlan→CorePlan + PlanNormalizerSSOT+ PlanVerifier
- 受け入れ(最小):
- extractor が builder を触らないID採番/PHI挿入禁止
- Plan 語彙を固定(`seq/if/loop/exit/effect/let`
- CorePlan 語彙を固定(`seq/if/loop/exit/effect` など。scan専用 Effect/variant 禁止、式を String にしない
- PlanLowerer が block/value/phi を作る唯一の箱になる