MLIR 22.0.0git
Pass.cpp File Reference
#include "mlir/Pass/Pass.h"
#include "PassDetail.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/OpDefinition.h"
#include "mlir/IR/Threading.h"
#include "mlir/IR/Verifier.h"
#include "mlir/Support/FileUtilities.h"
#include "mlir/Support/IndentedOstream.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/DebugLog.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/Signals.h"
#include "llvm/Support/Threading.h"
#include <optional>

Go to the source code of this file.

Classes

struct  mlir::detail::OpPassManagerImpl
struct  mlir::detail::PassInstrumentorImpl

Namespaces

namespace  mlir
 Include the generated interface declarations.
namespace  mlir::detail
 AttrTypeReplacer.

Macros

#define DEBUG_TYPE   "pass-manager"

Functions

void printAsTextualPipeline (raw_indented_ostream &os, StringRef anchorName, const llvm::iterator_range< OpPassManager::pass_iterator > &passes, bool pretty=false)
 Prints out the passes of the pass manager as the textual representation of pipelines.
void printAsTextualPipeline (raw_ostream &os, StringRef anchorName, const llvm::iterator_range< OpPassManager::pass_iterator > &passes, bool pretty)
static void registerDialectsForPipeline (const OpPassManager &pm, DialectRegistry &dialects)
static OpPassManagerfindPassManagerWithAnchor (MutableArrayRef< OpPassManager > mgrs, StringRef name)
 Find an operation pass manager with the given anchor name, or nullptr if one does not exist.
static OpPassManagerfindPassManagerFor (MutableArrayRef< OpPassManager > mgrs, OperationName name, MLIRContext &context)
 Find an operation pass manager that can operate on an operation of the given type, or nullptr if one does not exist.
static bool hasSizeMismatch (ArrayRef< OpPassManager > lhs, ArrayRef< OpPassManager > rhs)
 Utility functor that checks if the two ranges of pass managers have a size mismatch.

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "pass-manager"

Definition at line 30 of file Pass.cpp.

Function Documentation

◆ findPassManagerFor()

OpPassManager * findPassManagerFor ( MutableArrayRef< OpPassManager > mgrs,
OperationName name,
MLIRContext & context )
static

Find an operation pass manager that can operate on an operation of the given type, or nullptr if one does not exist.

Definition at line 718 of file Pass.cpp.

References mlir::detail::OpPassManagerImpl::canScheduleOn(), and mlir::OpPassManager::getImpl().

◆ findPassManagerWithAnchor()

OpPassManager * findPassManagerWithAnchor ( MutableArrayRef< OpPassManager > mgrs,
StringRef name )
static

Find an operation pass manager with the given anchor name, or nullptr if one does not exist.

Definition at line 700 of file Pass.cpp.

References mlir::OpPassManager::getOpAnchorName().

Referenced by mlir::detail::OpToOpPassAdaptor::tryMergeInto().

◆ hasSizeMismatch()

bool hasSizeMismatch ( ArrayRef< OpPassManager > lhs,
ArrayRef< OpPassManager > rhs )
static

Utility functor that checks if the two ranges of pass managers have a size mismatch.

Definition at line 899 of file Pass.cpp.

References lhs, and rhs.

◆ printAsTextualPipeline() [1/2]

void printAsTextualPipeline ( raw_indented_ostream & os,
StringRef anchorName,
const llvm::iterator_range< OpPassManager::pass_iterator > & passes,
bool pretty = false )

Prints out the passes of the pass manager as the textual representation of pipelines.

When pretty is true, the printed pipeline is formatted for readability.

Definition at line 422 of file Pass.cpp.

References mlir::raw_indented_ostream::indent(), mlir::Pass::printAsTextualPipeline(), and mlir::raw_indented_ostream::unindent().

Referenced by mlir::makeReproducer(), and printAsTextualPipeline().

◆ printAsTextualPipeline() [2/2]

void printAsTextualPipeline ( raw_ostream & os,
StringRef anchorName,
const llvm::iterator_range< OpPassManager::pass_iterator > & passes,
bool pretty )

Definition at line 445 of file Pass.cpp.

References printAsTextualPipeline().

◆ registerDialectsForPipeline()

void registerDialectsForPipeline ( const OpPassManager & pm,
DialectRegistry & dialects )
static

Definition at line 468 of file Pass.cpp.

References mlir::OpPassManager::getPasses().

Referenced by mlir::OpPassManager::getDependentDialects().