[llvm-branch-commits] [mlir] e032669 - [mlir] Skip empty op-pipelines in inliner textual opt parsing

Jacques Pienaar via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Dec 29 14:04:43 PST 2020


Author: Jacques Pienaar
Date: 2020-12-29T13:59:53-08:00
New Revision: e03266994af898efcde7b27936250e85f774f39f

URL: https://github.com/llvm/llvm-project/commit/e03266994af898efcde7b27936250e85f774f39f
DIFF: https://github.com/llvm/llvm-project/commit/e03266994af898efcde7b27936250e85f774f39f.diff

LOG: [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.

Added: 
    

Modified: 
    mlir/lib/Transforms/Inliner.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Transforms/Inliner.cpp b/mlir/lib/Transforms/Inliner.cpp
index 364af20c0695..42ab8f0ce4df 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<OpPassManager> pipelines;
   for (StringRef pipeline : opPipelineStrs) {
+    // Skip empty pipelines.
+    if (pipeline.empty())
+      continue;
+
     // Pipelines are expected to be of the form `<op-name>(<pipeline>)`.
     size_t pipelineStart = pipeline.find_first_of('(');
     if (pipelineStart == StringRef::npos || !pipeline.consume_back(")"))


        


More information about the llvm-branch-commits mailing list