feat(phase131): LLVM backend re-enable & PHI ordering bug discovery
Phase 131: JoinIR → LLVM individual fixes (minimal scope) ## Modifications ### 1. LLVM Backend Re-enable ✅ - Built with --features llvm to enable real LLVM execution - Verified Python/llvmlite environment (llvmlite 0.45.1) - Fixed llvmlite deprecated API: removed llvm.initialize() call - Successfully moved from Mock backend to real LLVM harness execution ### 2. PHI Instruction Ordering Bug Discovery ⚠️ - Discovered critical bug: PHI nodes placed AFTER terminator instructions - LLVM IR constraint: PHI must be at block start, before any non-PHI - Root cause: finalize_phis() in llvm_builder.py emits PHIs after block termination - Affects all 6 tests with control flow merges ### 3. ConsoleBox LLVM Integration ⚠️ - Confirmed ConsoleBox not registered in Rust VM environment - Deferred to Phase 132 (prerequisite issue) ## Results Modified files: - src/llvm_py/llvm_builder.py: Removed deprecated llvm.initialize() - docs/development/current/main/phase130_joinir_llvm_baseline.md: Added Phase 131 results - CURRENT_TASK.md: Added Phase 131 completion report Test results: - ✅ peek_expr_block.hako: LLVM execution success (Result: 1) - ❌ 6/7 tests: PHI ordering bug (requires Phase 132 refactoring) ## Success Criteria - ✅ LLVM backend minimal re-enable (1/7 test passing) - ⚠️ PHI ordering bug discovered and documented - ⚠️ ConsoleBox integration deferred to Phase 132 ## Phase 132 Handoff Priority 1: Fix PHI instruction ordering bug (finalize_phis() refactoring) Priority 2: Resolve ConsoleBox registration issue Priority 3: Enable remaining test cases for LLVM 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -89,8 +89,8 @@ class NyashLLVMBuilder:
|
||||
"""Main LLVM IR builder for Nyash MIR"""
|
||||
|
||||
def __init__(self):
|
||||
# Initialize LLVM
|
||||
llvm.initialize()
|
||||
# Initialize LLVM (llvm.initialize() is deprecated in newer llvmlite)
|
||||
# llvm.initialize() # Removed - now handled automatically
|
||||
llvm.initialize_native_target()
|
||||
llvm.initialize_native_asmprinter()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user