[llvm-branch-commits] [llvm] [MachinePipeliner] Let targets reuse the reg-pressure detector (PR #212538)

via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Aug 18 12:46:35 PDT 2026


================
@@ -280,6 +280,15 @@ class LLVM_ABI TargetSubtargetInfo : public MCSubtargetInfo {
   /// Override generic software pipelining policy.
   virtual void overridePipelinerPolicy(MachinePipelinerPolicy &Policy) const {}
 
+  /// Given the per-pressure-set maxima \p MaxSetPressure of a candidate
+  /// pipeliner schedule for \p MF, return whether it uses too many registers,
+  /// or nullopt to defer to the pipeliner's generic per-set limit check. A
+  /// non-nullopt verdict takes precedence over that check (and its margin).
+  virtual std::optional<bool> isPipelinerScheduleRegPressureTooHigh(
----------------
hjagasiaAMD wrote:

After testing the generic detector with the underflow fix in #216372, I’ve removed the target-specific pressure-verdict hook. This PR now only adds the policy needed for targets to enable the generic detector, and the AMDGPU follow-up opts into it.

The combined VGPR/AGPR accounting concern may still be relevant, but I propose revisiting it separately if testing for enabling the AMDGPU pipeliner by default shows that the generic per-pressure-set limits are insufficient.

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


More information about the llvm-branch-commits mailing list