[Mlir-commits] [mlir] [MLIR] Add logging to eraseUnreachableBlocks (NFC) (PR #153968)
Jacques Pienaar
llvmlistbot at llvm.org
Mon Aug 18 06:55:19 PDT 2025
================
@@ -209,13 +227,17 @@ LogicalResult mlir::eraseUnreachableBlocks(RewriterBase &rewriter,
for (Block *block : depth_first_ext(®ion->front(), reachable))
(void)block /* Mark all reachable blocks */;
+ LDBG(2) << "Found " << reachable.size() << " reachable blocks out of "
+ << region->getBlocks().size() << " total blocks";
+
// Collect all of the dead blocks and push the live regions onto the
// worklist.
for (Block &block : llvm::make_early_inc_range(*region)) {
if (!reachable.count(&block)) {
+ LDBG() << "Erasing unreachable block: " << █
block.dropAllDefinedValueUses();
rewriter.eraseBlock(&block);
- erasedDeadBlocks = true;
+ erasedDeadBlocks++;
----------------
jpienaar wrote:
Pre-inc?
https://github.com/llvm/llvm-project/pull/153968
More information about the Mlir-commits
mailing list