Skip to content

Commit 9c3fa3d

Browse files
committed
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
1 parent 076f87a commit 9c3fa3d

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

mlir/lib/Pass/Pass.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -765,10 +765,14 @@ PassManager::runWithCrashRecovery(MutableArrayRef<std::unique_ptr<Pass>> passes,
765765
std::string error;
766766
if (failed(context.generate(error)))
767767
return op->emitError("<MLIR-PassManager-Crash-Reproducer>: ") << error;
768-
return op->emitError()
769-
<< "A failure has been detected while processing the MLIR module, a "
770-
"reproducer has been generated in '"
771-
<< *crashReproducerFileName << "'";
768+
bool shouldPrintOnOp = op->getContext()->shouldPrintOpOnDiagnostic();
769+
op->getContext()->printOpOnDiagnostic(false);
770+
op->emitError()
771+
<< "A failure has been detected while processing the MLIR module, a "
772+
"reproducer has been generated in '"
773+
<< *crashReproducerFileName << "'";
774+
op->getContext()->printOpOnDiagnostic(shouldPrintOnOp);
775+
return failure();
772776
}
773777

774778
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)