|
MLIR 23.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. | |
| bool | shouldAllowUnregisteredDialects () const |
| MlirOptMainConfig & | setDebugConfig (tracing::DebugConfig config) |
| Set the debug configuration to use. | |
| tracing::DebugConfig & | getDebugConfig () |
| const tracing::DebugConfig & | getDebugConfig () const |
| MlirOptMainConfig & | dumpPassPipeline (bool dump) |
| Print the pass-pipeline as text before executing. | |
| VerbosityLevel | getDiagnosticVerbosityLevel () const |
| bool | shouldDumpPassPipeline () const |
| MlirOptMainConfig & | emitBytecode (bool emit) |
| Set the output format to bytecode instead of textual IR. | |
| bool | shouldEmitBytecode () const |
| bool | shouldElideResourceDataFromBytecode () const |
| bool | shouldShowNotes () const |
| MlirOptMainConfig & | setIrdlFile (StringRef file) |
| Set the IRDL file to load before processing the input. | |
| StringRef | getIrdlFile () const |
| MlirOptMainConfig & | setEmitBytecodeVersion (int64_t version) |
| Set the bytecode version to emit. | |
| std::optional< int64_t > | bytecodeVersionToEmit () const |
| MlirOptMainConfig & | emitBytecodeProducer (StringRef producer) |
| Set the bytecode producer to use. | |
| std::optional< StringRef > | bytecodeProducerToEmit () const |
| MlirOptMainConfig & | setPassPipelineSetupFn (std::function< LogicalResult(PassManager &)> callback) |
| Set the callback to populate the pass manager. | |
| MlirOptMainConfig & | setPassPipelineParser (const PassPipelineCLParser &parser) |
| Set the parser to use to populate the pass manager. | |
| LogicalResult | setupPassPipeline (PassManager &pm) const |
| Populate the passmanager, if any callback was set. | |
| MlirOptMainConfig & | listPasses (bool list) |
| List the registered passes and return. | |
| bool | shouldListPasses () const |
| MlirOptMainConfig & | runReproducer (bool enableReproducer) |
| Enable running the reproducer information stored in resources (if present). | |
| bool | shouldRunReproducer () const |
| Return true if the reproducer should be run. | |
| MlirOptMainConfig & | showDialects (bool show) |
| Show the registered dialects before trying to load the input file. | |
| 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. | |
| StringRef | inputSplitMarker () const |
| MlirOptMainConfig & | outputSplitMarker (std::string splitMarker=kDefaultSplitMarker) |
| Set whether to merge the output chunks into one file using the given marker. | |
| StringRef | outputSplitMarker () const |
| MlirOptMainConfig & | useExplicitModule (bool useExplicitModule) |
| Disable implicit addition of a top-level module op during parsing. | |
| bool | shouldUseExplicitModule () const |
| MlirOptMainConfig & | verifyDiagnostics (SourceMgrDiagnosticVerifierHandler::Level verify) |
| Set whether to check that emitted diagnostics match expected-* lines on the corresponding line. | |
| bool | shouldVerifyDiagnostics () const |
| SourceMgrDiagnosticVerifierHandler::Level | verifyDiagnosticsLevel () const |
| MlirOptMainConfig & | verifyPasses (bool verify) |
| Set whether to run the verifier after each transformation pass. | |
| bool | shouldVerifyPasses () const |
| MlirOptMainConfig & | verifyOnParsing (bool verify) |
| Set whether to run the verifier on parsing. | |
| bool | shouldVerifyOnParsing () const |
| MlirOptMainConfig & | verifyRoundtrip (bool verify) |
| Set whether to run the verifier after each transformation pass. | |
| bool | shouldVerifyRoundtrip () const |
| bool | shouldEmitRemarks () const |
| Checks if any remark filters are set. | |
| StringRef | getReproducerFilename () const |
| Reproducer file generation (no crash required). | |
| RemarkFormat | getRemarkFormat () const |
| Set the reproducer output filename. | |
| RemarkPolicy | getRemarkPolicy () const |
| Set the remark policy to use. | |
| std::string | getRemarksAllFilter () const |
| Set the remark format to use. | |
| std::string | getRemarksOutputFile () const |
| Set the remark output file. | |
| std::string | getRemarksPassedFilter () const |
| Set the remark passed filters. | |
| std::string | getRemarksFailedFilter () const |
| Set the remark failed filters. | |
| std::string | getRemarksMissedFilter () const |
| Set the remark missed filters. | |
| std::string | getRemarksAnalyseFilter () const |
| Set the remark analyse filters. | |
Static Public Member Functions | |
| static void | registerCLOptions (DialectRegistry &dialectRegistry) |
| Register the options as global LLVM command line options. | |
| static MlirOptMainConfig | createFromCLOptions () |
| Create a new config with the default set from the CL options. | |
Protected Attributes | |
| bool | allowUnregisteredDialectsFlag = false |
| Allow operation with no registered dialects. | |
| RemarkFormat | remarkFormatFlag = RemarkFormat::REMARK_FORMAT_STDOUT |
| Remark format. | |
| RemarkPolicy | remarkPolicyFlag = RemarkPolicy::REMARK_POLICY_ALL |
| Remark policy. | |
| std::string | remarksOutputFileFlag = "" |
| Remark file to output to. | |
| std::string | remarksAllFilterFlag = "" |
| Remark filters. | |
| std::string | remarksPassedFilterFlag = "" |
| std::string | remarksFailedFilterFlag = "" |
| std::string | remarksMissedFilterFlag = "" |
| std::string | remarksAnalyseFilterFlag = "" |
| tracing::DebugConfig | debugConfig |
| Configuration for the debugging hooks. | |
| VerbosityLevel | diagnosticVerbosityLevelFlag |
| Verbosity level of diagnostic information. | |
| bool | dumpPassPipelineFlag = false |
| Print the pipeline that will be run. | |
| bool | emitBytecodeFlag = false |
| Emit bytecode instead of textual assembly when generating output. | |
| bool | elideResourceDataFromBytecodeFlag = false |
| Elide resources when generating bytecode. | |
| std::string | irdlFileFlag = "" |
| IRDL file to register before processing the input. | |
| std::vector< tracing::BreakpointManager * > | logActionLocationFilter |
| Location Breakpoints to filter the action logging. | |
| std::optional< int64_t > | emitBytecodeVersion = std::nullopt |
| Emit bytecode at given version. | |
| std::string | emitBytecodeProducerFlag = "" |
| Emit bytecode with given producer. | |
| std::function< LogicalResult(PassManager &)> | passPipelineCallback |
| The callback to populate the pass manager. | |
| bool | listPassesFlag = false |
| List the registered passes and return. | |
| bool | runReproducerFlag = false |
| Enable running the reproducer. | |
| bool | showDialectsFlag = false |
| Show the registered dialects before trying to load the input file. | |
| bool | disableDiagnosticNotesFlag = true |
| Show the notes in diagnostic information. | |
| std::string | splitInputFileFlag = "" |
| Split the input file based on the given marker into chunks and process each chunk independently. | |
| std::string | outputSplitMarkerFlag = "" |
| Merge output chunks into one file using the given marker. | |
| bool | useExplicitModuleFlag = false |
| Use an explicit top-level module op during parsing. | |
| SourceMgrDiagnosticVerifierHandler::Level | verifyDiagnosticsFlag |
| Set whether to check that emitted diagnostics match expected-* lines on the corresponding line. | |
| bool | verifyPassesFlag = true |
| Run the verifier after each transformation pass. | |
| bool | disableVerifierOnParsingFlag = false |
| Disable the verifier on parsing. | |
| bool | verifyRoundtripFlag = false |
| Verify that the input IR round-trips perfectly. | |
| std::string | generateReproducerFileFlag = "" |
| The reproducer output filename (no crash required). | |
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 59 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 74 of file MlirOptMain.h.
References allowUnregisteredDialectsFlag.
|
inline |
Definition at line 136 of file MlirOptMain.h.
References emitBytecodeProducerFlag.
Referenced by performActions().
|
inline |
Definition at line 127 of file MlirOptMain.h.
References emitBytecodeVersion.
Referenced by performActions().
|
static |
Create a new config with the default set from the CL options.
Definition at line 353 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 91 of file MlirOptMain.h.
References dumpPassPipelineFlag.
|
inline |
Set the output format to bytecode instead of textual IR.
Definition at line 103 of file MlirOptMain.h.
References emit(), and emitBytecodeFlag.
|
inline |
Set the bytecode producer to use.
Definition at line 132 of file MlirOptMain.h.
References emitBytecodeProducerFlag.
|
inline |
|
inline |
Definition at line 88 of file MlirOptMain.h.
References debugConfig.
|
inline |
Definition at line 96 of file MlirOptMain.h.
References diagnosticVerbosityLevelFlag.
Referenced by processBuffer().
|
inline |
Definition at line 120 of file MlirOptMain.h.
References irdlFileFlag.
Referenced by doVerifyRoundTrip(), and processBuffer().
|
inline |
Set the reproducer output filename.
Definition at line 260 of file MlirOptMain.h.
References remarkFormatFlag.
Referenced by performActions().
|
inline |
Set the remark policy to use.
Definition at line 262 of file MlirOptMain.h.
References remarkPolicyFlag.
Referenced by performActions().
|
inline |
Set the remark format to use.
Definition at line 264 of file MlirOptMain.h.
References remarksAllFilterFlag.
Referenced by performActions(), and shouldEmitRemarks().
|
inline |
Set the remark analyse filters.
Definition at line 274 of file MlirOptMain.h.
References remarksAnalyseFilterFlag.
Referenced by performActions(), and shouldEmitRemarks().
|
inline |
Set the remark failed filters.
Definition at line 270 of file MlirOptMain.h.
References remarksFailedFilterFlag.
Referenced by performActions(), and shouldEmitRemarks().
|
inline |
Set the remark missed filters.
Definition at line 272 of file MlirOptMain.h.
References remarksMissedFilterFlag.
Referenced by performActions(), and shouldEmitRemarks().
|
inline |
Set the remark output file.
Definition at line 266 of file MlirOptMain.h.
References remarksOutputFileFlag.
Referenced by performActions().
|
inline |
Set the remark passed filters.
Definition at line 268 of file MlirOptMain.h.
References remarksPassedFilterFlag.
Referenced by performActions(), and shouldEmitRemarks().
|
inline |
Reproducer file generation (no crash required).
Definition at line 257 of file MlirOptMain.h.
References generateReproducerFileFlag.
Referenced by performActions().
|
inline |
Definition at line 190 of file MlirOptMain.h.
References splitInputFileFlag.
Referenced by mlir::MlirOptMain().
|
inline |
List the registered passes and return.
Definition at line 160 of file MlirOptMain.h.
References listPassesFlag.
|
inline |
Definition at line 199 of file MlirOptMain.h.
References outputSplitMarkerFlag.
|
inline |
Set whether to merge the output chunks into one file using the given marker.
Definition at line 195 of file MlirOptMain.h.
References mlir::kDefaultSplitMarker, and outputSplitMarkerFlag.
Referenced by mlir::MlirOptMain().
|
static |
Register the options as global LLVM command line options.
Definition at line 348 of file MlirOptMain.cpp.
References clOptionsConfig, and mlir::tracing::DebugConfig::registerCLOptions().
Referenced by mlir::registerCLIOptions().
|
inline |
Enable running the reproducer information stored in resources (if present).
Definition at line 168 of file MlirOptMain.h.
References runReproducerFlag.
|
inline |
Set the debug configuration to use.
Definition at line 83 of file MlirOptMain.h.
References debugConfig.
|
inline |
Set the bytecode version to emit.
Definition at line 123 of file MlirOptMain.h.
References emitBytecodeVersion.
|
inline |
Set the IRDL file to load before processing the input.
Definition at line 116 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 358 of file MlirOptMain.cpp.
References mlir::PassPipelineCLParser::addToPipeline(), mlir::emitError(), passPipelineCallback, shouldDumpPassPipeline(), and success().
|
inline |
Set the callback to populate the pass manager.
Definition at line 144 of file MlirOptMain.h.
References passPipelineCallback.
|
inline |
Populate the passmanager, if any callback was set.
Definition at line 153 of file MlirOptMain.h.
References passPipelineCallback, and success().
Referenced by performActions().
|
inline |
Definition at line 78 of file MlirOptMain.h.
References allowUnregisteredDialectsFlag.
Referenced by processBuffer().
|
inline |
Definition at line 100 of file MlirOptMain.h.
References dumpPassPipelineFlag.
Referenced by setPassPipelineParser().
|
inline |
Definition at line 109 of file MlirOptMain.h.
References elideResourceDataFromBytecodeFlag.
Referenced by performActions().
|
inline |
Definition at line 107 of file MlirOptMain.h.
References emitBytecodeFlag.
Referenced by performActions().
|
inline |
Checks if any remark filters are set.
Definition at line 247 of file MlirOptMain.h.
References getRemarksAllFilter(), getRemarksAnalyseFilter(), getRemarksFailedFilter(), getRemarksMissedFilter(), and getRemarksPassedFilter().
|
inline |
Definition at line 164 of file MlirOptMain.h.
References listPassesFlag.
Referenced by mlir::MlirOptMain(), and mlir::MlirOptMain().
|
inline |
Return true if the reproducer should be run.
Definition at line 174 of file MlirOptMain.h.
References runReproducerFlag.
Referenced by performActions().
|
inline |
Definition at line 181 of file MlirOptMain.h.
References showDialectsFlag.
Referenced by mlir::MlirOptMain(), and mlir::MlirOptMain().
|
inline |
Definition at line 113 of file MlirOptMain.h.
References disableDiagnosticNotesFlag.
Referenced by processBuffer().
|
inline |
Definition at line 206 of file MlirOptMain.h.
References useExplicitModuleFlag.
Referenced by performActions().
|
inline |
Definition at line 216 of file MlirOptMain.h.
References mlir::SourceMgrDiagnosticVerifierHandler::None, and verifyDiagnosticsFlag.
Referenced by mlir::MlirOptMain(), and processBuffer().
|
inline |
Definition at line 237 of file MlirOptMain.h.
References disableVerifierOnParsingFlag.
Referenced by doVerifyRoundTrip(), and performActions().
|
inline |
Definition at line 230 of file MlirOptMain.h.
References verifyPassesFlag.
Referenced by performActions().
|
inline |
Definition at line 244 of file MlirOptMain.h.
References verifyRoundtripFlag.
Referenced by performActions().
|
inline |
Show the registered dialects before trying to load the input file.
Definition at line 177 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 186 of file MlirOptMain.h.
References mlir::kDefaultSplitMarker, and splitInputFileFlag.
|
inline |
Disable implicit addition of a top-level module op during parsing.
Definition at line 202 of file MlirOptMain.h.
References useExplicitModule(), and useExplicitModuleFlag.
Referenced by useExplicitModule().
|
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 211 of file MlirOptMain.h.
References mlir::verify(), and verifyDiagnosticsFlag.
|
inline |
Definition at line 221 of file MlirOptMain.h.
References verifyDiagnosticsFlag.
Referenced by mlir::MlirOptMain().
|
inline |
Set whether to run the verifier on parsing.
Definition at line 233 of file MlirOptMain.h.
References disableVerifierOnParsingFlag, and mlir::verify().
|
inline |
Set whether to run the verifier after each transformation pass.
Definition at line 226 of file MlirOptMain.h.
References mlir::verify(), and verifyPassesFlag.
|
inline |
Set whether to run the verifier after each transformation pass.
Definition at line 240 of file MlirOptMain.h.
References mlir::verify(), and verifyRoundtripFlag.
Allow operation with no registered dialects.
This option is for convenience during testing only and discouraged in general.
Definition at line 282 of file MlirOptMain.h.
Referenced by allowUnregisteredDialects(), and shouldAllowUnregisteredDialects().
|
protected |
Configuration for the debugging hooks.
Definition at line 298 of file MlirOptMain.h.
Referenced by getDebugConfig(), getDebugConfig(), and setDebugConfig().
|
protected |
Verbosity level of diagnostic information.
0: Errors only, 1: Errors and warnings, 2: Errors, warnings and remarks.
Definition at line 302 of file MlirOptMain.h.
Referenced by getDiagnosticVerbosityLevel().
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 341 of file MlirOptMain.h.
Referenced by shouldShowNotes().
Disable the verifier on parsing.
Definition at line 362 of file MlirOptMain.h.
Referenced by shouldVerifyOnParsing(), and verifyOnParsing().
Print the pipeline that will be run.
Definition at line 306 of file MlirOptMain.h.
Referenced by dumpPassPipeline(), and shouldDumpPassPipeline().
Elide resources when generating bytecode.
Definition at line 312 of file MlirOptMain.h.
Referenced by shouldElideResourceDataFromBytecode().
Emit bytecode instead of textual assembly when generating output.
Definition at line 309 of file MlirOptMain.h.
Referenced by emitBytecode(), and shouldEmitBytecode().
|
protected |
Emit bytecode with given producer.
Definition at line 324 of file MlirOptMain.h.
Referenced by bytecodeProducerToEmit(), and emitBytecodeProducer().
|
protected |
Emit bytecode at given version.
Definition at line 321 of file MlirOptMain.h.
Referenced by bytecodeVersionToEmit(), and setEmitBytecodeVersion().
|
protected |
The reproducer output filename (no crash required).
Definition at line 368 of file MlirOptMain.h.
Referenced by getReproducerFilename().
|
protected |
IRDL file to register before processing the input.
Definition at line 315 of file MlirOptMain.h.
Referenced by getIrdlFile(), and setIrdlFile().
List the registered passes and return.
Definition at line 330 of file MlirOptMain.h.
Referenced by listPasses(), and shouldListPasses().
|
protected |
Location Breakpoints to filter the action logging.
Definition at line 318 of file MlirOptMain.h.
|
protected |
Merge output chunks into one file using the given marker.
Definition at line 348 of file MlirOptMain.h.
Referenced by outputSplitMarker(), and outputSplitMarker().
|
protected |
The callback to populate the pass manager.
Definition at line 327 of file MlirOptMain.h.
Referenced by setPassPipelineParser(), setPassPipelineSetupFn(), and setupPassPipeline().
|
protected |
|
protected |
|
protected |
|
protected |
Definition at line 295 of file MlirOptMain.h.
Referenced by getRemarksAnalyseFilter().
|
protected |
Definition at line 293 of file MlirOptMain.h.
Referenced by getRemarksFailedFilter().
|
protected |
Definition at line 294 of file MlirOptMain.h.
Referenced by getRemarksMissedFilter().
|
protected |
Remark file to output to.
Definition at line 289 of file MlirOptMain.h.
Referenced by getRemarksOutputFile().
|
protected |
Definition at line 292 of file MlirOptMain.h.
Referenced by getRemarksPassedFilter().
Enable running the reproducer.
Definition at line 333 of file MlirOptMain.h.
Referenced by runReproducer(), and shouldRunReproducer().
Show the registered dialects before trying to load the input file.
Definition at line 336 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 345 of file MlirOptMain.h.
Referenced by inputSplitMarker(), and splitInputFile().
Use an explicit top-level module op during parsing.
Definition at line 351 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 355 of file MlirOptMain.h.
Referenced by shouldVerifyDiagnostics(), verifyDiagnostics(), and verifyDiagnosticsLevel().
Run the verifier after each transformation pass.
Definition at line 359 of file MlirOptMain.h.
Referenced by shouldVerifyPasses(), and verifyPasses().
Verify that the input IR round-trips perfectly.
Definition at line 365 of file MlirOptMain.h.
Referenced by shouldVerifyRoundtrip(), and verifyRoundtrip().