[MachineSink] Use RegisterClassInfo::getRegPressureSetLimit (#119830)

`RegisterClassInfo::getRegPressureSetLimit` is a wrapper of
`TargetRegisterInfo::getRegPressureSetLimit` with some logics to
adjust the limit by removing reserved registers.

It seems that we shouldn't use
`TargetRegisterInfo::getRegPressureSetLimit`
directly, just like the comment "This limit must be adjusted
dynamically for reserved registers" said.

Separate from https://github.com/llvm/llvm-project/pull/118787
This commit is contained in:
Pengcheng Wang 2024-12-18 14:51:01 +08:00 committed by GitHub
parent 99c2e3b782
commit b6ad231666
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1098,7 +1098,7 @@ bool MachineSinking::registerPressureSetExceedsLimit(
std::vector<unsigned> BBRegisterPressure = getBBRegisterPressure(MBB);
for (; *PS != -1; PS++)
if (Weight + BBRegisterPressure[*PS] >=
TRI->getRegPressureSetLimit(*MBB.getParent(), *PS))
RegClassInfo.getRegPressureSetLimit(*PS))
return true;
return false;
}