[PowerPC] Use RegisterClassInfo::getRegPressureSetLimit (#120383)

`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
2025-01-03 16:41:18 +08:00
committed by GitHub
parent 82fecab85a
commit 3ef78188d0

View File

@@ -643,8 +643,8 @@ bool PPCInstrInfo::shouldReduceRegisterPressure(
};
// For now we only care about float and double type fma.
unsigned VSSRCLimit = TRI->getRegPressureSetLimit(
*MBB->getParent(), PPC::RegisterPressureSets::VSSRC);
unsigned VSSRCLimit =
RegClassInfo->getRegPressureSetLimit(PPC::RegisterPressureSets::VSSRC);
// Only reduce register pressure when pressure is high.
return GetMBBPressure(MBB)[PPC::RegisterPressureSets::VSSRC] >