[llvm] [MachinePipeliner] Use `RegisterClassInfo::getRegPressureSetLimit` (PR #119827)

Ryotaro Kasuga via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 13 03:04:41 PST 2024


================
@@ -1326,48 +1326,7 @@ class HighRegisterPressureDetector {
   // Calculate the upper limit of each pressure set
   void computePressureSetLimit(const RegisterClassInfo &RCI) {
     for (unsigned PSet = 0; PSet < PSetNum; PSet++)
-      PressureSetLimit[PSet] = TRI->getRegPressureSetLimit(MF, PSet);
-
-    // We assume fixed registers, such as stack pointer, are already in use.
-    // Therefore subtracting the weight of the fixed registers from the limit of
-    // each pressure set in advance.
-    SmallDenseSet<Register, 8> FixedRegs;
----------------
kasuga-fj wrote:

>  These "fixed" registers are also "reserved" registers,

Previously (where `RegisterClassInfo::getRegPressureSetLimit` was used here), #83437 caused the `Limit >= Weight` assertion to fail. This patch marks the `$ffr` register as reserved. I just tried to comment out the code that marks `$ffr` as reserved and run MachinePipeliner, and found that `FixedRegs` contains `$ffr`. It looks to me like there are some gaps between "reserved" and "fixed". Or maybe I misunderstood something (I don't know much about the LLVM API for registers).

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


More information about the llvm-commits mailing list