[llvm] [RegAlloc][RISCV] Increase the spill weight by target factor (PR #113675)

Pengcheng Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 5 05:04:10 PST 2024


================
@@ -803,6 +803,11 @@ RISCVRegisterInfo::getRegisterCostTableIndex(const MachineFunction &MF) const {
              : 0;
 }
 
+unsigned
+RISCVRegisterInfo::getSpillWeightFactor(const TargetRegisterClass *RC) const {
+  return getRegClassWeight(RC).RegWeight;
----------------
wangpc-pp wrote:

The change will be huge if this is applied to all targets, and targets may have different factors. So I think we can keep the hook and let the targe make the decision.

https://github.com/llvm/llvm-project/pull/113675


More information about the llvm-commits mailing list