[llvm] [MachinePipeliner] Use `RegisterClassInfo::getRegPressureSetLimit` (PR #119827)
Ryotaro Kasuga via llvm-commits
llvm-commits at lists.llvm.org
Thu Dec 12 23:37:22 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:
As I commented in https://github.com/llvm/llvm-project/pull/118787#discussion_r1877336858, I dared to replace it from `RegisterClassInfo::getRegPressureSetLimit` before (in #87312). This is because there is a duplication between the reserved registers handled inside `RegisterClassInfo::getRegPressureSetLimit` and the `FixedRegs` calculated here, so the `Limit >= Weight` assertion fails. If I remember correctly, in my case (AArch64), the `$ffr` triggers it. What I'd like to do here is to ignore registers that have "specific rolls" (e.g., stack pointer) and those where `TargetRegisterInfo::isFixedRegister` returns true looks appropriate in this case to me. Maybe I'm misunderstanding reserved and fixed registers, and there may be a better way to achieve what I want, but I'm not sure this change will work well.
https://github.com/llvm/llvm-project/pull/119827
More information about the llvm-commits
mailing list