forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir] Attempt to resolve edge cases in PassPipeline textual format
This commit makes the following changes: 1. Previously certain pipeline options could cause the options parser to get stuck in an an infinite loop. An example is: ``` mlir-opt %s -verify-each=false -pass-pipeline='builtin.module(func.func(test-options-super-pass{list={list=1,2},{list=3,4}}))'' ``` In this example, the 'list' option of the `test-options-super-pass` is itself a pass options specification (this capability was added in llvm#101118). However, while the textual format allows `ListOption<int>` to be given as `list=1,2,3`, it did not allow the same format for `ListOption<T>` when T is a subclass of `PassOptions` without extra enclosing `{....}`. Lack of enclosing `{...}` would cause the infinite looping in the parser. This change resolves the parser bug and also allows omitting the outer `{...}` for `ListOption`-of-options. 2. Previously, if you specified a default list value for your `ListOption`, e.g. `ListOption<int> opt{*this, "list", llvm::list_init({1,2,3})}`, it would be impossible to override that default value of `{1,2,3}` with an *empty* list on the command line, since `my-pass{list=}` was not allowed. This was not allowed because of ambiguous handling of lists-of-strings (no literal marker is currently required). This updates this behvior so that specifying empty lists (either `list={}` or just `list=` is allowed.
- Loading branch information
1 parent
fdb90ce
commit fdecfbb
Showing
5 changed files
with
76 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
// RUN: mlir-opt %s -pass-pipeline="builtin.module(inline)" -dump-pass-pipeline 2>&1 | FileCheck %s | ||
// CHECK: builtin.module(inline{default-pipeline=canonicalize inlining-threshold=4294967295 max-iterations=4 }) | ||
// CHECK: builtin.module(inline{default-pipeline=canonicalize inlining-threshold=4294967295 max-iterations=4 op-pipelines={} }) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters