[MLIR] Print more user-friendly error message when generating local reproducer and threading is enabled (#144905)
This commit is contained in:
@@ -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,
|
||||
|
||||
7
mlir/test/mlir-opt/local-reproducer-with-threading.mlir
Normal file
7
mlir/test/mlir-opt/local-reproducer-with-threading.mlir
Normal file
@@ -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@unknown {{Local crash reproduction may not be used without disabling mutli-threading first.}}
|
||||
Reference in New Issue
Block a user