Skip to content

Commit

Permalink
[mlir] Remove unneeded cl::ZeroOrMore for ListOption variables. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
MaskRay committed Jul 1, 2022
1 parent 15cb180 commit 62a4e6a
Show file tree
Hide file tree
Showing 11 changed files with 18 additions and 32 deletions.
2 changes: 1 addition & 1 deletion mlir/docs/PassManagement.md
Expand Up @@ -780,7 +780,7 @@ struct MyPass : PassWrapper<MyPass, OperationPass<ModuleOp>> {
llvm::cl::desc("An example option"), llvm::cl::init(true)};
ListOption<int64_t> listOption{
*this, "example-list",
llvm::cl::desc("An example list option"), llvm::cl::ZeroOrMore};
llvm::cl::desc("An example list option")};

// Specify any statistics.
Statistic statistic{this, "example-statistic", "An example statistic"};
Expand Down
9 changes: 3 additions & 6 deletions mlir/include/mlir/Dialect/Affine/Passes.td
Expand Up @@ -193,8 +193,7 @@ def AffineLoopTiling : Pass<"affine-loop-tile", "func::FuncOp"> {
"Use this tile size for all loops">,
ListOption<"tileSizes", "tile-sizes", "unsigned",
"List of tile sizes for each perfect nest "
"(overridden by -tile-size)",
"llvm::cl::ZeroOrMore">,
"(overridden by -tile-size)">,
];
}

Expand Down Expand Up @@ -347,8 +346,7 @@ def AffineVectorize : Pass<"affine-super-vectorize", "func::FuncOp"> {
let dependentDialects = ["vector::VectorDialect"];
let options = [
ListOption<"vectorSizes", "virtual-vector-size", "int64_t",
"Specify an n-D virtual vector size for vectorization",
"llvm::cl::ZeroOrMore">,
"Specify an n-D virtual vector size for vectorization">,
// Optionally, the fixed mapping from loop to fastest varying MemRef
// dimension for all the MemRefs within a loop pattern:
// the index represents the loop depth, the value represents the k^th
Expand All @@ -358,8 +356,7 @@ def AffineVectorize : Pass<"affine-super-vectorize", "func::FuncOp"> {
ListOption<"fastestVaryingPattern", "test-fastest-varying", "int64_t",
"Specify a 1-D, 2-D or 3-D pattern of fastest varying memory "
"dimensions to match. See defaultPatterns in Vectorize.cpp for "
"a description and examples. This is used for testing purposes",
"llvm::cl::ZeroOrMore">,
"a description and examples. This is used for testing purposes">,
Option<"vectorizeReductions", "vectorize-reductions", "bool",
/*default=*/"false",
"Vectorize known reductions expressed via iter_args. "
Expand Down
3 changes: 1 addition & 2 deletions mlir/include/mlir/Dialect/Linalg/Passes.td
Expand Up @@ -134,8 +134,7 @@ def LinalgTiling : Pass<"linalg-tile", "func::FuncOp"> {
"scf::SCFDialect"
];
let options = [
ListOption<"tileSizes", "tile-sizes", "int64_t", "Tile sizes",
"llvm::cl::ZeroOrMore">,
ListOption<"tileSizes", "tile-sizes", "int64_t", "Tile sizes">,
Option<"loopType", "loop-type", "std::string", /*default=*/"\"for\"",
"Specify the type of loops to generate: for, parallel">
];
Expand Down
2 changes: 1 addition & 1 deletion mlir/include/mlir/Dialect/SCF/Transforms/Passes.td
Expand Up @@ -74,7 +74,7 @@ def SCFParallelLoopTiling : Pass<"scf-parallel-loop-tiling"> {
let constructor = "mlir::createParallelLoopTilingPass()";
let options = [
ListOption<"tileSizes", "parallel-loop-tile-sizes", "int64_t",
"Factors to tile parallel loops by", "llvm::cl::ZeroOrMore">,
"Factors to tile parallel loops by">,
Option<"noMinMaxBounds", "no-min-max-bounds", "bool",
/*default=*/"false",
"Perform tiling with fixed upper bound with inbound check "
Expand Down
2 changes: 1 addition & 1 deletion mlir/include/mlir/Reducer/Passes.td
Expand Up @@ -20,7 +20,7 @@ def CommonReductionPassOptions {
Option<"testerName", "test", "std::string", /* default */"",
"The location of the tester which tests the file interestingness">,
ListOption<"testerArgs", "test-arg", "std::string",
"arguments of the tester", "llvm::cl::ZeroOrMore">,
"arguments of the tester">,
];
}

Expand Down
2 changes: 1 addition & 1 deletion mlir/lib/Support/DebugCounter.cpp
Expand Up @@ -27,7 +27,7 @@ struct DebugCounterOptions {
"mlir-debug-counter",
llvm::cl::desc(
"Comma separated list of debug counter skip and count arguments"),
llvm::cl::CommaSeparated, llvm::cl::ZeroOrMore};
llvm::cl::CommaSeparated};

llvm::cl::opt<bool> printCounterInfo{
"mlir-print-debug-counter", llvm::cl::init(false), llvm::cl::Optional,
Expand Down
15 changes: 5 additions & 10 deletions mlir/test/lib/Dialect/Linalg/TestLinalgCodegenStrategy.cpp
Expand Up @@ -101,18 +101,14 @@ struct TestLinalgCodegenStrategy
llvm::cl::init(false)};
ListOption<std::string> paddingValues{
*this, "padding-values",
llvm::cl::desc("Operand padding values parsed by the attribute parser."),
llvm::cl::ZeroOrMore};
llvm::cl::desc("Operand padding values parsed by the attribute parser.")};
ListOption<int64_t> paddingDimensions{
*this, "padding-dimensions",
llvm::cl::desc("Operation iterator dimensions to pad."),
llvm::cl::ZeroOrMore};
llvm::cl::desc("Operation iterator dimensions to pad.")};
ListOption<int64_t> packPaddings{*this, "pack-paddings",
llvm::cl::desc("Operand packing flags."),
llvm::cl::ZeroOrMore};
llvm::cl::desc("Operand packing flags.")};
ListOption<int64_t> hoistPaddings{*this, "hoist-paddings",
llvm::cl::desc("Operand hoisting depths."),
llvm::cl::ZeroOrMore};
llvm::cl::desc("Operand hoisting depths.")};
ListOption<SmallVector<int64_t>> transposePaddings{
*this, "transpose-paddings",
llvm::cl::desc(
Expand All @@ -122,8 +118,7 @@ struct TestLinalgCodegenStrategy
"It defines the interchange [1, 0, 2] for operand one and "
"the interchange [0, 1] (no transpose) for the remaining operands."
"All interchange vectors have to be permuations matching the "
"operand rank."),
llvm::cl::ZeroOrMore};
"operand rank.")};
Option<bool> generalize{*this, "generalize",
llvm::cl::desc("Generalize named operations."),
llvm::cl::init(false)};
Expand Down
3 changes: 1 addition & 2 deletions mlir/test/lib/Dialect/Linalg/TestLinalgFusionTransforms.cpp
Expand Up @@ -286,8 +286,7 @@ struct TestLinalgTileAndFuseSequencePass
: PassWrapper(pass){};

ListOption<int64_t> tileSizes{*this, "tile-sizes",
llvm::cl::desc("Tile sizes to use for ops"),
llvm::cl::ZeroOrMore};
llvm::cl::desc("Tile sizes to use for ops")};

void getDependentDialects(DialectRegistry &registry) const override {
registry.insert<AffineDialect, linalg::LinalgDialect, memref::MemRefDialect,
Expand Down
6 changes: 2 additions & 4 deletions mlir/test/lib/Dialect/Linalg/TestLinalgTransforms.cpp
Expand Up @@ -121,12 +121,10 @@ struct TestLinalgTransforms
llvm::cl::init(false)};
ListOption<int64_t> peeledLoops{
*this, "peeled-loops",
llvm::cl::desc("Loops to be peeled when test-tile-pattern"),
llvm::cl::ZeroOrMore};
llvm::cl::desc("Loops to be peeled when test-tile-pattern")};
ListOption<int64_t> tileSizes{
*this, "tile-sizes",
llvm::cl::desc("Linalg tile sizes for test-tile-pattern"),
llvm::cl::ZeroOrMore};
llvm::cl::desc("Linalg tile sizes for test-tile-pattern")};
Option<bool> skipPartial{
*this, "skip-partial",
llvm::cl::desc("Skip loops inside partial iterations during peeling"),
Expand Down
3 changes: 1 addition & 2 deletions mlir/test/lib/Dialect/SPIRV/TestEntryPointAbi.cpp
Expand Up @@ -44,8 +44,7 @@ struct TestSpirvEntryPointABIPass
llvm::cl::desc(
"Workgroup size to use for all gpu.func kernels in the module, "
"specified with x-dimension first, y-dimension next and z-dimension "
"last. Unspecified dimensions will be set to 1"),
llvm::cl::ZeroOrMore};
"last. Unspecified dimensions will be set to 1")};
};
} // namespace

Expand Down
3 changes: 1 addition & 2 deletions mlir/test/lib/Dialect/Vector/TestVectorTransforms.cpp
Expand Up @@ -356,8 +356,7 @@ struct TestVectorUnrollingPatterns
}

ListOption<int64_t> unrollOrder{*this, "unroll-order",
llvm::cl::desc("set the unroll order"),
llvm::cl::ZeroOrMore};
llvm::cl::desc("set the unroll order")};

Option<bool> unrollBasedOnType{
*this, "unroll-based-on-type",
Expand Down

0 comments on commit 62a4e6a

Please sign in to comment.