Phase 33-4: Stage-1/Stage-B expansion complete (33-4.1 to 33-4.3)
## Code Changes - Extended function name whitelist in try_lower_if_to_joinir() - Added: JsonShapeParser._read_value_from_pair/1 (Stage-1) - Added: Stage1JsonScannerBox.value_start_after_key_pos/2 (Stage-B) ## Validation - A/B testing: Route A (if_phi) vs Route B (Select) → identical results (RC 0) - Test cases: joinir_if_select_simple.hako, joinir_if_select_local.hako - Build: cargo build --release successful ## Documentation (docs/private submodule) - TASKS.md: Phase 33-4.1 to 33-4.3 marked complete - if_joinir_design.md: Section 9 added (candidate analysis) ## Next Steps - Phase 33-4.4: CI/smoke test updates (pending)
This commit is contained in:
Submodule docs/private updated: 81ec67f775...ccb716eb04
@ -49,7 +49,10 @@ use crate::mir::{BasicBlockId, MirFunction};
|
||||
/// Phase 33-3: Try to lower if/else to JoinIR Select instruction
|
||||
///
|
||||
/// Scope:
|
||||
/// - Only applies to functions matching "IfSelectTest.*"
|
||||
/// - Only applies to whitelisted functions:
|
||||
/// - IfSelectTest.* (Phase 33-2/33-3)
|
||||
/// - JsonShapeParser._read_value_from_pair/1 (Phase 33-4 Stage-1)
|
||||
/// - Stage1JsonScannerBox.value_start_after_key_pos/2 (Phase 33-4 Stage-B)
|
||||
/// - Requires NYASH_JOINIR_IF_SELECT=1 environment variable
|
||||
/// - Falls back to traditional if_phi on pattern mismatch
|
||||
///
|
||||
@ -64,11 +67,15 @@ pub fn try_lower_if_to_joinir(
|
||||
return None;
|
||||
}
|
||||
|
||||
// 関数名で制限(IfSelectTest.* のみ)
|
||||
if !func.signature.name.starts_with("IfSelectTest.") {
|
||||
// Phase 33-4: 関数名ガード拡張(IfSelectTest + Stage-1/Stage-B 候補)
|
||||
let is_allowed = func.signature.name.starts_with("IfSelectTest.")
|
||||
|| func.signature.name == "JsonShapeParser._read_value_from_pair/1"
|
||||
|| func.signature.name == "Stage1JsonScannerBox.value_start_after_key_pos/2";
|
||||
|
||||
if !is_allowed {
|
||||
if debug {
|
||||
eprintln!(
|
||||
"[try_lower_if_to_joinir] skipping non-test function: {}",
|
||||
"[try_lower_if_to_joinir] skipping non-allowed function: {}",
|
||||
func.signature.name
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user