We are able to config the reducer pass pipeline through command-line.
Details
Diff Detail
Event Timeline
mlir/include/mlir/Reducer/Passes.td | ||
---|---|---|
37–40 | I'm wondering if I could lift this to a ReductionBase, i.e., class ReductionBase : Pass<...> { let options = [ ... ] } ReductionTree : ReductionBase<...> { ... } Make ReductionTree inherits the options from base. It didn't work, I'm checking if I did anything wrong |
This CL also erases the bug mentioned here, https://bugs.llvm.org/show_bug.cgi?id=48094
mlir/include/mlir/Reducer/Passes.td | ||
---|---|---|
37–40 | Note: After checking the tblgen, it seems we don't support this feature. |
Nice cleanup!
mlir/include/mlir/Reducer/Passes.td | ||
---|---|---|
37–40 | I don't know if it's necessary to share here, but if you wanted to you could define a separate list and then concat them together: // Op's regions that don't need a terminator: requires some other traits // so it defines a list that must be concatenated. def SharedReductionPassOptions { list<Option> options = [ Option<"TesterName", "test", "std::string", /* default */"", "The filename of the tester">, ListOption<"TesterArgs", "test-arg", "std::string", "llvm::cl::ZeroOrMore, llvm::cl::MiscFlags::CommaSeparated">, ]; } ... def OptReduction : Pass<"opt-reduction-pass", "ModuleOp"> { let summary = "A reduction pass wrapper for optimization passes"; let constructor = "mlir::createOptReductionPass()"; let options = [ Option<"OptPass", "opt-pass", "std::string", /* default */"", "The optimization pass will be run dynamically in OptReductionPass">, ] # SharedReductionPassOptions.options; } | |
mlir/tools/mlir-reduce/OptReductionPass.cpp | ||
18 | I think this header is already transitively included. | |
23–24 | This change goes against the style, using namespace is preferred. | |
68 | Use explicit namespace resolution for functions: | |
mlir/tools/mlir-reduce/mlir-reduce.cpp | ||
93 | What is the GG for here? (Good Game?) | |
93–94 |
The option names should be camelCase, as they correspond to C++ variable names.