MLIR
21.0.0git
|
Set of flags used to control the behavior of the various IR print methods (e.g. More...
#include "mlir/IR/OperationSupport.h"
Public Member Functions | |
OpPrintingFlags () | |
Initialize the printing flags with default supplied by the cl::opts above. More... | |
OpPrintingFlags (std::nullopt_t) | |
OpPrintingFlags & | elideLargeElementsAttrs (int64_t largeElementLimit=16) |
Enables the elision of large elements attributes by printing a lexically valid but otherwise meaningless form instead of the element data. More... | |
OpPrintingFlags & | printLargeElementsAttrWithHex (int64_t largeElementLimit=100) |
Enables the printing of large element attributes with a hex string. More... | |
OpPrintingFlags & | elideLargeResourceString (int64_t largeResourceLimit=64) |
Enables the elision of large resources strings by omitting them from the dialect_resources section. More... | |
OpPrintingFlags & | enableDebugInfo (bool enable=true, bool prettyForm=false) |
Enable or disable printing of debug information (based on enable ). More... | |
OpPrintingFlags & | printGenericOpForm (bool enable=true) |
Always print operations in the generic form. More... | |
OpPrintingFlags & | skipRegions (bool skip=true) |
Skip printing regions. More... | |
OpPrintingFlags & | assumeVerified (bool enable=true) |
Do not verify the operation when using custom operation printers. More... | |
OpPrintingFlags & | useLocalScope (bool enable=true) |
Use local scope when printing the operation. More... | |
OpPrintingFlags & | printValueUsers (bool enable=true) |
Print users of values as comments. More... | |
OpPrintingFlags & | printUniqueSSAIDs (bool enable=true) |
Print unique SSA ID numbers for values, block arguments and naming conflicts across all regions. More... | |
OpPrintingFlags & | printNameLocAsPrefix (bool enable=true) |
Print SSA IDs using their NameLoc, if provided, as prefix. More... | |
bool | shouldElideElementsAttr (ElementsAttr attr) const |
Return if the given ElementsAttr should be elided. More... | |
bool | shouldPrintElementsAttrWithHex (ElementsAttr attr) const |
Return if the given ElementsAttr should be printed as hex string. More... | |
std::optional< int64_t > | getLargeElementsAttrLimit () const |
Return the size limit for printing large ElementsAttr. More... | |
int64_t | getLargeElementsAttrHexLimit () const |
Return the size limit for printing large ElementsAttr as hex string. More... | |
std::optional< uint64_t > | getLargeResourceStringLimit () const |
Return the size limit in chars for printing large resources. More... | |
bool | shouldPrintDebugInfo () const |
Return if debug information should be printed. More... | |
bool | shouldPrintDebugInfoPrettyForm () const |
Return if debug information should be printed in the pretty form. More... | |
bool | shouldPrintGenericOpForm () const |
Return if operations should be printed in the generic form. More... | |
bool | shouldSkipRegions () const |
Return if regions should be skipped. More... | |
bool | shouldAssumeVerified () const |
Return if operation verification should be skipped. More... | |
bool | shouldUseLocalScope () const |
Return if the printer should use local scope when dumping the IR. More... | |
bool | shouldPrintValueUsers () const |
Return if the printer should print users of values. More... | |
bool | shouldPrintUniqueSSAIDs () const |
Return if printer should use unique SSA IDs. More... | |
bool | shouldUseNameLocAsPrefix () const |
Return if the printer should use NameLocs as prefixes when printing SSA IDs. More... | |
Set of flags used to control the behavior of the various IR print methods (e.g.
Operation::Print).
Definition at line 1175 of file OperationSupport.h.
OpPrintingFlags::OpPrintingFlags | ( | ) |
Initialize the printing flags with default supplied by the cl::opts above.
Definition at line 218 of file AsmPrinter.cpp.
References clOptions.
|
inline |
Definition at line 1178 of file OperationSupport.h.
OpPrintingFlags & OpPrintingFlags::assumeVerified | ( | bool | enable = true | ) |
Do not verify the operation when using custom operation printers.
Definition at line 289 of file AsmPrinter.cpp.
OpPrintingFlags & OpPrintingFlags::elideLargeElementsAttrs | ( | int64_t | largeElementLimit = 16 | ) |
Enables the elision of large elements attributes by printing a lexically valid but otherwise meaningless form instead of the element data.
Enable the elision of large elements attributes, by printing a '...' instead of the element data, when the number of elements is greater than largeElementLimit
.
The largeElementLimit
is used to configure what is considered to be a "large" ElementsAttr by providing an upper limit to the number of elements.
Note: The IR generated with this option is not parsable.
Definition at line 250 of file AsmPrinter.cpp.
Referenced by adjustPrintingFlags().
OpPrintingFlags & OpPrintingFlags::elideLargeResourceString | ( | int64_t | largeResourceLimit = 64 | ) |
Enables the elision of large resources strings by omitting them from the dialect_resources
section.
The largeResourceLimit
is used to configure what is considered to be a "large" resource by providing an upper limit to the string size.
Definition at line 262 of file AsmPrinter.cpp.
OpPrintingFlags & OpPrintingFlags::enableDebugInfo | ( | bool | enable = true , |
bool | prettyForm = false |
||
) |
Enable or disable printing of debug information (based on enable
).
Enable printing of debug information.
If 'prettyForm' is set to true, debug information is printed in a more readable 'pretty' form. Note: The IR generated with 'prettyForm' is not parsable.
If 'prettyForm' is set to true, debug information is printed in a more readable 'pretty' form.
Definition at line 269 of file AsmPrinter.cpp.
int64_t OpPrintingFlags::getLargeElementsAttrHexLimit | ( | ) | const |
Return the size limit for printing large ElementsAttr as hex string.
Definition at line 341 of file AsmPrinter.cpp.
std::optional< int64_t > OpPrintingFlags::getLargeElementsAttrLimit | ( | ) | const |
Return the size limit for printing large ElementsAttr.
Definition at line 336 of file AsmPrinter.cpp.
std::optional< uint64_t > OpPrintingFlags::getLargeResourceStringLimit | ( | ) | const |
Return the size limit in chars for printing large resources.
Return the size limit for printing large ElementsAttr.
Definition at line 346 of file AsmPrinter.cpp.
OpPrintingFlags & OpPrintingFlags::printGenericOpForm | ( | bool | enable = true | ) |
Always print operations in the generic form.
Definition at line 277 of file AsmPrinter.cpp.
Referenced by adjustPrintingFlags().
OpPrintingFlags & OpPrintingFlags::printLargeElementsAttrWithHex | ( | int64_t | largeElementLimit = 100 | ) |
Enables the printing of large element attributes with a hex string.
The largeElementLimit
is used to configure what is considered to be a "large" ElementsAttr by providing an upper limit to the number of elements. Use -1 to disable the hex printing.
Definition at line 256 of file AsmPrinter.cpp.
OpPrintingFlags & OpPrintingFlags::printNameLocAsPrefix | ( | bool | enable = true | ) |
Print SSA IDs using their NameLoc, if provided, as prefix.
Definition at line 330 of file AsmPrinter.cpp.
OpPrintingFlags & OpPrintingFlags::printUniqueSSAIDs | ( | bool | enable = true | ) |
Print unique SSA ID numbers for values, block arguments and naming conflicts across all regions.
Definition at line 310 of file AsmPrinter.cpp.
OpPrintingFlags & OpPrintingFlags::printValueUsers | ( | bool | enable = true | ) |
Print users of values as comments.
Definition at line 303 of file AsmPrinter.cpp.
bool OpPrintingFlags::shouldAssumeVerified | ( | ) | const |
Return if operation verification should be skipped.
Definition at line 369 of file AsmPrinter.cpp.
Referenced by verifyOpAndAdjustFlags().
bool OpPrintingFlags::shouldElideElementsAttr | ( | ElementsAttr | attr | ) | const |
Return if the given ElementsAttr should be elided.
Definition at line 316 of file AsmPrinter.cpp.
bool OpPrintingFlags::shouldPrintDebugInfo | ( | ) | const |
Return if debug information should be printed.
Definition at line 351 of file AsmPrinter.cpp.
Referenced by mlir::AsmPrinter::Impl::printTrailingLocation().
bool OpPrintingFlags::shouldPrintDebugInfoPrettyForm | ( | ) | const |
Return if debug information should be printed in the pretty form.
Definition at line 356 of file AsmPrinter.cpp.
Referenced by mlir::AsmPrinter::Impl::printLocation().
bool OpPrintingFlags::shouldPrintElementsAttrWithHex | ( | ElementsAttr | attr | ) | const |
Return if the given ElementsAttr should be printed as hex string.
Definition at line 323 of file AsmPrinter.cpp.
bool OpPrintingFlags::shouldPrintGenericOpForm | ( | ) | const |
Return if operations should be printed in the generic form.
Definition at line 361 of file AsmPrinter.cpp.
Referenced by shouldPrintUniqueSSAIDs(), and verifyOpAndAdjustFlags().
bool OpPrintingFlags::shouldPrintUniqueSSAIDs | ( | ) | const |
Return if printer should use unique SSA IDs.
Return if the printer should use unique IDs.
Definition at line 382 of file AsmPrinter.cpp.
References shouldPrintGenericOpForm().
bool OpPrintingFlags::shouldPrintValueUsers | ( | ) | const |
Return if the printer should print users of values.
Definition at line 377 of file AsmPrinter.cpp.
bool OpPrintingFlags::shouldSkipRegions | ( | ) | const |
Return if regions should be skipped.
Return if Region should be skipped.
Definition at line 366 of file AsmPrinter.cpp.
Referenced by printBlock().
bool OpPrintingFlags::shouldUseLocalScope | ( | ) | const |
Return if the printer should use local scope when dumping the IR.
Definition at line 374 of file AsmPrinter.cpp.
Referenced by mlir::Operation::print(), and mlir::Value::printAsOperand().
bool OpPrintingFlags::shouldUseNameLocAsPrefix | ( | ) | const |
Return if the printer should use NameLocs as prefixes when printing SSA IDs.
Definition at line 387 of file AsmPrinter.cpp.
OpPrintingFlags & OpPrintingFlags::skipRegions | ( | bool | skip = true | ) |
Skip printing regions.
Always skip Regions.
Definition at line 283 of file AsmPrinter.cpp.
Referenced by printBlock().
OpPrintingFlags & OpPrintingFlags::useLocalScope | ( | bool | enable = true | ) |
Use local scope when printing the operation.
This allows for using the printer in a more localized and thread-safe setting, but may not necessarily be identical to what the IR will look like when dumping the full module.
This allows for using the printer in a more localized and thread-safe setting, but may not necessarily be identical of what the IR will look like when dumping the full module.
Definition at line 297 of file AsmPrinter.cpp.
Referenced by adjustPrintingFlags(), mlir::operator<<(), and printIR().