[llvm-branch-commits] [mlir] 9c3fa3d - Don't emit on op diagnostic in reproducer emission

Jacques Pienaar via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Dec 13 07:25:43 PST 2020


Author: Jacques Pienaar
Date: 2020-12-13T07:21:32-08:00
New Revision: 9c3fa3d84d5cdcdcdb5b6961f2c587f84e7caa39

URL: https://github.com/llvm/llvm-project/commit/9c3fa3d84d5cdcdcdb5b6961f2c587f84e7caa39
DIFF: https://github.com/llvm/llvm-project/commit/9c3fa3d84d5cdcdcdb5b6961f2c587f84e7caa39.diff

LOG: Don't emit on op diagnostic in reproducer emission

This avoids dumping the module post emitting a reproducer, which results in
many MB logs where a reproducer has already been neatly generated.

Differential Revision: https://reviews.llvm.org/D93165

Added: 
    

Modified: 
    mlir/lib/Pass/Pass.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Pass/Pass.cpp b/mlir/lib/Pass/Pass.cpp
index 056da035a5b5..f53a087fac47 100644
--- a/mlir/lib/Pass/Pass.cpp
+++ b/mlir/lib/Pass/Pass.cpp
@@ -765,10 +765,14 @@ PassManager::runWithCrashRecovery(MutableArrayRef<std::unique_ptr<Pass>> passes,
   std::string error;
   if (failed(context.generate(error)))
     return op->emitError("<MLIR-PassManager-Crash-Reproducer>: ") << error;
-  return op->emitError()
-         << "A failure has been detected while processing the MLIR module, a "
-            "reproducer has been generated in '"
-         << *crashReproducerFileName << "'";
+  bool shouldPrintOnOp = op->getContext()->shouldPrintOpOnDiagnostic();
+  op->getContext()->printOpOnDiagnostic(false);
+  op->emitError()
+      << "A failure has been detected while processing the MLIR module, a "
+         "reproducer has been generated in '"
+      << *crashReproducerFileName << "'";
+  op->getContext()->printOpOnDiagnostic(shouldPrintOnOp);
+  return failure();
 }
 
 //===----------------------------------------------------------------------===//


        


More information about the llvm-branch-commits mailing list