[Mlir-commits] [mlir] [mlir] Fix debug output for passes that modify top-level operation. (PR #80022)

Robert Konicar llvmlistbot at llvm.org
Wed Jan 31 02:11:56 PST 2024


================
@@ -40,7 +40,9 @@ static void logImpossibleToMatch(const Pattern &pattern) {
 
 /// Log IR after pattern application.
 static Operation *getDumpRootOp(Operation *op) {
-  return op->getParentWithTrait<mlir::OpTrait::IsIsolatedFromAbove>();
+  return op->hasTrait<mlir::OpTrait::IsIsolatedFromAbove>()
+             ? op
+             : op->getParentWithTrait<mlir::OpTrait::IsIsolatedFromAbove>();
----------------
Jezurko wrote:

You are right, this is better. I have pushed an update

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


More information about the Mlir-commits mailing list