diff --git a/mlir/lib/Pass/PassRegistry.cpp b/mlir/lib/Pass/PassRegistry.cpp --- a/mlir/lib/Pass/PassRegistry.cpp +++ b/mlir/lib/Pass/PassRegistry.cpp @@ -452,12 +452,15 @@ function_ref errorHandler) const { for (auto &elt : elements) { if (elt.registryEntry) { - if (failed( - elt.registryEntry->addToPipeline(pm, elt.options, errorHandler))) - return failure(); + if (failed(elt.registryEntry->addToPipeline(pm, elt.options, + errorHandler))) { + return errorHandler("failed to add `" + elt.name + "` with options `" + + elt.options + "`"); + } } else if (failed(addToPipeline(elt.innerPipeline, pm.nest(elt.name), errorHandler))) { - return failure(); + return errorHandler("failed to add `" + elt.name + "` with options `" + + elt.options + "` to inner pipeline"); } } return success();