[Mlir-commits] [mlir] [mlir][Transforms][NFC] Improve debug output of `-remove-dead-values` (PR #173468)

Matthias Springer llvmlistbot at llvm.org
Wed Dec 24 01:32:17 PST 2025


================
@@ -787,13 +788,19 @@ static void cleanUpDeadVals(RDVFinalCleanupList &list) {
     // blocks that are accessed via multiple codepaths processed once
     if (b.b->getNumArguments() != b.nonLiveArgs.size())
       continue;
-    LDBG() << "Erasing " << b.nonLiveArgs.count()
-           << " non-live arguments from block: " << b.b;
-    // it iterates backwards because erase invalidates all successor indexes
+    LDBG_OS([&](raw_ostream &os) {
+      os << "Erasing non-live arguments [";
+      llvm::interleaveComma(b.nonLiveArgs.set_bits(), os);
+      os << "] from block: " << b.b << " in region "
+         << b.b->getParent()->getRegionNumber() << " of operation "
+         << b.b->getParent()->getParentOp()->getName() << " ("
+         << b.b->getParent()->getParentOp() << ")";
----------------
matthias-springer wrote:

Actually, `printGenericOpForm(true)` fixes that.

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


More information about the Mlir-commits mailing list