[llvm] [MISched] Small debug improvements (PR #125072)

David Green via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 31 06:55:11 PST 2025


================
@@ -1316,11 +1316,13 @@ void ScheduleDAGMILive::initRegPressure() {
       RegionCriticalPSets.push_back(PressureChange(i));
     }
   }
-  LLVM_DEBUG(dbgs() << "Excess PSets: ";
-             for (const PressureChange &RCPS
-                  : RegionCriticalPSets) dbgs()
-             << TRI->getRegPressureSetName(RCPS.getPSet()) << " ";
-             dbgs() << "\n");
+  if (RegionCriticalPSets.size() > 0)
+    LLVM_DEBUG({
----------------
davemgreen wrote:

For these ones with if's, it might be better to put the if into the LLVM_DEBUG. I'm not sure if it will warn in release mode, but it avoids the if in any case. The other alternative is to wrap the whole thing in #ifndef NDEBUG's
```
  LLVM_DEBUG({
    if (RegionCriticalPSets.size() > 0) {
      dbgs() << "Excess PSets: ";...
```

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


More information about the llvm-commits mailing list