[llvm] [RegAlloc][RISCV] Increase the spill weight by target factor (PR #113675)
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 5 07:09:19 PST 2024
================
@@ -803,6 +803,11 @@ RISCVRegisterInfo::getRegisterCostTableIndex(const MachineFunction &MF) const {
: 0;
}
+unsigned
+RISCVRegisterInfo::getSpillWeightFactor(const TargetRegisterClass *RC) const {
+ return getRegClassWeight(RC).RegWeight;
----------------
arsenm wrote:
No, do not increase the target API surface out of fear of changing other targets. This is a large problem for llvm where everyone just adds some new single purpose knob that nothing else will ever implement. There must be attempts at universal infrastructure improvements. The targets may have different weights, but there is already the mechanism here to control it. Just use it instead of adding another undiscoverable, redundant override to implement
https://github.com/llvm/llvm-project/pull/113675
More information about the llvm-commits
mailing list