MLIR 24.0.0git
mlir::MlirOptMainConfig Class Reference

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 & setEmitBytecodeDialectVersions (ArrayRef< std::string > versions)
 Set target dialect versions as strings of the form "dialect=version".
ArrayRef< std::string > bytecodeDialectVersionsToEmit () 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::vector< std::string > emitBytecodeDialectVersions
 Target dialect versions for bytecode emission, as "dialect=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).

Detailed Description

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 60 of file MlirOptMain.h.

Member Function Documentation

◆ allowUnregisteredDialects()

MlirOptMainConfig & mlir::MlirOptMainConfig::allowUnregisteredDialects ( bool allow)
inline

Options.

Allow operation with no registered dialects. This option is for convenience during testing only and discouraged in general.

Definition at line 75 of file MlirOptMain.h.

References allowUnregisteredDialectsFlag.

◆ bytecodeDialectVersionsToEmit()

ArrayRef< std::string > mlir::MlirOptMainConfig::bytecodeDialectVersionsToEmit ( ) const
inline

Definition at line 139 of file MlirOptMain.h.

References emitBytecodeDialectVersions.

Referenced by performActions().

◆ bytecodeProducerToEmit()

std::optional< StringRef > mlir::MlirOptMainConfig::bytecodeProducerToEmit ( ) const
inline

Definition at line 148 of file MlirOptMain.h.

References emitBytecodeProducerFlag.

Referenced by performActions().

◆ bytecodeVersionToEmit()

std::optional< int64_t > mlir::MlirOptMainConfig::bytecodeVersionToEmit ( ) const
inline

Definition at line 128 of file MlirOptMain.h.

References emitBytecodeVersion.

Referenced by performActions().

◆ createFromCLOptions()

MlirOptMainConfig MlirOptMainConfig::createFromCLOptions ( )
static

Create a new config with the default set from the CL options.

Definition at line 365 of file MlirOptMain.cpp.

References clOptionsConfig, and mlir::tracing::DebugConfig::createFromCLOptions().

◆ dumpPassPipeline()

MlirOptMainConfig & mlir::MlirOptMainConfig::dumpPassPipeline ( bool dump)
inline

Print the pass-pipeline as text before executing.

Definition at line 92 of file MlirOptMain.h.

References dumpPassPipelineFlag.

◆ emitBytecode()

MlirOptMainConfig & mlir::MlirOptMainConfig::emitBytecode ( bool emit)
inline

Set the output format to bytecode instead of textual IR.

Definition at line 104 of file MlirOptMain.h.

References emit(), and emitBytecodeFlag.

◆ emitBytecodeProducer()

MlirOptMainConfig & mlir::MlirOptMainConfig::emitBytecodeProducer ( StringRef producer)
inline

Set the bytecode producer to use.

Definition at line 144 of file MlirOptMain.h.

References emitBytecodeProducerFlag.

◆ getDebugConfig() [1/2]

tracing::DebugConfig & mlir::MlirOptMainConfig::getDebugConfig ( )
inline

Definition at line 88 of file MlirOptMain.h.

References debugConfig.

◆ getDebugConfig() [2/2]

const tracing::DebugConfig & mlir::MlirOptMainConfig::getDebugConfig ( ) const
inline

Definition at line 89 of file MlirOptMain.h.

References debugConfig.

◆ getDiagnosticVerbosityLevel()

VerbosityLevel mlir::MlirOptMainConfig::getDiagnosticVerbosityLevel ( ) const
inline

Definition at line 97 of file MlirOptMain.h.

References diagnosticVerbosityLevelFlag.

◆ getIrdlFile()

StringRef mlir::MlirOptMainConfig::getIrdlFile ( ) const
inline

Definition at line 121 of file MlirOptMain.h.

References irdlFileFlag.

Referenced by doVerifyRoundTrip().

◆ getRemarkFormat()

RemarkFormat mlir::MlirOptMainConfig::getRemarkFormat ( ) const
inline

Set the reproducer output filename.

Definition at line 272 of file MlirOptMain.h.

References remarkFormatFlag.

Referenced by performActions().

◆ getRemarkPolicy()

RemarkPolicy mlir::MlirOptMainConfig::getRemarkPolicy ( ) const
inline

Set the remark policy to use.

Definition at line 274 of file MlirOptMain.h.

References remarkPolicyFlag.

Referenced by performActions().

◆ getRemarksAllFilter()

std::string mlir::MlirOptMainConfig::getRemarksAllFilter ( ) const
inline

Set the remark format to use.

Definition at line 276 of file MlirOptMain.h.

References remarksAllFilterFlag.

Referenced by performActions(), and shouldEmitRemarks().

◆ getRemarksAnalyseFilter()

std::string mlir::MlirOptMainConfig::getRemarksAnalyseFilter ( ) const
inline

Set the remark analyse filters.

Definition at line 286 of file MlirOptMain.h.

References remarksAnalyseFilterFlag.

Referenced by performActions(), and shouldEmitRemarks().

◆ getRemarksFailedFilter()

std::string mlir::MlirOptMainConfig::getRemarksFailedFilter ( ) const
inline

Set the remark failed filters.

Definition at line 282 of file MlirOptMain.h.

References remarksFailedFilterFlag.

Referenced by performActions(), and shouldEmitRemarks().

◆ getRemarksMissedFilter()

std::string mlir::MlirOptMainConfig::getRemarksMissedFilter ( ) const
inline

Set the remark missed filters.

Definition at line 284 of file MlirOptMain.h.

References remarksMissedFilterFlag.

Referenced by performActions(), and shouldEmitRemarks().

◆ getRemarksOutputFile()

std::string mlir::MlirOptMainConfig::getRemarksOutputFile ( ) const
inline

Set the remark output file.

Definition at line 278 of file MlirOptMain.h.

References remarksOutputFileFlag.

Referenced by performActions().

◆ getRemarksPassedFilter()

std::string mlir::MlirOptMainConfig::getRemarksPassedFilter ( ) const
inline

Set the remark passed filters.

Definition at line 280 of file MlirOptMain.h.

References remarksPassedFilterFlag.

Referenced by performActions(), and shouldEmitRemarks().

◆ getReproducerFilename()

StringRef mlir::MlirOptMainConfig::getReproducerFilename ( ) const
inline

Reproducer file generation (no crash required).

Definition at line 269 of file MlirOptMain.h.

References generateReproducerFileFlag.

Referenced by performActions().

◆ inputSplitMarker()

StringRef mlir::MlirOptMainConfig::inputSplitMarker ( ) const
inline

Definition at line 202 of file MlirOptMain.h.

References splitInputFileFlag.

◆ listPasses()

MlirOptMainConfig & mlir::MlirOptMainConfig::listPasses ( bool list)
inline

List the registered passes and return.

Definition at line 172 of file MlirOptMain.h.

References listPassesFlag.

◆ outputSplitMarker() [1/2]

StringRef mlir::MlirOptMainConfig::outputSplitMarker ( ) const
inline

Definition at line 211 of file MlirOptMain.h.

References outputSplitMarkerFlag.

◆ outputSplitMarker() [2/2]

MlirOptMainConfig & mlir::MlirOptMainConfig::outputSplitMarker ( std::string splitMarker = kDefaultSplitMarker)
inline

Set whether to merge the output chunks into one file using the given marker.

Definition at line 207 of file MlirOptMain.h.

References mlir::kDefaultSplitMarker, and outputSplitMarkerFlag.

◆ registerCLOptions()

void MlirOptMainConfig::registerCLOptions ( DialectRegistry & dialectRegistry)
static

Register the options as global LLVM command line options.

Definition at line 360 of file MlirOptMain.cpp.

References clOptionsConfig, and mlir::tracing::DebugConfig::registerCLOptions().

◆ runReproducer()

MlirOptMainConfig & mlir::MlirOptMainConfig::runReproducer ( bool enableReproducer)
inline

Enable running the reproducer information stored in resources (if present).

Definition at line 180 of file MlirOptMain.h.

References runReproducerFlag.

◆ setDebugConfig()

MlirOptMainConfig & mlir::MlirOptMainConfig::setDebugConfig ( tracing::DebugConfig config)
inline

Set the debug configuration to use.

Definition at line 84 of file MlirOptMain.h.

References debugConfig.

◆ setEmitBytecodeDialectVersions()

MlirOptMainConfig & mlir::MlirOptMainConfig::setEmitBytecodeDialectVersions ( ArrayRef< std::string > versions)
inline

Set target dialect versions as strings of the form "dialect=version".

The dialect defines the syntax of its version string.

Definition at line 135 of file MlirOptMain.h.

References emitBytecodeDialectVersions.

◆ setEmitBytecodeVersion()

MlirOptMainConfig & mlir::MlirOptMainConfig::setEmitBytecodeVersion ( int64_t version)
inline

Set the bytecode version to emit.

Definition at line 124 of file MlirOptMain.h.

References emitBytecodeVersion.

◆ setIrdlFile()

MlirOptMainConfig & mlir::MlirOptMainConfig::setIrdlFile ( StringRef file)
inline

Set the IRDL file to load before processing the input.

Definition at line 117 of file MlirOptMain.h.

References irdlFileFlag.

◆ setPassPipelineParser()

MlirOptMainConfig & MlirOptMainConfig::setPassPipelineParser ( const PassPipelineCLParser & parser)

Set the parser to use to populate the pass manager.

Definition at line 370 of file MlirOptMain.cpp.

References mlir::PassPipelineCLParser::addToPipeline(), mlir::emitError(), passPipelineCallback, shouldDumpPassPipeline(), and success().

◆ setPassPipelineSetupFn()

MlirOptMainConfig & mlir::MlirOptMainConfig::setPassPipelineSetupFn ( std::function< LogicalResult(PassManager &)> callback)
inline

Set the callback to populate the pass manager.

Definition at line 156 of file MlirOptMain.h.

References passPipelineCallback.

◆ setupPassPipeline()

LogicalResult mlir::MlirOptMainConfig::setupPassPipeline ( PassManager & pm) const
inline

Populate the passmanager, if any callback was set.

Definition at line 165 of file MlirOptMain.h.

References passPipelineCallback, and success().

Referenced by performActions().

◆ shouldAllowUnregisteredDialects()

bool mlir::MlirOptMainConfig::shouldAllowUnregisteredDialects ( ) const
inline

Definition at line 79 of file MlirOptMain.h.

References allowUnregisteredDialectsFlag.

◆ shouldDumpPassPipeline()

bool mlir::MlirOptMainConfig::shouldDumpPassPipeline ( ) const
inline

Definition at line 101 of file MlirOptMain.h.

References dumpPassPipelineFlag.

Referenced by setPassPipelineParser().

◆ shouldElideResourceDataFromBytecode()

bool mlir::MlirOptMainConfig::shouldElideResourceDataFromBytecode ( ) const
inline

Definition at line 110 of file MlirOptMain.h.

References elideResourceDataFromBytecodeFlag.

◆ shouldEmitBytecode()

bool mlir::MlirOptMainConfig::shouldEmitBytecode ( ) const
inline

Definition at line 108 of file MlirOptMain.h.

References emitBytecodeFlag.

Referenced by performActions().

◆ shouldEmitRemarks()

bool mlir::MlirOptMainConfig::shouldEmitRemarks ( ) const
inline

Checks if any remark filters are set.

Definition at line 259 of file MlirOptMain.h.

References getRemarksAllFilter(), getRemarksAnalyseFilter(), getRemarksFailedFilter(), getRemarksMissedFilter(), and getRemarksPassedFilter().

◆ shouldListPasses()

bool mlir::MlirOptMainConfig::shouldListPasses ( ) const
inline

Definition at line 176 of file MlirOptMain.h.

References listPassesFlag.

◆ shouldRunReproducer()

bool mlir::MlirOptMainConfig::shouldRunReproducer ( ) const
inline

Return true if the reproducer should be run.

Definition at line 186 of file MlirOptMain.h.

References runReproducerFlag.

Referenced by performActions().

◆ shouldShowDialects()

bool mlir::MlirOptMainConfig::shouldShowDialects ( ) const
inline

Definition at line 193 of file MlirOptMain.h.

References showDialectsFlag.

◆ shouldShowNotes()

bool mlir::MlirOptMainConfig::shouldShowNotes ( ) const
inline

Definition at line 114 of file MlirOptMain.h.

References disableDiagnosticNotesFlag.

◆ shouldUseExplicitModule()

bool mlir::MlirOptMainConfig::shouldUseExplicitModule ( ) const
inline

Definition at line 218 of file MlirOptMain.h.

References useExplicitModuleFlag.

Referenced by performActions().

◆ shouldVerifyDiagnostics()

bool mlir::MlirOptMainConfig::shouldVerifyDiagnostics ( ) const
inline

◆ shouldVerifyOnParsing()

bool mlir::MlirOptMainConfig::shouldVerifyOnParsing ( ) const
inline

Definition at line 249 of file MlirOptMain.h.

References disableVerifierOnParsingFlag.

Referenced by doVerifyRoundTrip(), and performActions().

◆ shouldVerifyPasses()

bool mlir::MlirOptMainConfig::shouldVerifyPasses ( ) const
inline

Definition at line 242 of file MlirOptMain.h.

References verifyPassesFlag.

Referenced by performActions().

◆ shouldVerifyRoundtrip()

bool mlir::MlirOptMainConfig::shouldVerifyRoundtrip ( ) const
inline

Definition at line 256 of file MlirOptMain.h.

References verifyRoundtripFlag.

Referenced by performActions().

◆ showDialects()

MlirOptMainConfig & mlir::MlirOptMainConfig::showDialects ( bool show)
inline

Show the registered dialects before trying to load the input file.

Definition at line 189 of file MlirOptMain.h.

References showDialectsFlag.

◆ splitInputFile()

MlirOptMainConfig & mlir::MlirOptMainConfig::splitInputFile ( std::string splitMarker = kDefaultSplitMarker)
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 198 of file MlirOptMain.h.

References mlir::kDefaultSplitMarker, and splitInputFileFlag.

◆ useExplicitModule()

MlirOptMainConfig & mlir::MlirOptMainConfig::useExplicitModule ( bool useExplicitModule)
inline

Disable implicit addition of a top-level module op during parsing.

Definition at line 214 of file MlirOptMain.h.

References useExplicitModule(), and useExplicitModuleFlag.

Referenced by useExplicitModule().

◆ verifyDiagnostics()

MlirOptMainConfig & mlir::MlirOptMainConfig::verifyDiagnostics ( SourceMgrDiagnosticVerifierHandler::Level verify)
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 223 of file MlirOptMain.h.

References mlir::verify(), and verifyDiagnosticsFlag.

◆ verifyDiagnosticsLevel()

SourceMgrDiagnosticVerifierHandler::Level mlir::MlirOptMainConfig::verifyDiagnosticsLevel ( ) const
inline

Definition at line 233 of file MlirOptMain.h.

References verifyDiagnosticsFlag.

◆ verifyOnParsing()

MlirOptMainConfig & mlir::MlirOptMainConfig::verifyOnParsing ( bool verify)
inline

Set whether to run the verifier on parsing.

Definition at line 245 of file MlirOptMain.h.

References disableVerifierOnParsingFlag, and mlir::verify().

◆ verifyPasses()

MlirOptMainConfig & mlir::MlirOptMainConfig::verifyPasses ( bool verify)
inline

Set whether to run the verifier after each transformation pass.

Definition at line 238 of file MlirOptMain.h.

References mlir::verify(), and verifyPassesFlag.

◆ verifyRoundtrip()

MlirOptMainConfig & mlir::MlirOptMainConfig::verifyRoundtrip ( bool verify)
inline

Set whether to run the verifier after each transformation pass.

Definition at line 252 of file MlirOptMain.h.

References mlir::verify(), and verifyRoundtripFlag.

Member Data Documentation

◆ allowUnregisteredDialectsFlag

bool mlir::MlirOptMainConfig::allowUnregisteredDialectsFlag = false
protected

Allow operation with no registered dialects.

This option is for convenience during testing only and discouraged in general.

Definition at line 294 of file MlirOptMain.h.

Referenced by allowUnregisteredDialects(), and shouldAllowUnregisteredDialects().

◆ debugConfig

tracing::DebugConfig mlir::MlirOptMainConfig::debugConfig
protected

Configuration for the debugging hooks.

Definition at line 310 of file MlirOptMain.h.

Referenced by getDebugConfig(), getDebugConfig(), and setDebugConfig().

◆ diagnosticVerbosityLevelFlag

VerbosityLevel mlir::MlirOptMainConfig::diagnosticVerbosityLevelFlag
protected
Initial value:

Verbosity level of diagnostic information.

0: Errors only, 1: Errors and warnings, 2: Errors, warnings and remarks.

Definition at line 314 of file MlirOptMain.h.

Referenced by getDiagnosticVerbosityLevel().

◆ disableDiagnosticNotesFlag

bool mlir::MlirOptMainConfig::disableDiagnosticNotesFlag = true
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 356 of file MlirOptMain.h.

Referenced by shouldShowNotes().

◆ disableVerifierOnParsingFlag

bool mlir::MlirOptMainConfig::disableVerifierOnParsingFlag = false
protected

Disable the verifier on parsing.

Definition at line 377 of file MlirOptMain.h.

Referenced by shouldVerifyOnParsing(), and verifyOnParsing().

◆ dumpPassPipelineFlag

bool mlir::MlirOptMainConfig::dumpPassPipelineFlag = false
protected

Print the pipeline that will be run.

Definition at line 318 of file MlirOptMain.h.

Referenced by dumpPassPipeline(), and shouldDumpPassPipeline().

◆ elideResourceDataFromBytecodeFlag

bool mlir::MlirOptMainConfig::elideResourceDataFromBytecodeFlag = false
protected

Elide resources when generating bytecode.

Definition at line 324 of file MlirOptMain.h.

Referenced by shouldElideResourceDataFromBytecode().

◆ emitBytecodeDialectVersions

std::vector<std::string> mlir::MlirOptMainConfig::emitBytecodeDialectVersions
protected

Target dialect versions for bytecode emission, as "dialect=version".

Definition at line 336 of file MlirOptMain.h.

Referenced by bytecodeDialectVersionsToEmit(), and setEmitBytecodeDialectVersions().

◆ emitBytecodeFlag

bool mlir::MlirOptMainConfig::emitBytecodeFlag = false
protected

Emit bytecode instead of textual assembly when generating output.

Definition at line 321 of file MlirOptMain.h.

Referenced by emitBytecode(), and shouldEmitBytecode().

◆ emitBytecodeProducerFlag

std::string mlir::MlirOptMainConfig::emitBytecodeProducerFlag = ""
protected

Emit bytecode with given producer.

Definition at line 339 of file MlirOptMain.h.

Referenced by bytecodeProducerToEmit(), and emitBytecodeProducer().

◆ emitBytecodeVersion

std::optional<int64_t> mlir::MlirOptMainConfig::emitBytecodeVersion = std::nullopt
protected

Emit bytecode at given version.

Definition at line 333 of file MlirOptMain.h.

Referenced by bytecodeVersionToEmit(), and setEmitBytecodeVersion().

◆ generateReproducerFileFlag

std::string mlir::MlirOptMainConfig::generateReproducerFileFlag = ""
protected

The reproducer output filename (no crash required).

Definition at line 383 of file MlirOptMain.h.

Referenced by getReproducerFilename().

◆ irdlFileFlag

std::string mlir::MlirOptMainConfig::irdlFileFlag = ""
protected

IRDL file to register before processing the input.

Definition at line 327 of file MlirOptMain.h.

Referenced by getIrdlFile(), and setIrdlFile().

◆ listPassesFlag

bool mlir::MlirOptMainConfig::listPassesFlag = false
protected

List the registered passes and return.

Definition at line 345 of file MlirOptMain.h.

Referenced by listPasses(), and shouldListPasses().

◆ logActionLocationFilter

std::vector<tracing::BreakpointManager *> mlir::MlirOptMainConfig::logActionLocationFilter
protected

Location Breakpoints to filter the action logging.

Definition at line 330 of file MlirOptMain.h.

◆ outputSplitMarkerFlag

std::string mlir::MlirOptMainConfig::outputSplitMarkerFlag = ""
protected

Merge output chunks into one file using the given marker.

Definition at line 363 of file MlirOptMain.h.

Referenced by outputSplitMarker(), and outputSplitMarker().

◆ passPipelineCallback

std::function<LogicalResult(PassManager &)> mlir::MlirOptMainConfig::passPipelineCallback
protected

The callback to populate the pass manager.

Definition at line 342 of file MlirOptMain.h.

Referenced by setPassPipelineParser(), setPassPipelineSetupFn(), and setupPassPipeline().

◆ remarkFormatFlag

RemarkFormat mlir::MlirOptMainConfig::remarkFormatFlag = RemarkFormat::REMARK_FORMAT_STDOUT
protected

Remark format.

Definition at line 297 of file MlirOptMain.h.

Referenced by getRemarkFormat().

◆ remarkPolicyFlag

RemarkPolicy mlir::MlirOptMainConfig::remarkPolicyFlag = RemarkPolicy::REMARK_POLICY_ALL
protected

Remark policy.

Definition at line 299 of file MlirOptMain.h.

Referenced by getRemarkPolicy().

◆ remarksAllFilterFlag

std::string mlir::MlirOptMainConfig::remarksAllFilterFlag = ""
protected

Remark filters.

Definition at line 303 of file MlirOptMain.h.

Referenced by getRemarksAllFilter().

◆ remarksAnalyseFilterFlag

std::string mlir::MlirOptMainConfig::remarksAnalyseFilterFlag = ""
protected

Definition at line 307 of file MlirOptMain.h.

Referenced by getRemarksAnalyseFilter().

◆ remarksFailedFilterFlag

std::string mlir::MlirOptMainConfig::remarksFailedFilterFlag = ""
protected

Definition at line 305 of file MlirOptMain.h.

Referenced by getRemarksFailedFilter().

◆ remarksMissedFilterFlag

std::string mlir::MlirOptMainConfig::remarksMissedFilterFlag = ""
protected

Definition at line 306 of file MlirOptMain.h.

Referenced by getRemarksMissedFilter().

◆ remarksOutputFileFlag

std::string mlir::MlirOptMainConfig::remarksOutputFileFlag = ""
protected

Remark file to output to.

Definition at line 301 of file MlirOptMain.h.

Referenced by getRemarksOutputFile().

◆ remarksPassedFilterFlag

std::string mlir::MlirOptMainConfig::remarksPassedFilterFlag = ""
protected

Definition at line 304 of file MlirOptMain.h.

Referenced by getRemarksPassedFilter().

◆ runReproducerFlag

bool mlir::MlirOptMainConfig::runReproducerFlag = false
protected

Enable running the reproducer.

Definition at line 348 of file MlirOptMain.h.

Referenced by runReproducer(), and shouldRunReproducer().

◆ showDialectsFlag

bool mlir::MlirOptMainConfig::showDialectsFlag = false
protected

Show the registered dialects before trying to load the input file.

Definition at line 351 of file MlirOptMain.h.

Referenced by shouldShowDialects(), and showDialects().

◆ splitInputFileFlag

std::string mlir::MlirOptMainConfig::splitInputFileFlag = ""
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 360 of file MlirOptMain.h.

Referenced by inputSplitMarker(), and splitInputFile().

◆ useExplicitModuleFlag

bool mlir::MlirOptMainConfig::useExplicitModuleFlag = false
protected

Use an explicit top-level module op during parsing.

Definition at line 366 of file MlirOptMain.h.

Referenced by shouldUseExplicitModule(), and useExplicitModule().

◆ verifyDiagnosticsFlag

SourceMgrDiagnosticVerifierHandler::Level mlir::MlirOptMainConfig::verifyDiagnosticsFlag
protected
Initial value:

Set whether to check that emitted diagnostics match expected-* lines on the corresponding line.

This is meant for implementing diagnostic tests.

Definition at line 370 of file MlirOptMain.h.

Referenced by shouldVerifyDiagnostics(), verifyDiagnostics(), and verifyDiagnosticsLevel().

◆ verifyPassesFlag

bool mlir::MlirOptMainConfig::verifyPassesFlag = true
protected

Run the verifier after each transformation pass.

Definition at line 374 of file MlirOptMain.h.

Referenced by shouldVerifyPasses(), and verifyPasses().

◆ verifyRoundtripFlag

bool mlir::MlirOptMainConfig::verifyRoundtripFlag = false
protected

Verify that the input IR round-trips perfectly.

Definition at line 380 of file MlirOptMain.h.

Referenced by shouldVerifyRoundtrip(), and verifyRoundtrip().


The documentation for this class was generated from the following files: