[llvm] 3ef7818 - [PowerPC] Use `RegisterClassInfo::getRegPressureSetLimit` (#120383)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jan 3 00:41:22 PST 2025
Author: Pengcheng Wang
Date: 2025-01-03T16:41:18+08:00
New Revision: 3ef78188d0d39cd00429f77f1b300be9bdf85770
URL: https://github.com/llvm/llvm-project/commit/3ef78188d0d39cd00429f77f1b300be9bdf85770
DIFF: https://github.com/llvm/llvm-project/commit/3ef78188d0d39cd00429f77f1b300be9bdf85770.diff
LOG: [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
Added:
Modified:
llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
index 44f6db5061e21a..fa45a7fb7fabe6 100644
--- a/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
+++ b/llvm/lib/Target/PowerPC/PPCInstrInfo.cpp
@@ -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] >
More information about the llvm-commits
mailing list