feat(joinir): Phase 33-9.1 Loop/If lowering responsibility separation
Implement clear separation between Loop and If lowering responsibilities: **Guard Implementation:** - Add is_loop_lowered_function() to identify 6 Loop-dedicated functions - Exclude Loop functions from If lowering path in try_lower_if_to_joinir() - Enforce "1 function → 1 lowering" principle **Documentation:** - Add responsibility comments to loop_to_join.rs - Add responsibility comments to if_select.rs and if_merge.rs - Update if_joinir_design.md with Phase 33-9.1 section **Testing:** - Add unit test test_is_loop_lowered_function() (PASS) - Verify no regression in existing JoinIR tests **Loop-dedicated functions (6):** - Main.skip/1 - FuncScannerBox.trim/1 - FuncScannerBox.append_defs/2 - Stage1UsingResolverBox.resolve_for_source/5 - StageBBodyExtractorBox.build_body_src/2 - StageBFuncScannerBox.scan_all_boxes/1 This prevents future conflicts when both Loop and If lowering expand. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@ -1,6 +1,14 @@
|
||||
//! Phase 33: If/Else の Select 命令への lowering
|
||||
//!
|
||||
//! 最小の if/else(副作用なし、単純な値選択)を JoinInst::Select に変換する。
|
||||
//!
|
||||
//! ## 責務分離(Phase 33-9.1)
|
||||
//!
|
||||
//! **IfSelectLowerer の責務**:
|
||||
//! - 単純 if/else(副作用なし、単一変数)を Select 命令に変換する
|
||||
//!
|
||||
//! **非責務**:
|
||||
//! - Loop の PHI には触らない(Loop lowering の責務)
|
||||
|
||||
use crate::mir::join_ir::JoinInst;
|
||||
use crate::mir::{BasicBlockId, MirFunction, MirInstruction, ValueId};
|
||||
|
||||
Reference in New Issue
Block a user