[llvm-branch-commits] [llvm] [AMDGPU] Fix inconsistencies in RP tracking `advance`/`reset` behavior (PR #196099)

Diana Picus via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri May 8 06:07:10 PDT 2026


================
@@ -1029,8 +1029,13 @@ GCNScheduleDAGMILive::getRealRegPressure(unsigned RegionIdx) const {
   if (Regions[RegionIdx].first == Regions[RegionIdx].second)
     return llvm::getRegPressure(MRI, LiveIns[RegionIdx]);
   GCNDownwardRPTracker RPTracker(*LIS);
-  RPTracker.advance(Regions[RegionIdx].first, Regions[RegionIdx].second,
-                    &LiveIns[RegionIdx]);
+  if (!RPTracker.advance(Regions[RegionIdx].first, Regions[RegionIdx].second,
+                         &LiveIns[RegionIdx])) {
+    // Advance can produce false on a non-empty region if all MIs in the region
+    // are debug values; in such cases the maintained max pressure is invalid
+    // and the only source of pressure are the region's live-ins.
----------------
rovka wrote:

Could we maybe teach it to return the correct pressure instead? Or would that be too complicated?

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


More information about the llvm-branch-commits mailing list