[Mlir-commits] [mlir] [mlir] Optimize `isOpTriviallyDead` greedy rewriter checks for deeply nested IR (PR #231423)
Ivan Butygin
llvmlistbot at llvm.org
Tue Oct 20 02:54:09 PDT 2026
================
@@ -200,7 +200,11 @@ LogicalResult PatternApplicator::matchAndRewrite(
#ifndef NDEBUG
// Operation `op` may be invalidated after applying the rewrite
// pattern.
- Operation *dumpRootOp = getDumpRootOp(op);
+ Operation *dumpRootOp = nullptr;
+ // LLVM_DEBUG enables level 1, but IR dumps require level 2. Avoid
+ // walking ancestors to find the dump root when no IR will be printed.
+ LLVM_DEBUG(if (llvm::isCurrentDebugType(DEBUG_TYPE, 2)) dumpRootOp =
+ getDumpRootOp(op));
----------------
Hardcode84 wrote:
It was part of the same perf issue, but it can be fixed separately, https://github.com/llvm/llvm-project/pull/233771
https://github.com/llvm/llvm-project/pull/231423
More information about the Mlir-commits
mailing list