MLIR  17.0.0git
Public Member Functions | Public Attributes | List of all members
mlir::MLIRContextImpl Class Reference

This is the implementation of the MLIRContext class, using the pImpl idiom. More...

+ Collaboration diagram for mlir::MLIRContextImpl:

Public Member Functions

 MLIRContextImpl (bool threadingIsEnabled)
 
 ~MLIRContextImpl ()
 

Public Attributes

DebugActionManager debugActionManager
 An action manager for use within the context. More...
 
DiagnosticEngine diagEngine
 
bool allowUnregisteredDialects = false
 In most cases, creating operation in unregistered dialect is not desired and indicate a misconfiguration of the compiler. More...
 
bool threadingIsEnabled = true
 Enable support for multi-threading within MLIR. More...
 
std::atomic< int > multiThreadedExecutionContext {0}
 Track if we are currently executing in a threaded execution environment (like the pass-manager): this is only a debugging feature to help reducing the chances of data races one some context APIs. More...
 
bool printOpOnDiagnostic = true
 If the operation should be attached to diagnostics printed via the Operation::emit methods. More...
 
bool printStackTraceOnDiagnostic = false
 If the current stack trace should be attached when emitting diagnostics. More...
 
llvm::ThreadPool * threadPool = nullptr
 This points to the ThreadPool used when processing MLIR tasks in parallel. More...
 
std::unique_ptr< llvm::ThreadPool > ownedThreadPool
 In case where the thread pool is owned by the context, this ensures destruction with the context. More...
 
DenseMap< StringRef, std::unique_ptr< Dialect > > loadedDialects
 This is a list of dialects that are created referring to this context. More...
 
DialectRegistry dialectsRegistry
 
llvm::BumpPtrAllocator abstractDialectSymbolAllocator
 An allocator used for AbstractAttribute and AbstractType objects. More...
 
llvm::StringMap< std::unique_ptr< OperationName::Impl > > operations
 This is a mapping from operation name to the operation info describing it. More...
 
llvm::StringMap< RegisteredOperationNameregisteredOperations
 A vector of operation info specifically for registered operations. More...
 
SmallVector< RegisteredOperationName, 0 > sortedRegisteredOperations
 This is a sorted container of registered operations for a deterministic and efficient getRegisteredOperations implementation. More...
 
llvm::sys::SmartRWMutex< true > operationInfoMutex
 A mutex used when accessing operation information. More...
 
StorageUniquer affineUniquer
 
DenseMap< TypeID, AbstractType * > registeredTypes
 
StorageUniquer typeUniquer
 
Float8E5M2Type f8E5M2Ty
 Cached Type Instances. More...
 
Float8E4M3FNType f8E4M3FNTy
 
BFloat16Type bf16Ty
 
Float16Type f16Ty
 
Float32Type f32Ty
 
Float64Type f64Ty
 
Float80Type f80Ty
 
Float128Type f128Ty
 
IndexType indexTy
 
IntegerType int1Ty
 
IntegerType int8Ty
 
IntegerType int16Ty
 
IntegerType int32Ty
 
IntegerType int64Ty
 
IntegerType int128Ty
 
NoneType noneType
 
DenseMap< TypeID, AbstractAttribute * > registeredAttributes
 
StorageUniquer attributeUniquer
 
BoolAttr falseAttr
 Cached Attribute Instances. More...
 
BoolAttr trueAttr
 
UnitAttr unitAttr
 
UnknownLoc unknownLocAttr
 
DictionaryAttr emptyDictionaryAttr
 
StringAttr emptyStringAttr
 
llvm::sys::SmartMutex< true > dialectRefStrAttrMutex
 Map of string attributes that may reference a dialect, that are awaiting that dialect to be loaded. More...
 
DenseMap< StringRef, SmallVector< StringAttrStorage * > > dialectReferencingStrAttrs
 

Detailed Description

This is the implementation of the MLIRContext class, using the pImpl idiom.

This class is completely private to this file, so everything is public.

Definition at line 120 of file MLIRContext.cpp.

Constructor & Destructor Documentation

◆ MLIRContextImpl()

mlir::MLIRContextImpl::MLIRContextImpl ( bool  threadingIsEnabled)
inline

Definition at line 243 of file MLIRContext.cpp.

◆ ~MLIRContextImpl()

mlir::MLIRContextImpl::~MLIRContextImpl ( )
inline

Definition at line 250 of file MLIRContext.cpp.

Member Data Documentation

◆ abstractDialectSymbolAllocator

llvm::BumpPtrAllocator mlir::MLIRContextImpl::abstractDialectSymbolAllocator

An allocator used for AbstractAttribute and AbstractType objects.

Definition at line 180 of file MLIRContext.cpp.

◆ affineUniquer

StorageUniquer mlir::MLIRContextImpl::affineUniquer

Definition at line 200 of file MLIRContext.cpp.

◆ allowUnregisteredDialects

bool mlir::MLIRContextImpl::allowUnregisteredDialects = false

In most cases, creating operation in unregistered dialect is not desired and indicate a misconfiguration of the compiler.

This option enables to detect such use cases

Definition at line 141 of file MLIRContext.cpp.

◆ attributeUniquer

StorageUniquer mlir::MLIRContextImpl::attributeUniquer

Definition at line 227 of file MLIRContext.cpp.

◆ bf16Ty

BFloat16Type mlir::MLIRContextImpl::bf16Ty

Definition at line 212 of file MLIRContext.cpp.

◆ debugActionManager

DebugActionManager mlir::MLIRContextImpl::debugActionManager

An action manager for use within the context.

Definition at line 127 of file MLIRContext.cpp.

Referenced by mlir::MLIRContext::getDebugActionManager().

◆ diagEngine

DiagnosticEngine mlir::MLIRContextImpl::diagEngine

Definition at line 132 of file MLIRContext.cpp.

Referenced by mlir::MLIRContext::getDiagEngine().

◆ dialectReferencingStrAttrs

DenseMap<StringRef, SmallVector<StringAttrStorage *> > mlir::MLIRContextImpl::dialectReferencingStrAttrs

Definition at line 240 of file MLIRContext.cpp.

◆ dialectRefStrAttrMutex

llvm::sys::SmartMutex<true> mlir::MLIRContextImpl::dialectRefStrAttrMutex

Map of string attributes that may reference a dialect, that are awaiting that dialect to be loaded.

Definition at line 238 of file MLIRContext.cpp.

◆ dialectsRegistry

DialectRegistry mlir::MLIRContextImpl::dialectsRegistry

Definition at line 177 of file MLIRContext.cpp.

◆ emptyDictionaryAttr

DictionaryAttr mlir::MLIRContextImpl::emptyDictionaryAttr

Definition at line 233 of file MLIRContext.cpp.

◆ emptyStringAttr

StringAttr mlir::MLIRContextImpl::emptyStringAttr

Definition at line 234 of file MLIRContext.cpp.

◆ f128Ty

Float128Type mlir::MLIRContextImpl::f128Ty

Definition at line 217 of file MLIRContext.cpp.

◆ f16Ty

Float16Type mlir::MLIRContextImpl::f16Ty

Definition at line 213 of file MLIRContext.cpp.

◆ f32Ty

Float32Type mlir::MLIRContextImpl::f32Ty

Definition at line 214 of file MLIRContext.cpp.

◆ f64Ty

Float64Type mlir::MLIRContextImpl::f64Ty

Definition at line 215 of file MLIRContext.cpp.

◆ f80Ty

Float80Type mlir::MLIRContextImpl::f80Ty

Definition at line 216 of file MLIRContext.cpp.

◆ f8E4M3FNTy

Float8E4M3FNType mlir::MLIRContextImpl::f8E4M3FNTy

Definition at line 211 of file MLIRContext.cpp.

◆ f8E5M2Ty

Float8E5M2Type mlir::MLIRContextImpl::f8E5M2Ty

Cached Type Instances.

Definition at line 210 of file MLIRContext.cpp.

◆ falseAttr

BoolAttr mlir::MLIRContextImpl::falseAttr

Cached Attribute Instances.

Definition at line 230 of file MLIRContext.cpp.

Referenced by mlir::BoolAttr::get().

◆ indexTy

IndexType mlir::MLIRContextImpl::indexTy

Definition at line 218 of file MLIRContext.cpp.

◆ int128Ty

IntegerType mlir::MLIRContextImpl::int128Ty

Definition at line 219 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int16Ty

IntegerType mlir::MLIRContextImpl::int16Ty

Definition at line 219 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int1Ty

IntegerType mlir::MLIRContextImpl::int1Ty

Definition at line 219 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int32Ty

IntegerType mlir::MLIRContextImpl::int32Ty

Definition at line 219 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int64Ty

IntegerType mlir::MLIRContextImpl::int64Ty

Definition at line 219 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int8Ty

IntegerType mlir::MLIRContextImpl::int8Ty

Definition at line 219 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ loadedDialects

DenseMap<StringRef, std::unique_ptr<Dialect> > mlir::MLIRContextImpl::loadedDialects

This is a list of dialects that are created referring to this context.

The MLIRContext owns the objects.

Definition at line 176 of file MLIRContext.cpp.

◆ multiThreadedExecutionContext

std::atomic<int> mlir::MLIRContextImpl::multiThreadedExecutionContext {0}

Track if we are currently executing in a threaded execution environment (like the pass-manager): this is only a debugging feature to help reducing the chances of data races one some context APIs.

Definition at line 150 of file MLIRContext.cpp.

◆ noneType

NoneType mlir::MLIRContextImpl::noneType

Definition at line 220 of file MLIRContext.cpp.

◆ operationInfoMutex

llvm::sys::SmartRWMutex<true> mlir::MLIRContextImpl::operationInfoMutex

A mutex used when accessing operation information.

Definition at line 193 of file MLIRContext.cpp.

Referenced by mlir::OperationName::OperationName().

◆ operations

llvm::StringMap<std::unique_ptr<OperationName::Impl> > mlir::MLIRContextImpl::operations

This is a mapping from operation name to the operation info describing it.

Definition at line 183 of file MLIRContext.cpp.

Referenced by mlir::OperationName::OperationName().

◆ ownedThreadPool

std::unique_ptr<llvm::ThreadPool> mlir::MLIRContextImpl::ownedThreadPool

In case where the thread pool is owned by the context, this ensures destruction with the context.

Definition at line 172 of file MLIRContext.cpp.

◆ printOpOnDiagnostic

bool mlir::MLIRContextImpl::printOpOnDiagnostic = true

If the operation should be attached to diagnostics printed via the Operation::emit methods.

Definition at line 155 of file MLIRContext.cpp.

◆ printStackTraceOnDiagnostic

bool mlir::MLIRContextImpl::printStackTraceOnDiagnostic = false

If the current stack trace should be attached when emitting diagnostics.

Definition at line 158 of file MLIRContext.cpp.

◆ registeredAttributes

DenseMap<TypeID, AbstractAttribute *> mlir::MLIRContextImpl::registeredAttributes

Definition at line 226 of file MLIRContext.cpp.

◆ registeredOperations

llvm::StringMap<RegisteredOperationName> mlir::MLIRContextImpl::registeredOperations

A vector of operation info specifically for registered operations.

Definition at line 186 of file MLIRContext.cpp.

Referenced by mlir::OperationName::OperationName().

◆ registeredTypes

DenseMap<TypeID, AbstractType *> mlir::MLIRContextImpl::registeredTypes

Definition at line 206 of file MLIRContext.cpp.

◆ sortedRegisteredOperations

SmallVector<RegisteredOperationName, 0> mlir::MLIRContextImpl::sortedRegisteredOperations

This is a sorted container of registered operations for a deterministic and efficient getRegisteredOperations implementation.

Definition at line 190 of file MLIRContext.cpp.

◆ threadingIsEnabled

bool mlir::MLIRContextImpl::threadingIsEnabled = true

Enable support for multi-threading within MLIR.

Definition at line 144 of file MLIRContext.cpp.

◆ threadPool

llvm::ThreadPool* mlir::MLIRContextImpl::threadPool = nullptr

This points to the ThreadPool used when processing MLIR tasks in parallel.

It can't be nullptr when multi-threading is enabled. Otherwise if multi-threading is disabled, and the threadpool wasn't externally provided using setThreadPool, this will be nullptr.

Definition at line 168 of file MLIRContext.cpp.

◆ trueAttr

BoolAttr mlir::MLIRContextImpl::trueAttr

Definition at line 230 of file MLIRContext.cpp.

Referenced by mlir::BoolAttr::get().

◆ typeUniquer

StorageUniquer mlir::MLIRContextImpl::typeUniquer

Definition at line 207 of file MLIRContext.cpp.

◆ unitAttr

UnitAttr mlir::MLIRContextImpl::unitAttr

Definition at line 231 of file MLIRContext.cpp.

◆ unknownLocAttr

UnknownLoc mlir::MLIRContextImpl::unknownLocAttr

Definition at line 232 of file MLIRContext.cpp.


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