MLIR  19.0.0git
Classes | Namespaces | Macros | Functions | Variables
PassRegistry.cpp File Reference
#include "mlir/Pass/PassRegistry.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Pass/PassManager.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/ScopeExit.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
#include "llvm/Support/MemoryBuffer.h"
#include "llvm/Support/SourceMgr.h"
#include <optional>
#include <utility>

Go to the source code of this file.

Classes

struct  llvm::cl::OptionValue< PassArgData >
 Define a valid OptionValue for the command line pass argument. More...
 
struct  mlir::detail::PassPipelineCLParserImpl
 

Namespaces

 llvm
 Include the generated interface declarations.
 
 llvm::cl
 
 mlir
 Include the generated interface declarations.
 
 mlir::detail
 Detect if any of the given parameter types has a sub-element handler.
 

Macros

#define PASS_PIPELINE_ARG   "pass-pipeline"
 The name for the command line option used for parsing the textual pass pipeline. More...
 

Functions

static PassRegistryFunction buildDefaultRegistryFn (const PassAllocatorFunction &allocator)
 Utility to create a default registry function from a pass instance. More...
 
static void printOptionHelp (StringRef arg, StringRef desc, size_t indent, size_t descIndent, bool isTopLevel)
 Utility to print the help string for a specific option. More...
 
static std::tuple< StringRef, StringRef, StringRef > parseNextArg (StringRef options)
 Parse in the next argument from the given options string. More...
 

Variables

static llvm::ManagedStatic< llvm::StringMap< PassInfo > > passRegistry
 Static mapping of all of the registered passes. More...
 
static llvm::ManagedStatic< llvm::StringMap< TypeID > > passRegistryTypeIDs
 A mapping of the above pass registry entries to the corresponding TypeID of the pass that they generate. More...
 
static llvm::ManagedStatic< llvm::StringMap< PassPipelineInfo > > passPipelineRegistry
 Static mapping of all of the registered pass pipelines. More...
 

Macro Definition Documentation

◆ PASS_PIPELINE_ARG

#define PASS_PIPELINE_ARG   "pass-pipeline"

The name for the command line option used for parsing the textual pass pipeline.

Definition at line 784 of file PassRegistry.cpp.

Function Documentation

◆ buildDefaultRegistryFn()

static PassRegistryFunction buildDefaultRegistryFn ( const PassAllocatorFunction allocator)
static

Utility to create a default registry function from a pass instance.

Definition at line 39 of file PassRegistry.cpp.

References mlir::OpPassManager::addPass(), mlir::OpPassManager::Explicit, mlir::OpPassManager::getNesting(), mlir::OpPassManager::getOpAnchorName(), mlir::OpPassManager::getOpName(), and options.

◆ parseNextArg()

static std::tuple<StringRef, StringRef, StringRef> parseNextArg ( StringRef  options)
static

Parse in the next argument from the given options string.

Returns a tuple containing [the key of the option, the value of the option, updated options string pointing after the parsed option].

Definition at line 215 of file PassRegistry.cpp.

References options.

Referenced by mlir::detail::PassOptions::parseFromString().

◆ printOptionHelp()

static void printOptionHelp ( StringRef  arg,
StringRef  desc,
size_t  indent,
size_t  descIndent,
bool  isTopLevel 
)
static

Utility to print the help string for a specific option.

Definition at line 60 of file PassRegistry.cpp.

Referenced by mlir::PassRegistryEntry::printHelpStr().

Variable Documentation

◆ passPipelineRegistry

llvm::ManagedStatic<llvm::StringMap<PassPipelineInfo> > passPipelineRegistry
static

Static mapping of all of the registered pass pipelines.

Definition at line 35 of file PassRegistry.cpp.

Referenced by mlir::PassPipelineInfo::lookup().

◆ passRegistry

llvm::ManagedStatic<llvm::StringMap<PassInfo> > passRegistry
static

Static mapping of all of the registered passes.

Definition at line 27 of file PassRegistry.cpp.

Referenced by mlir::PassInfo::lookup(), and mlir::registerPass().

◆ passRegistryTypeIDs

llvm::ManagedStatic<llvm::StringMap<TypeID> > passRegistryTypeIDs
static

A mapping of the above pass registry entries to the corresponding TypeID of the pass that they generate.

Definition at line 31 of file PassRegistry.cpp.

Referenced by mlir::registerPass().