MLIR  16.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< OperationName::Imploperations
 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
 
BFloat16Type bf16Ty
 Cached Type Instances. More...
 
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 119 of file MLIRContext.cpp.

Constructor & Destructor Documentation

◆ MLIRContextImpl()

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

Definition at line 240 of file MLIRContext.cpp.

◆ ~MLIRContextImpl()

mlir::MLIRContextImpl::~MLIRContextImpl ( )
inline

Definition at line 247 of file MLIRContext.cpp.

Member Data Documentation

◆ abstractDialectSymbolAllocator

llvm::BumpPtrAllocator mlir::MLIRContextImpl::abstractDialectSymbolAllocator

An allocator used for AbstractAttribute and AbstractType objects.

Definition at line 179 of file MLIRContext.cpp.

◆ affineUniquer

StorageUniquer mlir::MLIRContextImpl::affineUniquer

Definition at line 199 of file MLIRContext.cpp.

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

◆ 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 140 of file MLIRContext.cpp.

◆ attributeUniquer

StorageUniquer mlir::MLIRContextImpl::attributeUniquer

Definition at line 224 of file MLIRContext.cpp.

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

◆ bf16Ty

BFloat16Type mlir::MLIRContextImpl::bf16Ty

Cached Type Instances.

Definition at line 209 of file MLIRContext.cpp.

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

◆ debugActionManager

DebugActionManager mlir::MLIRContextImpl::debugActionManager

An action manager for use within the context.

Definition at line 126 of file MLIRContext.cpp.

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

◆ diagEngine

DiagnosticEngine mlir::MLIRContextImpl::diagEngine

Definition at line 131 of file MLIRContext.cpp.

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

◆ dialectReferencingStrAttrs

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

Definition at line 237 of file MLIRContext.cpp.

Referenced by mlir::detail::StringAttrStorage::initialize().

◆ 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 235 of file MLIRContext.cpp.

Referenced by mlir::detail::StringAttrStorage::initialize().

◆ dialectsRegistry

DialectRegistry mlir::MLIRContextImpl::dialectsRegistry

Definition at line 176 of file MLIRContext.cpp.

◆ emptyDictionaryAttr

DictionaryAttr mlir::MLIRContextImpl::emptyDictionaryAttr

Definition at line 230 of file MLIRContext.cpp.

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

◆ emptyStringAttr

StringAttr mlir::MLIRContextImpl::emptyStringAttr

Definition at line 231 of file MLIRContext.cpp.

Referenced by mlir::detail::StringAttrStorage::initialize().

◆ f128Ty

Float128Type mlir::MLIRContextImpl::f128Ty

Definition at line 214 of file MLIRContext.cpp.

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

◆ f16Ty

Float16Type mlir::MLIRContextImpl::f16Ty

Definition at line 210 of file MLIRContext.cpp.

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

◆ f32Ty

Float32Type mlir::MLIRContextImpl::f32Ty

Definition at line 211 of file MLIRContext.cpp.

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

◆ f64Ty

Float64Type mlir::MLIRContextImpl::f64Ty

Definition at line 212 of file MLIRContext.cpp.

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

◆ f80Ty

Float80Type mlir::MLIRContextImpl::f80Ty

Definition at line 213 of file MLIRContext.cpp.

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

◆ falseAttr

BoolAttr mlir::MLIRContextImpl::falseAttr

Cached Attribute Instances.

Definition at line 227 of file MLIRContext.cpp.

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

◆ indexTy

IndexType mlir::MLIRContextImpl::indexTy

Definition at line 215 of file MLIRContext.cpp.

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

◆ int128Ty

IntegerType mlir::MLIRContextImpl::int128Ty

Definition at line 216 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int16Ty

IntegerType mlir::MLIRContextImpl::int16Ty

Definition at line 216 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int1Ty

IntegerType mlir::MLIRContextImpl::int1Ty

Definition at line 216 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int32Ty

IntegerType mlir::MLIRContextImpl::int32Ty

Definition at line 216 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int64Ty

IntegerType mlir::MLIRContextImpl::int64Ty

Definition at line 216 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ int8Ty

IntegerType mlir::MLIRContextImpl::int8Ty

Definition at line 216 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 175 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 149 of file MLIRContext.cpp.

◆ noneType

NoneType mlir::MLIRContextImpl::noneType

Definition at line 217 of file MLIRContext.cpp.

Referenced by getCachedIntegerType().

◆ operationInfoMutex

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

A mutex used when accessing operation information.

Definition at line 192 of file MLIRContext.cpp.

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

◆ operations

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

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

Definition at line 182 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 171 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 154 of file MLIRContext.cpp.

◆ printStackTraceOnDiagnostic

bool mlir::MLIRContextImpl::printStackTraceOnDiagnostic = false

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

Definition at line 157 of file MLIRContext.cpp.

◆ registeredAttributes

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

Definition at line 223 of file MLIRContext.cpp.

◆ registeredOperations

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

A vector of operation info specifically for registered operations.

Definition at line 185 of file MLIRContext.cpp.

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

◆ registeredTypes

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

Definition at line 205 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 189 of file MLIRContext.cpp.

◆ threadingIsEnabled

bool mlir::MLIRContextImpl::threadingIsEnabled = true

Enable support for multi-threading within MLIR.

Definition at line 143 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 167 of file MLIRContext.cpp.

◆ trueAttr

BoolAttr mlir::MLIRContextImpl::trueAttr

Definition at line 227 of file MLIRContext.cpp.

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

◆ typeUniquer

StorageUniquer mlir::MLIRContextImpl::typeUniquer

Definition at line 206 of file MLIRContext.cpp.

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

◆ unitAttr

UnitAttr mlir::MLIRContextImpl::unitAttr

Definition at line 228 of file MLIRContext.cpp.

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

◆ unknownLocAttr

UnknownLoc mlir::MLIRContextImpl::unknownLocAttr

Definition at line 229 of file MLIRContext.cpp.

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


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