MLIR
20.0.0git
|
This class implements a command-line parser for MLIR passes. More...
#include "mlir/Pass/PassRegistry.h"
Public Member Functions | |
PassPipelineCLParser (StringRef arg, StringRef description) | |
Construct a pass pipeline parser with the given command line description. More... | |
PassPipelineCLParser (StringRef arg, StringRef description, StringRef alias) | |
~PassPipelineCLParser () | |
bool | hasAnyOccurrences () const |
Returns true if this parser contains any valid options to add. More... | |
bool | contains (const PassRegistryEntry *entry) const |
Returns true if the given pass registry entry was registered at the top-level of the parser, i.e. More... | |
LogicalResult | addToPipeline (OpPassManager &pm, function_ref< LogicalResult(const Twine &)> errorHandler) const |
Adds the passes defined by this parser entry to the given pass manager. More... | |
This class implements a command-line parser for MLIR passes.
It registers a cl option with a given argument and description. This parser will register options for each of the passes and pipelines that have been registered with the pass registry; Meaning that -cse
will refer to the CSE pass in MLIR. It also registers an argument, pass-pipeline
, that supports parsing a textual description of a pipeline. This option is mutually exclusive with the individual pass options.
Definition at line 247 of file PassRegistry.h.
PassPipelineCLParser::PassPipelineCLParser | ( | StringRef | arg, |
StringRef | description | ||
) |
Construct a pass pipeline parser with the given command line description.
Optionally registers an alias for the pass-pipeline
option.
Definition at line 960 of file PassRegistry.cpp.
PassPipelineCLParser::PassPipelineCLParser | ( | StringRef | arg, |
StringRef | description, | ||
StringRef | alias | ||
) |
Definition at line 967 of file PassRegistry.cpp.
References PASS_PIPELINE_ARG.
|
default |
LogicalResult PassPipelineCLParser::addToPipeline | ( | OpPassManager & | pm, |
function_ref< LogicalResult(const Twine &)> | errorHandler | ||
) | const |
Adds the passes defined by this parser entry to the given pass manager.
Returns failure() if the pass could not be properly constructed due to options parsing.
Definition at line 990 of file PassRegistry.cpp.
References mlir::parsePassPipeline(), and PASS_PIPELINE_ARG.
Referenced by mlir::mlirReduceMain(), and mlir::MlirOptMainConfig::setPassPipelineParser().
bool PassPipelineCLParser::contains | ( | const PassRegistryEntry * | entry | ) | const |
Returns true if the given pass registry entry was registered at the top-level of the parser, i.e.
not within an explicit textual pipeline.
Definition at line 985 of file PassRegistry.cpp.
bool PassPipelineCLParser::hasAnyOccurrences | ( | ) | const |
Returns true if this parser contains any valid options to add.
Definition at line 978 of file PassRegistry.cpp.