fix(backend): unify coalesce skip condition at both sites

Inner spill loop clear now checks vregs>120 (matching outer site),
ensuring coalescing is consistently skipped for large functions.
hxz
黄熙哲 5 days ago
parent 2031d8f8f9
commit 2632202833

@ -1380,8 +1380,6 @@ namespace mir
}
// 大函数丢弃 move 偏好以保持分配稳定性
// 条件1: move偏好数量 >100 直接跳过
// 条件2: vreg数 * move偏好数 > 600 (conv2d: 71*15=1065)
int mv = static_cast<int>(move_preferences.size());
if (mv > 100 || static_cast<int>(function.GetNumVRegs()) * mv > 600)
move_preferences.clear();
@ -1704,7 +1702,8 @@ namespace mir
}
int mv = static_cast<int>(move_preferences.size());
if (mv > 100 || static_cast<int>(function.GetNumVRegs()) * mv > 600)
if (function.GetNumVRegs() > 120 || mv > 100 ||
static_cast<int>(function.GetNumVRegs()) * mv > 600)
move_preferences.clear();
std::vector<int> gp_alloc(GP_ALLOCATABLE, GP_ALLOCATABLE + GP_NUM_ALLOCATABLE);

Loading…
Cancel
Save