[llvm-branch-commits] [llvm] [TRI] Remove reserved registers in getRegPressureSetLimit (PR #118787)

Pengcheng Wang via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Thu Jan 9 19:58:14 PST 2025


================
@@ -925,9 +925,16 @@ class TargetRegisterInfo : public MCRegisterInfo {
   virtual const char *getRegPressureSetName(unsigned Idx) const = 0;
 
   /// Get the register unit pressure limit for this dimension.
-  /// This limit must be adjusted dynamically for reserved registers.
+  /// TargetRegisterInfo adjusts this limit for reserved registers.
+  /// Avoid using this method directly as it is costly to compute. Use the
+  /// cached version `RegisterClassInfo::getRegPressureSetLimit` instead.
   virtual unsigned getRegPressureSetLimit(const MachineFunction &MF,
----------------
wangpc-pp wrote:

If moving to `MachineRegisterInfo`, then AMDGPU target will not be able to override it and that will cause regressions.

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


More information about the llvm-branch-commits mailing list