[Mlir-commits] [mlir] 6edf2eb - [MLIR] Print more user-friendly error message when generating local reproducer and threading is enabled (#144905)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Jun 20 05:45:20 PDT 2025
Author: Artemiy Bulavin
Date: 2025-06-20T15:45:17+03:00
New Revision: 6edf2eb36470b623597668a7a97153544f568a40
URL: https://github.com/llvm/llvm-project/commit/6edf2eb36470b623597668a7a97153544f568a40
DIFF: https://github.com/llvm/llvm-project/commit/6edf2eb36470b623597668a7a97153544f568a40.diff
LOG: [MLIR] Print more user-friendly error message when generating local reproducer and threading is enabled (#144905)
Added:
mlir/test/mlir-opt/local-reproducer-with-threading.mlir
Modified:
mlir/lib/Pass/PassManagerOptions.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Pass/PassManagerOptions.cpp b/mlir/lib/Pass/PassManagerOptions.cpp
index dd119a75f4069..305bf72bb4799 100644
--- a/mlir/lib/Pass/PassManagerOptions.cpp
+++ b/mlir/lib/Pass/PassManagerOptions.cpp
@@ -146,6 +146,14 @@ LogicalResult mlir::applyPassManagerCLOptions(PassManager &pm) {
if (!options.isConstructed())
return failure();
+ if (options->reproducerFile.getNumOccurrences() && options->localReproducer &&
+ pm.getContext()->isMultithreadingEnabled()) {
+ emitError(UnknownLoc::get(pm.getContext()))
+ << "Local crash reproduction may not be used without disabling "
+ "mutli-threading first.";
+ return failure();
+ }
+
// Generate a reproducer on crash/failure.
if (options->reproducerFile.getNumOccurrences())
pm.enableCrashReproducerGeneration(options->reproducerFile,
diff --git a/mlir/test/mlir-opt/local-reproducer-with-threading.mlir b/mlir/test/mlir-opt/local-reproducer-with-threading.mlir
new file mode 100644
index 0000000000000..8e94f4edb91bf
--- /dev/null
+++ b/mlir/test/mlir-opt/local-reproducer-with-threading.mlir
@@ -0,0 +1,7 @@
+// Test that attempting to create a local crash reproducer without disabling threading
+// prints an error from the pass manager (as opposed to crashing with a stack trace).
+
+// RUN: mlir-opt --verify-diagnostics --mlir-pass-pipeline-local-reproducer \
+// RUN: --mlir-pass-pipeline-crash-reproducer=%t %s
+
+// expected-error at unknown {{Local crash reproduction may not be used without disabling mutli-threading first.}}
More information about the Mlir-commits
mailing list