MLIR  14.0.0git
Public Member Functions | List of all members
mlir::OpPrintingFlags Class Reference

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 (llvm::NoneType)
 
OpPrintingFlagselideLargeElementsAttrs (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...
 
OpPrintingFlagsenableDebugInfo (bool prettyForm=false)
 Enable printing of debug information. More...
 
OpPrintingFlagsprintGenericOpForm ()
 Always print operations in the generic form. More...
 
OpPrintingFlagsuseLocalScope ()
 Use local scope when printing the operation. More...
 
bool shouldElideElementsAttr (ElementsAttr attr) const
 Return if the given ElementsAttr should be elided. More...
 
Optional< int64_t > getLargeElementsAttrLimit () const
 Return the size limit for printing large ElementsAttr. 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 shouldUseLocalScope () const
 Return if the printer should use local scope when dumping the IR. More...
 

Detailed Description

Set of flags used to control the behavior of the various IR print methods (e.g.

Operation::Print).

Definition at line 700 of file OperationSupport.h.

Constructor & Destructor Documentation

◆ OpPrintingFlags() [1/2]

OpPrintingFlags::OpPrintingFlags ( )

Initialize the printing flags with default supplied by the cl::opts above.

Definition at line 161 of file AsmPrinter.cpp.

References clOptions.

◆ OpPrintingFlags() [2/2]

mlir::OpPrintingFlags::OpPrintingFlags ( llvm::NoneType  )
inline

Definition at line 703 of file OperationSupport.h.

Member Function Documentation

◆ elideLargeElementsAttrs()

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 180 of file AsmPrinter.cpp.

◆ enableDebugInfo()

OpPrintingFlags & OpPrintingFlags::enableDebugInfo ( bool  prettyForm = false)

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 187 of file AsmPrinter.cpp.

◆ getLargeElementsAttrLimit()

Optional< int64_t > OpPrintingFlags::getLargeElementsAttrLimit ( ) const

Return the size limit for printing large ElementsAttr.

Definition at line 215 of file AsmPrinter.cpp.

◆ printGenericOpForm()

OpPrintingFlags & OpPrintingFlags::printGenericOpForm ( )

Always print operations in the generic form.

Definition at line 194 of file AsmPrinter.cpp.

Referenced by mlir::ConversionPattern::matchAndRewrite(), and printIR().

◆ shouldElideElementsAttr()

bool OpPrintingFlags::shouldElideElementsAttr ( ElementsAttr  attr) const

Return if the given ElementsAttr should be elided.

Definition at line 208 of file AsmPrinter.cpp.

◆ shouldPrintDebugInfo()

bool OpPrintingFlags::shouldPrintDebugInfo ( ) const

Return if debug information should be printed.

Definition at line 220 of file AsmPrinter.cpp.

Referenced by mlir::AsmPrinter::Impl::printTrailingLocation(), and shouldPrintElementsAttrWithHex().

◆ shouldPrintDebugInfoPrettyForm()

bool OpPrintingFlags::shouldPrintDebugInfoPrettyForm ( ) const

Return if debug information should be printed in the pretty form.

Definition at line 225 of file AsmPrinter.cpp.

Referenced by mlir::AsmPrinter::Impl::printLocation().

◆ shouldPrintGenericOpForm()

bool OpPrintingFlags::shouldPrintGenericOpForm ( ) const

Return if operations should be printed in the generic form.

Definition at line 230 of file AsmPrinter.cpp.

Referenced by mlir::AsmPrinter::Impl::printIntegerSet(), and shouldPrintElementsAttrWithHex().

◆ shouldUseLocalScope()

bool OpPrintingFlags::shouldUseLocalScope ( ) const

Return if the printer should use local scope when dumping the IR.

Definition at line 235 of file AsmPrinter.cpp.

Referenced by mlir::Operation::print().

◆ useLocalScope()

OpPrintingFlags & OpPrintingFlags::useLocalScope ( )

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 202 of file AsmPrinter.cpp.

Referenced by mlir::operator<<(), and printIR().


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