Skip to content

Commit 9b8d944

Browse files
wpmed92jpienaar
authored andcommitted
[mlir][core] Fix inline pass default pipeline dump
The inliner pass performs canonicalization when created programtically, run with `mlir-opt` with default options, or when explicitly specified. However, when running the pipeline resulting from a `-dump-pass-pipeline` on a default inline pass, the canonicalization is not performed as part of the inlining. This is because the default value for the `default-pipeline` option of the inline pass is an empty string, and this is selected during the dumping. When `InlinerPass::initializeOptions` detects the empty string, it sets the `defaultPipeline` to `nullptr`, which was previously set to canonicalize in the `InlinerPass` constructor, thus the canonicalization is not performed. The added test checks if the inline pass performs canonicalization by default, and that the dumped `default-pipeline` is set to `canonicalize`. Fixes: #60960 Reviewed By: rriddle Differential Revision: https://reviews.llvm.org/D145066
1 parent 1ab46e5 commit 9b8d944

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

mlir/include/mlir/Transforms/Passes.td

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ def Inliner : Pass<"inline"> {
109109
let constructor = "mlir::createInlinerPass()";
110110
let options = [
111111
Option<"defaultPipelineStr", "default-pipeline", "std::string",
112-
/*default=*/"", "The default optimizer pipeline used for callables">,
112+
/*default=*/"\"canonicalize\"", "The default optimizer pipeline used for callables">,
113113
ListOption<"opPipelineList", "op-pipelines", "OpPassManager",
114114
"Callable operation specific optimizer pipelines (in the form "
115115
"of `dialect.op(pipeline)`)">,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
// RUN: mlir-opt %s -pass-pipeline="builtin.module(inline)" -dump-pass-pipeline 2>&1 | FileCheck %s
2+
// CHECK: builtin.module(inline{default-pipeline=canonicalize max-iterations=4 })

0 commit comments

Comments
 (0)