diff --git a/mlir/lib/Pass/PassCrashRecovery.cpp b/mlir/lib/Pass/PassCrashRecovery.cpp --- a/mlir/lib/Pass/PassCrashRecovery.cpp +++ b/mlir/lib/Pass/PassCrashRecovery.cpp @@ -118,10 +118,13 @@ } descOS << "reproducer generated at `" << stream->description() << "`"; + std::string pipelineStr = + (preCrashOperation->getName().getStringRef() + "(" + pipeline + ")") + .str(); AsmState state(preCrashOperation); state.attachResourcePrinter( "mlir_reproducer", [&](Operation *op, AsmResourceBuilder &builder) { - builder.buildString("pipeline", pipeline); + builder.buildString("pipeline", pipelineStr); builder.buildBool("disable_threading", disableThreads); builder.buildBool("verify_each", verifyPasses); }); @@ -470,9 +473,12 @@ } LogicalResult PassReproducerOptions::apply(PassManager &pm) const { - if (pipeline.has_value()) - if (failed(parsePassPipeline(*pipeline, pm))) + if (pipeline.has_value()) { + FailureOr reproPm = parsePassPipeline(*pipeline); + if (failed(reproPm)) return failure(); + static_cast(pm) = std::move(*reproPm); + } if (disableThreading.has_value()) pm.getContext()->disableMultithreading(*disableThreading); diff --git a/mlir/test/Pass/crash-recovery-dynamic-failure.mlir b/mlir/test/Pass/crash-recovery-dynamic-failure.mlir --- a/mlir/test/Pass/crash-recovery-dynamic-failure.mlir +++ b/mlir/test/Pass/crash-recovery-dynamic-failure.mlir @@ -15,4 +15,4 @@ // REPRO_LOCAL_DYNAMIC_FAILURE: module @inner_mod1 // REPRO_LOCAL_DYNAMIC_FAILURE: module @foo { -// REPRO_LOCAL_DYNAMIC_FAILURE: pipeline: "builtin.module(test-pass-failure)" +// REPRO_LOCAL_DYNAMIC_FAILURE: pipeline: "builtin.module(builtin.module(test-pass-failure))" diff --git a/mlir/test/Pass/crash-recovery.mlir b/mlir/test/Pass/crash-recovery.mlir --- a/mlir/test/Pass/crash-recovery.mlir +++ b/mlir/test/Pass/crash-recovery.mlir @@ -22,12 +22,12 @@ // REPRO: module @inner_mod1 // REPRO: module @foo { -// REPRO: pipeline: "builtin.module(test-module-pass,test-pass-crash)" +// REPRO: pipeline: "builtin.module(builtin.module(test-module-pass,test-pass-crash))" // REPRO_LOCAL: module @inner_mod1 // REPRO_LOCAL: module @foo { -// REPRO_LOCAL: pipeline: "builtin.module(test-pass-crash)" +// REPRO_LOCAL: pipeline: "builtin.module(builtin.module(test-pass-crash))" // REPRO_LOCAL_DYNAMIC: module @inner_mod1 // REPRO_LOCAL_DYNAMIC: module @foo { -// REPRO_LOCAL_DYNAMIC: pipeline: "builtin.module(test-pass-crash)" +// REPRO_LOCAL_DYNAMIC: pipeline: "builtin.module(builtin.module(test-pass-crash))" diff --git a/mlir/test/Pass/run-reproducer.mlir b/mlir/test/Pass/run-reproducer.mlir --- a/mlir/test/Pass/run-reproducer.mlir +++ b/mlir/test/Pass/run-reproducer.mlir @@ -1,3 +1,4 @@ +// RUN: mlir-opt %s -test-dump-pipeline 2>&1 | FileCheck %s // RUN: mlir-opt %s -mlir-print-ir-before=cse 2>&1 | FileCheck -check-prefix=BEFORE %s func.func @foo() { @@ -12,7 +13,9 @@ {-# external_resources: { mlir_reproducer: { - pipeline: "func.func(cse,canonicalize)", + verify_each: true, + // CHECK: builtin.module(func.func(cse,canonicalize{ max-iterations=1 region-simplify=false top-down=false})) + pipeline: "builtin.module(func.func(cse,canonicalize{max-iterations=1 region-simplify=false top-down=false}))", disable_threading: true } }