refactor(llvm): Phase 132-P1 follow-up - bind block_end_values and clear predeclared PHIs
This commit is contained in:
@ -27,6 +27,16 @@
|
||||
- Investigation: [phase132-llvm-exit-phi-wrong-result.md](investigations/phase132-llvm-exit-phi-wrong-result.md)
|
||||
- Phase summary: [phases/phase-132/README.md](phases/phase-132/README.md)
|
||||
|
||||
## Phase 132-P1 Update (2025-12-15)
|
||||
|
||||
✅ **STRUCTURAL FIX**: Function-local state isolation in LLVM Python backend
|
||||
|
||||
- **Issue**: block id / value id が “関数をまたいで” 衝突し得る(snapshot / cache / PHI state の漏洩)
|
||||
- **Fix**: `FunctionLowerContext` Box で function-scoped state を隔離し、tuple-key workaround を不要化
|
||||
- **Code**:
|
||||
- `src/llvm_py/context/function_lower_context.py`
|
||||
- `src/llvm_py/builders/function_lower.py`
|
||||
|
||||
## Root Causes Identified
|
||||
|
||||
### 1. TAG-EMIT: Loop PHI → Invalid LLVM IR (Case B) ✅ FIXED (Phase 131-10)
|
||||
|
||||
Reference in New Issue
Block a user