My Project
Public Types | Public Member Functions | List of all members
mlir::PassManager::IRPrinterConfig Class Reference

A configuration struct provided to the IR printer instrumentation. More...

#include <PassManager.h>

Public Types

using PrintCallbackFn = function_ref< void(raw_ostream &)>
 

Public Member Functions

 IRPrinterConfig (bool printModuleScope=false, bool printAfterOnlyOnChange=false)
 Initialize the configuration. More...
 
virtual ~IRPrinterConfig ()
 
virtual void printBeforeIfEnabled (Pass *pass, Operation *operation, PrintCallbackFn printCallback)
 
virtual void printAfterIfEnabled (Pass *pass, Operation *operation, PrintCallbackFn printCallback)
 
bool shouldPrintAtModuleScope () const
 Returns true if the IR should always be printed at the top-level scope. More...
 
bool shouldPrintAfterOnlyOnChange () const
 

Detailed Description

A configuration struct provided to the IR printer instrumentation.

Member Typedef Documentation

◆ PrintCallbackFn

Constructor & Destructor Documentation

◆ IRPrinterConfig()

PassManager::IRPrinterConfig::IRPrinterConfig ( bool  printModuleScope = false,
bool  printAfterOnlyOnChange = false 
)
explicit

Initialize the configuration.

Initialize the configuration.

  • 'printModuleScope' signals if the top-level module IR should always be printed. This should only be set to true when multi-threading is disabled, otherwise we may try to print IR that is being modified asynchronously.
  • 'printAfterOnlyOnChange' signals that when printing the IR after a pass, in the case of a non-failure, we should first check if any potential mutations were made. This allows for reducing the number of logs that don't contain meaningful changes.

◆ ~IRPrinterConfig()

PassManager::IRPrinterConfig::~IRPrinterConfig ( )
virtual

Member Function Documentation

◆ printAfterIfEnabled()

void PassManager::IRPrinterConfig::printAfterIfEnabled ( Pass pass,
Operation operation,
PrintCallbackFn  printCallback 
)
virtual

A hook that may be overridden by a derived config that checks if the IR of 'operation' should be dumped after the pass 'pass' has been executed. If the IR should be dumped, 'printCallback' should be invoked with the stream to dump into.

◆ printBeforeIfEnabled()

void PassManager::IRPrinterConfig::printBeforeIfEnabled ( Pass pass,
Operation operation,
PrintCallbackFn  printCallback 
)
virtual

A hook that may be overridden by a derived config that checks if the IR of 'operation' should be dumped before the pass 'pass' has been executed. If the IR should be dumped, 'printCallback' should be invoked with the stream to dump into.

◆ shouldPrintAfterOnlyOnChange()

bool mlir::PassManager::IRPrinterConfig::shouldPrintAfterOnlyOnChange ( ) const
inline

Returns true if the IR should only printed after a pass if the IR "changed".

◆ shouldPrintAtModuleScope()

bool mlir::PassManager::IRPrinterConfig::shouldPrintAtModuleScope ( ) const
inline

Returns true if the IR should always be printed at the top-level scope.


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