feat: liveness 驱动的精确二轮 dce_precise + is_top_level 标志(D-17/D-19/D-20)

This commit is contained in:
2026-08-06 16:55:26 +08:00
parent fd267816f4
commit 9d619cd9bb
7 changed files with 372 additions and 1 deletions
+2 -1
View File
@@ -79,7 +79,8 @@ pub(super) fn pass_b_dead_code(f: &IRFunction, keep: &mut [bool]) {
/// 递归收集 nested 树中全部变量槽引用(LOAD_VAR.a 读槽、STORE_VAR.rd 写槽)。
/// 槽号 = 寄存器号编码的变量槽;其余操作数(局部寄存器/Imm/This)不构成跨函数引用。
fn collect_escaped_slots(nested: &[IRFunction], out: &mut Vec<bool>) {
/// precise_sweep 复用(B012 约束同一来源)。
pub(crate) fn collect_escaped_slots(nested: &[IRFunction], out: &mut Vec<bool>) {
for sub in nested {
for inst in &sub.insts {
let slot = match inst.op {