[llvm-branch-commits] [llvm] [RegAlloc] Add enableCSRFirstTimeMinCost to let RegAlloc has more choice (PR #239530)

Pengcheng Wang via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Nov 9 00:58:59 PST 2026


================
@@ -2791,8 +2963,12 @@ MCRegister RAGreedy::selectOrSplitImpl(const LiveInterval &VirtReg,
     if (CSRCost.getFrequency() &&
         EvictAdvisor->getUnusedCalleeSavedReg(VirtReg, PhysReg) &&
         NewVRegs.empty()) {
-      MCRegister CSRReg = tryAssignCSRFirstTime(VirtReg, Order, PhysReg,
-                                                CostPerUseLimit, NewVRegs);
+      MCRegister CSRReg =
+          TRI->enableCSRFirstTimeMinCost(*MF)
----------------
wangpc-pp wrote:

Can this be the default behavior?

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


More information about the llvm-branch-commits mailing list