refactor: 清除 color() 冗余干涉图构建 + use_points 改用精确 use 判定

- color() 入口移除无用的 graph::build(run 内重建),删掉 _graph 参数
- graph.rs reg_count 改名 inst_count(实为指令数)
- use_points 由 live_before 活集改为 inst.use_regs() 精确 use 点,消除冗余 UNSPILL,spill 压力测试 38s→6s
This commit is contained in:
2026-08-06 20:41:01 +08:00
parent d65fa03de6
commit e36a69976e
3 changed files with 13 additions and 10 deletions
+1 -2
View File
@@ -24,8 +24,7 @@ pub fn color(f: &IRFunction, live: &LiveInfo) -> Result<AllocMap, String> {
if f.insts.is_empty() {
return Ok(AllocMap::new());
}
let graph = graph::build(f, live, &std::collections::BTreeSet::new(), &[]);
color::run(f, live, &graph)
color::run(f, live)
}
/// 寄存器分配改写:`&mut IRFunction + &LiveInfo → Result<(), String>`(D-16)。