mirror of
https://github.com/pjh456/OxideJS.git
synced 2026-10-25 03:01:12 +08:00
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:
@@ -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)。
|
||||
|
||||
Reference in New Issue
Block a user