MLIR
21.0.0git
|
Configuration options for the mlir-opt tool. More...
#include "mlir/Tools/mlir-opt/MlirOptMain.h"
Public Member Functions | |
MlirOptMainConfig & | allowUnregisteredDialects (bool allow) |
Options. More... | |
bool | shouldAllowUnregisteredDialects () const |
MlirOptMainConfig & | setDebugConfig (tracing::DebugConfig config) |
Set the debug configuration to use. More... | |
tracing::DebugConfig & | getDebugConfig () |
const tracing::DebugConfig & | getDebugConfig () const |
MlirOptMainConfig & | dumpPassPipeline (bool dump) |
Print the pass-pipeline as text before executing. More... | |
VerbosityLevel | getDiagnosticVerbosityLevel () const |
bool | shouldDumpPassPipeline () const |
MlirOptMainConfig & | emitBytecode (bool emit) |
Set the output format to bytecode instead of textual IR. More... | |
bool | shouldEmitBytecode () const |
bool | shouldElideResourceDataFromBytecode () const |
bool | shouldShowNotes () const |
MlirOptMainConfig & | setIrdlFile (StringRef file) |
Set the IRDL file to load before processing the input. More... | |
StringRef | getIrdlFile () const |
MlirOptMainConfig & | setEmitBytecodeVersion (int64_t version) |
Set the bytecode version to emit. More... | |
std::optional< int64_t > | bytecodeVersionToEmit () const |
MlirOptMainConfig & | setPassPipelineSetupFn (std::function< LogicalResult(PassManager &)> callback) |
Set the callback to populate the pass manager. More... | |
MlirOptMainConfig & | setPassPipelineParser (const PassPipelineCLParser &parser) |
Set the parser to use to populate the pass manager. More... | |
LogicalResult | setupPassPipeline (PassManager &pm) const |
Populate the passmanager, if any callback was set. More... | |
MlirOptMainConfig & | listPasses (bool list) |
List the registered passes and return. More... | |
bool | shouldListPasses () const |
MlirOptMainConfig & | runReproducer (bool enableReproducer) |
Enable running the reproducer information stored in resources (if present). More... | |
bool | shouldRunReproducer () const |
Return true if the reproducer should be run. More... | |
MlirOptMainConfig & | showDialects (bool show) |
Show the registered dialects before trying to load the input file. More... | |
bool | shouldShowDialects () const |
MlirOptMainConfig & | splitInputFile (std::string splitMarker=kDefaultSplitMarker) |
Set the marker on which to split the input into chunks and process each chunk independently. More... | |
StringRef | inputSplitMarker () const |
MlirOptMainConfig & | outputSplitMarker (std::string splitMarker=kDefaultSplitMarker) |
Set whether to merge the output chunks into one file using the given marker. More... | |
StringRef | outputSplitMarker () const |
MlirOptMainConfig & | useExplicitModule (bool useExplicitModule) |
Disable implicit addition of a top-level module op during parsing. More... | |
bool | shouldUseExplicitModule () const |
MlirOptMainConfig & | verifyDiagnostics (bool verify) |
Set whether to check that emitted diagnostics match expected-* lines on the corresponding line. More... | |
bool | shouldVerifyDiagnostics () const |
MlirOptMainConfig & | verifyPasses (bool verify) |
Set whether to run the verifier after each transformation pass. More... | |
bool | shouldVerifyPasses () const |
MlirOptMainConfig & | verifyOnParsing (bool verify) |
Set whether to run the verifier on parsing. More... | |
bool | shouldVerifyOnParsing () const |
MlirOptMainConfig & | verifyRoundtrip (bool verify) |
Set whether to run the verifier after each transformation pass. More... | |
bool | shouldVerifyRoundtrip () const |
StringRef | getReproducerFilename () const |
Reproducer file generation (no crash required). More... | |
Static Public Member Functions | |
static void | registerCLOptions (DialectRegistry &dialectRegistry) |
Register the options as global LLVM command line options. More... | |
static MlirOptMainConfig | createFromCLOptions () |
Create a new config with the default set from the CL options. More... | |
Protected Attributes | |
bool | allowUnregisteredDialectsFlag = false |
Allow operation with no registered dialects. More... | |
tracing::DebugConfig | debugConfig |
Configuration for the debugging hooks. More... | |
VerbosityLevel | diagnosticVerbosityLevelFlag |
Verbosity level of diagnostic information. More... | |
bool | dumpPassPipelineFlag = false |
Print the pipeline that will be run. More... | |
bool | emitBytecodeFlag = false |
Emit bytecode instead of textual assembly when generating output. More... | |
bool | elideResourceDataFromBytecodeFlag = false |
Elide resources when generating bytecode. More... | |
bool | enableDebuggerActionHookFlag = false |
Enable the Debugger action hook: Debugger can intercept MLIR Actions. More... | |
std::string | irdlFileFlag = "" |
IRDL file to register before processing the input. More... | |
std::vector< tracing::BreakpointManager * > | logActionLocationFilter |
Location Breakpoints to filter the action logging. More... | |
std::optional< int64_t > | emitBytecodeVersion = std::nullopt |
Emit bytecode at given version. More... | |
std::function< LogicalResult(PassManager &)> | passPipelineCallback |
The callback to populate the pass manager. More... | |
bool | listPassesFlag = false |
List the registered passes and return. More... | |
bool | runReproducerFlag = false |
Enable running the reproducer. More... | |
bool | showDialectsFlag = false |
Show the registered dialects before trying to load the input file. More... | |
bool | disableDiagnosticNotesFlag = true |
Show the notes in diagnostic information. More... | |
std::string | splitInputFileFlag = "" |
Split the input file based on the given marker into chunks and process each chunk independently. More... | |
std::string | outputSplitMarkerFlag = "" |
Merge output chunks into one file using the given marker. More... | |
bool | useExplicitModuleFlag = false |
Use an explicit top-level module op during parsing. More... | |
bool | verifyDiagnosticsFlag = false |
Set whether to check that emitted diagnostics match expected-* lines on the corresponding line. More... | |
bool | verifyPassesFlag = true |
Run the verifier after each transformation pass. More... | |
bool | disableVerifierOnParsingFlag = false |
Disable the verifier on parsing. More... | |
bool | verifyRoundtripFlag = false |
Verify that the input IR round-trips perfectly. More... | |
std::string | generateReproducerFileFlag = "" |
The reproducer output filename (no crash required). More... | |
Configuration options for the mlir-opt tool.
This is intended to help building tools like mlir-opt by collecting the supported options. The API is fluent, and the options are sorted in alphabetical order below. The options can be exposed to the LLVM command line by registering them with MlirOptMainConfig::registerCLOptions(DialectRegistry &);
and creating a config using auto config = MlirOptMainConfig::createFromCLOptions();
.
Definition at line 48 of file MlirOptMain.h.
|
inline |
Options.
Allow operation with no registered dialects. This option is for convenience during testing only and discouraged in general.
Definition at line 63 of file MlirOptMain.h.
References allowUnregisteredDialectsFlag.
|
inline |
Definition at line 116 of file MlirOptMain.h.
References emitBytecodeVersion.
|
static |
Create a new config with the default set from the CL options.
Definition at line 276 of file MlirOptMain.cpp.
References clOptionsConfig, and mlir::tracing::DebugConfig::createFromCLOptions().
Referenced by mlir::MlirOptMain().
|
inline |
Print the pass-pipeline as text before executing.
Definition at line 80 of file MlirOptMain.h.
References dumpPassPipelineFlag.
|
inline |
Set the output format to bytecode instead of textual IR.
Definition at line 92 of file MlirOptMain.h.
References emitBytecodeFlag.
|
inline |
Definition at line 76 of file MlirOptMain.h.
References debugConfig.
|
inline |
Definition at line 77 of file MlirOptMain.h.
References debugConfig.
|
inline |
Definition at line 85 of file MlirOptMain.h.
References diagnosticVerbosityLevelFlag.
|
inline |
Definition at line 109 of file MlirOptMain.h.
References irdlFileFlag.
|
inline |
Reproducer file generation (no crash required).
Definition at line 216 of file MlirOptMain.h.
References generateReproducerFileFlag.
|
inline |
Definition at line 168 of file MlirOptMain.h.
References splitInputFileFlag.
|
inline |
List the registered passes and return.
Definition at line 138 of file MlirOptMain.h.
References listPassesFlag.
|
inline |
Definition at line 177 of file MlirOptMain.h.
References outputSplitMarkerFlag.
|
inline |
Set whether to merge the output chunks into one file using the given marker.
Definition at line 173 of file MlirOptMain.h.
References outputSplitMarkerFlag.
|
static |
Register the options as global LLVM command line options.
Definition at line 271 of file MlirOptMain.cpp.
References clOptionsConfig, and mlir::tracing::DebugConfig::registerCLOptions().
Referenced by mlir::registerAndParseCLIOptions().
|
inline |
Enable running the reproducer information stored in resources (if present).
Definition at line 146 of file MlirOptMain.h.
References runReproducerFlag.
|
inline |
Set the debug configuration to use.
Definition at line 72 of file MlirOptMain.h.
References mlir::config, and debugConfig.
|
inline |
Set the bytecode version to emit.
Definition at line 112 of file MlirOptMain.h.
References emitBytecodeVersion.
|
inline |
Set the IRDL file to load before processing the input.
Definition at line 105 of file MlirOptMain.h.
References irdlFileFlag.
MlirOptMainConfig & MlirOptMainConfig::setPassPipelineParser | ( | const PassPipelineCLParser & | parser | ) |
Set the parser to use to populate the pass manager.
Definition at line 281 of file MlirOptMain.cpp.
References mlir::PassPipelineCLParser::addToPipeline(), mlir::emitError(), and mlir::get().
|
inline |
Set the callback to populate the pass manager.
Definition at line 122 of file MlirOptMain.h.
References passPipelineCallback.
|
inline |
Populate the passmanager, if any callback was set.
Definition at line 131 of file MlirOptMain.h.
References passPipelineCallback.
|
inline |
Definition at line 67 of file MlirOptMain.h.
References allowUnregisteredDialectsFlag.
|
inline |
Definition at line 89 of file MlirOptMain.h.
References dumpPassPipelineFlag.
|
inline |
Definition at line 98 of file MlirOptMain.h.
References elideResourceDataFromBytecodeFlag.
|
inline |
Definition at line 96 of file MlirOptMain.h.
References emitBytecodeFlag.
|
inline |
Definition at line 142 of file MlirOptMain.h.
References listPassesFlag.
|
inline |
Return true if the reproducer should be run.
Definition at line 152 of file MlirOptMain.h.
References runReproducerFlag.
|
inline |
Definition at line 159 of file MlirOptMain.h.
References showDialectsFlag.
|
inline |
Definition at line 102 of file MlirOptMain.h.
References disableDiagnosticNotesFlag.
|
inline |
Definition at line 184 of file MlirOptMain.h.
References useExplicitModuleFlag.
|
inline |
Definition at line 192 of file MlirOptMain.h.
References verifyDiagnosticsFlag.
|
inline |
Definition at line 206 of file MlirOptMain.h.
References disableVerifierOnParsingFlag.
|
inline |
Definition at line 199 of file MlirOptMain.h.
References verifyPassesFlag.
|
inline |
Definition at line 213 of file MlirOptMain.h.
References verifyRoundtripFlag.
|
inline |
Show the registered dialects before trying to load the input file.
Definition at line 155 of file MlirOptMain.h.
References showDialectsFlag.
|
inline |
Set the marker on which to split the input into chunks and process each chunk independently.
Input is not split if empty.
Definition at line 164 of file MlirOptMain.h.
References splitInputFileFlag.
|
inline |
Disable implicit addition of a top-level module op during parsing.
Definition at line 180 of file MlirOptMain.h.
References useExplicitModuleFlag.
|
inline |
Set whether to check that emitted diagnostics match expected-*
lines on the corresponding line.
This is meant for implementing diagnostic tests.
Definition at line 188 of file MlirOptMain.h.
References mlir::verify(), and verifyDiagnosticsFlag.
|
inline |
Set whether to run the verifier on parsing.
Definition at line 202 of file MlirOptMain.h.
References disableVerifierOnParsingFlag, and mlir::verify().
|
inline |
Set whether to run the verifier after each transformation pass.
Definition at line 195 of file MlirOptMain.h.
References mlir::verify(), and verifyPassesFlag.
|
inline |
Set whether to run the verifier after each transformation pass.
Definition at line 209 of file MlirOptMain.h.
References mlir::verify(), and verifyRoundtripFlag.
|
protected |
Allow operation with no registered dialects.
This option is for convenience during testing only and discouraged in general.
Definition at line 222 of file MlirOptMain.h.
Referenced by allowUnregisteredDialects(), and shouldAllowUnregisteredDialects().
|
protected |
Configuration for the debugging hooks.
Definition at line 225 of file MlirOptMain.h.
Referenced by getDebugConfig(), and setDebugConfig().
|
protected |
Verbosity level of diagnostic information.
0: Errors only, 1: Errors and warnings, 2: Errors, warnings and remarks.
Definition at line 229 of file MlirOptMain.h.
Referenced by getDiagnosticVerbosityLevel().
|
protected |
Show the notes in diagnostic information.
Notes can be included in any diagnostic information, so it is not specified in the verbosity level.
Definition at line 268 of file MlirOptMain.h.
Referenced by shouldShowNotes().
|
protected |
Disable the verifier on parsing.
Definition at line 288 of file MlirOptMain.h.
Referenced by shouldVerifyOnParsing(), and verifyOnParsing().
|
protected |
Print the pipeline that will be run.
Definition at line 233 of file MlirOptMain.h.
Referenced by dumpPassPipeline(), and shouldDumpPassPipeline().
|
protected |
Elide resources when generating bytecode.
Definition at line 239 of file MlirOptMain.h.
Referenced by shouldElideResourceDataFromBytecode().
|
protected |
Emit bytecode instead of textual assembly when generating output.
Definition at line 236 of file MlirOptMain.h.
Referenced by emitBytecode(), and shouldEmitBytecode().
|
protected |
Emit bytecode at given version.
Definition at line 251 of file MlirOptMain.h.
Referenced by bytecodeVersionToEmit(), and setEmitBytecodeVersion().
|
protected |
Enable the Debugger action hook: Debugger can intercept MLIR Actions.
Definition at line 242 of file MlirOptMain.h.
|
protected |
The reproducer output filename (no crash required).
Definition at line 294 of file MlirOptMain.h.
Referenced by getReproducerFilename().
|
protected |
IRDL file to register before processing the input.
Definition at line 245 of file MlirOptMain.h.
Referenced by getIrdlFile(), and setIrdlFile().
|
protected |
List the registered passes and return.
Definition at line 257 of file MlirOptMain.h.
Referenced by listPasses(), and shouldListPasses().
|
protected |
Location Breakpoints to filter the action logging.
Definition at line 248 of file MlirOptMain.h.
|
protected |
Merge output chunks into one file using the given marker.
Definition at line 275 of file MlirOptMain.h.
Referenced by outputSplitMarker().
|
protected |
The callback to populate the pass manager.
Definition at line 254 of file MlirOptMain.h.
Referenced by setPassPipelineSetupFn(), and setupPassPipeline().
|
protected |
Enable running the reproducer.
Definition at line 260 of file MlirOptMain.h.
Referenced by runReproducer(), and shouldRunReproducer().
|
protected |
Show the registered dialects before trying to load the input file.
Definition at line 263 of file MlirOptMain.h.
Referenced by shouldShowDialects(), and showDialects().
|
protected |
Split the input file based on the given marker into chunks and process each chunk independently.
Input is not split if empty.
Definition at line 272 of file MlirOptMain.h.
Referenced by inputSplitMarker(), and splitInputFile().
|
protected |
Use an explicit top-level module op during parsing.
Definition at line 278 of file MlirOptMain.h.
Referenced by shouldUseExplicitModule(), and useExplicitModule().
|
protected |
Set whether to check that emitted diagnostics match expected-*
lines on the corresponding line.
This is meant for implementing diagnostic tests.
Definition at line 282 of file MlirOptMain.h.
Referenced by shouldVerifyDiagnostics(), and verifyDiagnostics().
|
protected |
Run the verifier after each transformation pass.
Definition at line 285 of file MlirOptMain.h.
Referenced by shouldVerifyPasses(), and verifyPasses().
|
protected |
Verify that the input IR round-trips perfectly.
Definition at line 291 of file MlirOptMain.h.
Referenced by shouldVerifyRoundtrip(), and verifyRoundtrip().