From e03266994af898efcde7b27936250e85f774f39f Mon Sep 17 00:00:00 2001 From: Jacques Pienaar Date: Tue, 29 Dec 2020 13:59:53 -0800 Subject: [PATCH] [mlir] Skip empty op-pipelines in inliner textual opt parsing Avoids failing on cases like inline{default-pipeline=canonicalize max-iterations=4 op-pipelines=}, as produced by crash reproducer. --- mlir/lib/Transforms/Inliner.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mlir/lib/Transforms/Inliner.cpp b/mlir/lib/Transforms/Inliner.cpp index 364af20..42ab8f0 100644 --- a/mlir/lib/Transforms/Inliner.cpp +++ b/mlir/lib/Transforms/Inliner.cpp @@ -764,6 +764,10 @@ LogicalResult InlinerPass::initializeOptions(StringRef options) { // Initialize the op specific pass pipelines. llvm::StringMap pipelines; for (StringRef pipeline : opPipelineStrs) { + // Skip empty pipelines. + if (pipeline.empty()) + continue; + // Pipelines are expected to be of the form `()`. size_t pipelineStart = pipeline.find_first_of('('); if (pipelineStart == StringRef::npos || !pipeline.consume_back(")")) -- 2.7.4