Fixed infinite loop issue in VM by addressing phi node caching problem.
The phi node was caching the initial value and returning it for all
subsequent iterations, preventing loop variable updates.
Changes:
- Created vm_phi.rs module to separate loop execution logic (similar to mir/loop_builder.rs)
- Disabled phi node caching to ensure correct value selection each iteration
- Added LoopExecutor to track block transitions and handle phi nodes properly
- Fixed VM to correctly track previous_block for phi input selection
The VM now correctly executes SSA-form loops with proper variable updates:
- Loop counter increments correctly
- Phi nodes select the right input based on control flow
- Test case now completes successfully (i=1,2,3,4)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
Phase 5.2 of MIR 35→26 reduction project:
- VM backend: Reject all 17 deprecated instructions with proper error messages
- WASM backend: Reject deprecated instructions with migration guidance
- All deprecated instructions now properly handled in both backends
- Build successful with expected deprecation warnings
Deprecated instructions removed:
- UnaryOp → Use BinOp
- Load/Store → Use BoxFieldLoad/BoxFieldStore
- ArrayGet/ArraySet → Use BoxFieldLoad/BoxFieldStore or intrinsics
- Print/Debug → Use Call @print/@debug
- TypeCheck/Cast → Use Call @type_check/@cast
- Throw/Catch → Use Call @throw/@catch
- RefNew → References handled implicitly
- BarrierRead/BarrierWrite → Use AtomicFence
- FutureNew/FutureSet/Await → Use NewBox/BoxCall
- Copy/Nop → Not needed in final IR
Phase 4-3c-3 Complete: WASM host functions now correctly output string content
## Changes:
- Fixed MIR builder to handle StringBox with string literal arguments
- Special case for to generate proper string constants
- Removed debug output after successful verification
- WASM now correctly outputs "Hello MIR!" instead of "StringBox"
## Test Results:
- MIR generation: ✅ Generates correctly
- WASM compilation: ✅ String data correctly placed at offset 4096
- WASM execution: ✅ Outputs "Hello MIR\!" as expected
## Technical Details:
- Modified build_new_expression() to detect StringBox with literal arguments
- Generates Const instruction with actual string content
- Host function reads StringBox memory layout correctly
This completes the WASM string output functionality for Phase 4.
🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
- Remove old instructions from VM/WASM backends (UnaryOp, Print, Load/Store, RefGet/RefSet)
- Add comprehensive MIR optimizer with Effect System based optimizations
- Implement dead code elimination, CSE, pure instruction reordering
- Add intrinsic function support in VM backend
- Update backends to use new BoxFieldLoad/Store and Call intrinsics
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>