|
MLIR 24.0.0git
|
MLIRContext is the top-level object for a collection of MLIR operations. More...
#include "mlir/IR/MLIRContext.h"
Classes | |
| class | TransientScope |
| RAII scope guard that calls beginTransientScope() on construction and endTransientScope() on destruction. More... | |
Public Types | |
| enum class | Threading { DISABLED , ENABLED } |
| using | HandlerTy |
| Signatures for the action handler that can be registered with the context. | |
Public Member Functions | |
| MLIRContext (Threading multithreading=Threading::ENABLED) | |
| Create a new Context. | |
| MLIRContext (const DialectRegistry ®istry, Threading multithreading=Threading::ENABLED) | |
| ~MLIRContext () | |
| std::vector< Dialect * > | getLoadedDialects () |
| Return information about all IR dialects loaded in the context. | |
| const DialectRegistry & | getDialectRegistry () |
| Return the dialect registry associated with this context. | |
| void | appendDialectRegistry (const DialectRegistry ®istry) |
| Append the contents of the given dialect registry to the registry associated with this context. | |
| std::vector< StringRef > | getAvailableDialects () |
| Return information about all available dialects in the registry in this context. | |
| Dialect * | getLoadedDialect (StringRef name) |
| Get a registered IR dialect with the given namespace. | |
| template<typename T> | |
| T * | getLoadedDialect () |
| Get a registered IR dialect for the given derived dialect type. | |
| template<typename T> | |
| T * | getOrLoadDialect () |
| Get (or create) a dialect for the given derived dialect type. | |
| template<typename Dialect> | |
| void | loadDialect () |
| Load a dialect in the context. | |
| template<typename Dialect, typename OtherDialect, typename... MoreDialects> | |
| void | loadDialect () |
| Load a list dialects in the context. | |
| DynamicDialect * | getOrLoadDynamicDialect (StringRef dialectNamespace, function_ref< void(DynamicDialect *)> ctor) |
| Get (or create) a dynamic dialect for the given name. | |
| void | loadAllAvailableDialects () |
| Load all dialects available in the registry in this context. | |
| Dialect * | getOrLoadDialect (StringRef name) |
| Get (or create) a dialect for the given derived dialect name. | |
| bool | allowsUnregisteredDialects () |
| Return true if we allow to create operation for unregistered dialects. | |
| void | allowUnregisteredDialects (bool allow=true) |
| Enables creating operations in unregistered dialects. | |
| void | beginTransientScope () |
| Begins a transient scope on the context, freezing the current state (all loaded dialects, registered operations, types, attributes, affine expressions, and singletons) as the base state. | |
| void | endTransientScope () |
| Ends the transient scope and resets the context to the base state, pruning all types, attributes, affine expressions, distinct attributes, and unregistered operations created during the transient scope. | |
| bool | isInTransientScope () const |
| Returns true if the context is currently in a transient scope. | |
| bool | isMultithreadingEnabled () |
| Return true if multi-threading is enabled by the context. | |
| void | disableMultithreading (bool disable=true) |
| Set the flag specifying if multi-threading is disabled by the context. | |
| void | enableMultithreading (bool enable=true) |
| void | setThreadPool (llvm::ThreadPoolInterface &pool) |
| Set a new thread pool to be used in this context. | |
| unsigned | getNumThreads () |
| Return the number of threads used by the thread pool in this context. | |
| llvm::ThreadPoolInterface & | getThreadPool () |
| Return the thread pool used by this context. | |
| bool | shouldPrintOpOnDiagnostic () |
| Return true if we should attach the operation to diagnostics emitted via Operation::emit. | |
| void | printOpOnDiagnostic (bool enable) |
| Set the flag specifying if we should attach the operation to diagnostics emitted via Operation::emit. | |
| bool | shouldPrintStackTraceOnDiagnostic () |
| Return true if we should attach the current stacktrace to diagnostics when emitted. | |
| void | printStackTraceOnDiagnostic (bool enable) |
| Set the flag specifying if we should attach the current stacktrace when emitting diagnostics. | |
| ArrayRef< RegisteredOperationName > | getRegisteredOperations () |
| Return a sorted array containing the information about all registered operations. | |
| ArrayRef< RegisteredOperationName > | getRegisteredOperationsByDialect (StringRef dialectName) |
| Return a sorted array containing the information for registered operations filtered by dialect name. | |
| bool | isOperationRegistered (StringRef name) |
| Return true if this operation name is registered in this context. | |
| MLIRContextImpl & | getImpl () |
| const MLIRContextImpl & | getImpl () const |
| DiagnosticEngine & | getDiagEngine () |
| Returns the diagnostic engine for this context. | |
| remark::detail::RemarkEngine * | getRemarkEngine () |
| Returns the remark engine for this context, or nullptr if none has been set. | |
| void | setRemarkEngine (std::unique_ptr< remark::detail::RemarkEngine > engine) |
| Set the remark engine for this context. | |
| StorageUniquer & | getAffineUniquer () |
| Returns the storage uniquer used for creating affine constructs. | |
| StorageUniquer & | getTypeUniquer () |
| Returns the storage uniquer used for constructing type storage instances. | |
| StorageUniquer & | getAttributeUniquer () |
| Returns the storage uniquer used for constructing attribute storage instances. | |
| void | enterMultiThreadedExecution () |
| These APIs are tracking whether the context will be used in a multithreading environment: this has no effect other than enabling assertions on misuses of some APIs. | |
| void | exitMultiThreadedExecution () |
| Dialect * | getOrLoadDialect (StringRef dialectNamespace, TypeID dialectID, function_ref< std::unique_ptr< Dialect >()> ctor) |
| Get a dialect for the provided namespace and TypeID: abort the program if a dialect exist for this namespace with different TypeID. | |
| llvm::hash_code | getRegistryHash () |
| Returns a hash of the registry of the context that may be used to give a rough indicator of if the state of the context registry has changed. | |
| void | registerActionHandler (HandlerTy handler) |
| Register a handler for handling actions that are dispatched through this context. | |
| const HandlerTy & | getActionHandler () const |
| Return a reference to the currently registered action handler. | |
| HandlerTy & | getActionHandler () |
| bool | hasActionHandler () |
| Return true if a valid ActionHandler is set. | |
| void | executeAction (function_ref< void()> actionFn, const tracing::Action &action) |
| Dispatch the provided action to the handler if any, or just execute it. | |
| template<typename ActionTy, typename... Args> | |
| void | executeAction (function_ref< void()> actionFn, ArrayRef< IRUnit > irUnits, Args &&...args) |
| Dispatch the provided action to the handler if any, or just execute it. | |
MLIRContext is the top-level object for a collection of MLIR operations.
It holds immortal uniqued objects like types, and the tables used to unique them.
MLIRContext gets a redundant "MLIR" prefix because otherwise it ends up with a very generic name ("Context") and because it is uncommon for clients to interact with it.
The context wrap some multi-threading facilities, and in particular by default it will implicitly create a thread pool. This can be undesirable if multiple context exists at the same time or if a process will be long-lived and create and destroy contexts. To control better thread spawning, an externally owned ThreadPool can be injected in the context. For example:
llvm::DefaultThreadPool myThreadPool; while (auto *request = nextCompilationRequests()) { MLIRContext ctx(registry, MLIRContext::Threading::DISABLED); ctx.setThreadPool(myThreadPool); processRequest(request, cxt); }
Definition at line 63 of file MLIRContext.h.
Signatures for the action handler that can be registered with the context.
Definition at line 307 of file MLIRContext.h.
|
strong |
| Enumerator | |
|---|---|
| DISABLED | |
| ENABLED | |
Definition at line 65 of file MLIRContext.h.
|
explicit |
Create a new Context.
Definition at line 300 of file MLIRContext.cpp.
References MLIRContext().
Referenced by MLIRContext(), mlir::MLIRContext::TransientScope::operator=(), and mlir::MLIRContext::TransientScope::TransientScope().
|
explicit |
Types. Floating-point Types.
Index Type.
Integer Types.
None Type.
of the above types internally. Unknown Location Attribute.
Bool Attributes.
Unit Attribute.
The empty dictionary attribute.
The empty string attribute.
Definition at line 303 of file MLIRContext.cpp.
References mlir::DialectRegistry::appendTo(), clOptions, ENABLED, mlir::detail::AttributeUniquer::get(), mlir::detail::TypeUniquer::get(), getOrLoadDialect(), and isThreadingGloballyDisabled().
| MLIRContext::~MLIRContext | ( | ) |
Definition at line 371 of file MLIRContext.cpp.
|
nodiscard |
Return true if we allow to create operation for unregistered dialects.
Definition at line 609 of file MLIRContext.cpp.
Referenced by doVerifyRoundTrip().
Enables creating operations in unregistered dialects.
This option is heavily discouraged: it is convenient during testing but it is not a good practice to use it in production code. Some system invariants can be broken (like loading a dialect after creating operations) without being caught by assertions or other means.
Definition at line 613 of file MLIRContext.cpp.
Referenced by mlir::lsp::MLIRServer::convertFromBytecode(), doVerifyRoundTrip(), mlir::mlirQueryMain(), mlir::mlirReduceMain(), and processBuffer().
| void MLIRContext::appendDialectRegistry | ( | const DialectRegistry & | registry | ) |
Append the contents of the given dialect registry to the registry associated with this context.
Definition at line 435 of file MLIRContext.cpp.
References mlir::DialectRegistry::appendTo(), mlir::DialectRegistry::applyExtensions(), and mlir::DialectRegistry::isSubsetOf().
Referenced by doVerifyRoundTrip(), loadIRDLDialects(), mlir::registerAllDialects(), mlir::registerArmNeonDialectTranslation(), mlir::registerArmSMEDialectTranslation(), mlir::registerArmSVEDialectTranslation(), mlir::registerBuiltinDialectTranslation(), mlir::registerGPUDialectTranslation(), mlir::registerLLVMDialectImport(), mlir::registerLLVMDialectTranslation(), mlir::registerNVVMDialectImport(), mlir::registerNVVMDialectTranslation(), mlir::NVVM::registerNVVMTargetInterfaceExternalModels(), mlir::registerOpenMPDialectTranslation(), mlir::registerPtrDialectTranslation(), mlir::registerROCDLDialectTranslation(), mlir::ROCDL::registerROCDLTargetInterfaceExternalModels(), mlir::linalg::registerShardingInterfaceExternalModels(), mlir::registerSPIRVDialectTranslation(), mlir::spirv::registerSPIRVTargetInterfaceExternalModels(), mlir::registerVCIXDialectTranslation(), and mlir::xevm::registerXeVMTargetInterfaceExternalModels().
| void MLIRContext::beginTransientScope | ( | ) |
Begins a transient scope on the context, freezing the current state (all loaded dialects, registered operations, types, attributes, affine expressions, and singletons) as the base state.
Subsequent types, attributes, and expressions allocated will belong to the transient layer.
Preconditions:
Definition at line 698 of file MLIRContext.cpp.
References mlir::MLIRContextImpl::affineUniquer, mlir::MLIRContextImpl::attributeUniquer, mlir::detail::DistinctAttributeAllocator::beginTransientScope(), mlir::StorageUniquer::beginTransientScope(), mlir::MLIRContextImpl::dialectReferencingStrAttrs, mlir::MLIRContextImpl::dialectRefStrAttrMutex, mlir::MLIRContextImpl::distinctAttributeAllocator, getImpl(), mlir::MLIRContextImpl::multiThreadedExecutionContext, mlir::MLIRContextImpl::operationInfoMutex, mlir::MLIRContextImpl::operations, mlir::MLIRContextImpl::transientState, and mlir::MLIRContextImpl::typeUniquer.
Set the flag specifying if multi-threading is disabled by the context.
The command line debugging flag --mlir-disable-threading is overriding this call and making it a no-op!
Definition at line 626 of file MLIRContext.cpp.
References isThreadingGloballyDisabled().
Referenced by mlir::PassReproducerOptions::apply(), enableMultithreading(), and performActions().
Definition at line 198 of file MLIRContext.h.
References disableMultithreading().
Referenced by performActions(), and setThreadPool().
| void MLIRContext::endTransientScope | ( | ) |
Ends the transient scope and resets the context to the base state, pruning all types, attributes, affine expressions, distinct attributes, and unregistered operations created during the transient scope.
Preconditions:
Definition at line 729 of file MLIRContext.cpp.
References mlir::MLIRContextImpl::affineUniquer, mlir::MLIRContextImpl::attributeUniquer, mlir::MLIRContextImpl::dialectReferencingStrAttrs, mlir::MLIRContextImpl::dialectRefStrAttrMutex, mlir::MLIRContextImpl::distinctAttributeAllocator, mlir::detail::DistinctAttributeAllocator::endTransientScope(), mlir::StorageUniquer::endTransientScope(), getImpl(), mlir::MLIRContextImpl::multiThreadedExecutionContext, mlir::MLIRContextImpl::operationInfoMutex, mlir::MLIRContextImpl::operations, mlir::MLIRContextImpl::transientState, and mlir::MLIRContextImpl::typeUniquer.
| void MLIRContext::enterMultiThreadedExecution | ( | ) |
These APIs are tracking whether the context will be used in a multithreading environment: this has no effect other than enabling assertions on misuses of some APIs.
Definition at line 687 of file MLIRContext.cpp.
|
inline |
Dispatch the provided action to the handler if any, or just execute it.
Definition at line 333 of file MLIRContext.h.
References hasActionHandler().
|
inline |
Dispatch the provided action to the handler if any, or just execute it.
Definition at line 323 of file MLIRContext.h.
References hasActionHandler().
Referenced by applyConversion(), mlir::PatternApplicator::matchAndRewrite(), and mlir::walkAndApplyPatterns().
| void MLIRContext::exitMultiThreadedExecution | ( | ) |
Definition at line 692 of file MLIRContext.cpp.
| MLIRContext::HandlerTy & MLIRContext::getActionHandler | ( | ) |
Definition at line 398 of file MLIRContext.cpp.
References mlir::MLIRContextImpl::actionHandler, and getImpl().
| const MLIRContext::HandlerTy & MLIRContext::getActionHandler | ( | ) | const |
Return a reference to the currently registered action handler.
Its target can be used to gain access to the handler's state, if any.
Definition at line 394 of file MLIRContext.cpp.
References mlir::MLIRContextImpl::actionHandler, and getImpl().
| StorageUniquer & MLIRContext::getAffineUniquer | ( | ) |
Returns the storage uniquer used for creating affine constructs.
Definition at line 1304 of file MLIRContext.cpp.
References mlir::OperationName::getImpl().
Referenced by mlir::AffineExpr::ceilDiv(), mlir::AffineExpr::floorDiv(), mlir::AffineExpr::operator%(), and mlir::AffineExpr::operator*().
| StorageUniquer & MLIRContext::getAttributeUniquer | ( | ) |
Returns the storage uniquer used for constructing attribute storage instances.
This should not be used directly.
Definition at line 1243 of file MLIRContext.cpp.
References mlir::OperationName::getImpl().
Referenced by mlir::detail::AttributeUniquer::getWithTypeID(), mlir::detail::AttributeUniquer::getWithTypeID(), mlir::detail::AttributeUniquer::mutate(), and mlir::detail::AttributeUniquer::registerAttribute().
| std::vector< StringRef > MLIRContext::getAvailableDialects | ( | ) |
Return information about all available dialects in the registry in this context.
Definition at line 467 of file MLIRContext.cpp.
References result.
Referenced by loadAllAvailableDialects(), and mlir::translateLLVMIRToModule().
| DiagnosticEngine & MLIRContext::getDiagEngine | ( | ) |
Returns the diagnostic engine for this context.
Definition at line 416 of file MLIRContext.cpp.
References mlir::MLIRContextImpl::diagEngine, and getImpl().
Referenced by emitDiag(), and mlir::detail::ParallelDiagnosticHandlerImpl::ParallelDiagnosticHandlerImpl().
| const DialectRegistry & MLIRContext::getDialectRegistry | ( | ) |
Return the dialect registry associated with this context.
Definition at line 451 of file MLIRContext.cpp.
Referenced by doVerifyRoundTrip(), and roundTripModule().
|
inline |
Definition at line 256 of file MLIRContext.h.
Referenced by beginTransientScope(), endTransientScope(), mlir::BoolAttr::get(), getActionHandler(), getActionHandler(), getCachedIntegerType(), getDiagEngine(), getOrLoadDialect(), getOrLoadDynamicDialect(), getRemarkEngine(), hasActionHandler(), mlir::detail::StringAttrStorage::initialize(), isInTransientScope(), mlir::AbstractAttribute::lookup(), mlir::AbstractType::lookup(), mlir::RegisteredOperationName::lookup(), mlir::RegisteredOperationName::lookup(), mlir::OperationName::OperationName(), registerActionHandler(), and setRemarkEngine().
|
inline |
Definition at line 257 of file MLIRContext.h.
|
inline |
Get a registered IR dialect for the given derived dialect type.
The derived type must provide a static 'getDialectNamespace' method.
Definition at line 93 of file MLIRContext.h.
References getLoadedDialect().
Referenced by getLoadedDialect(), and getOrLoadDialect().
| Dialect * MLIRContext::getLoadedDialect | ( | StringRef | name | ) |
Get a registered IR dialect with the given namespace.
If an exact match is not found, then return nullptr.
If none is found, then return nullptr.
Definition at line 476 of file MLIRContext.cpp.
Referenced by mlir::NVVM::SerializeGPUModuleBase::appendStandardLibs(), mlir::DialectRegistry::applyExtensions(), mlir::DialectRegistry::applyExtensions(), combineOneSpec(), mlir::detail::StringAttrStorage::initialize(), mlir::LLVM::isCompatibleType(), keepHostOpInDevice(), mlir::dataflow::maybeReplaceWithConstant(), mergeInto(), movePaddingToFillOrGenericOp(), and mlir::populateGpuToROCDLConversionPatterns().
| std::vector< Dialect * > MLIRContext::getLoadedDialects | ( | ) |
Return information about all IR dialects loaded in the context.
Return information about all registered IR dialects.
Definition at line 456 of file MLIRContext.cpp.
References lhs, result, and rhs.
Referenced by mlir::DialectRegistry::applyExtensions(), and mlir::detail::DialectInterfaceCollectionBase::DialectInterfaceCollectionBase().
| unsigned MLIRContext::getNumThreads | ( | ) |
Return the number of threads used by the thread pool in this context.
The number of computed hardware threads can change over the lifetime of a process based on affinity changes, so users should use the number of threads actually in the thread pool for dispatching work. Returns 1 if multithreading is disabled.
Definition at line 669 of file MLIRContext.cpp.
References isMultithreadingEnabled().
|
inline |
Get (or create) a dialect for the given derived dialect type.
The derived type must provide a static 'getDialectNamespace' method.
Definition at line 100 of file MLIRContext.h.
References mlir::TypeID::get(), and getOrLoadDialect().
Referenced by mlir::DialectResourceBlobHandle< BuiltinDialect >::getManagerInterface(), getOrLoadDialect(), getOrLoadDynamicDialect(), mlir::transform::detail::getPreloadedTransformModule(), mlir::DialectRegistry::insert(), loadAllAvailableDialects(), loadDialect(), MLIRContext(), mlir::FieldParser< AttributeT, std::enable_if_t< std::is_base_of< Attribute, AttributeT >::value, AttributeT > >::parse(), mlir::FieldParser< std::optional< AttributeT >, std::enable_if_t< std::is_base_of< Attribute, AttributeT >::value, std::optional< AttributeT > > >::parse(), mlir::detail::Parser::parseAttributeDict(), mlir::AsmParser::parseResourceHandle(), mlir::DialectRegistry::preloadSelectDialects(), prepareLLVMModule(), mlir::func::registerInlinerExtension(), and mlir::linalg::registerShardingInterfaceExternalModels().
| Dialect * MLIRContext::getOrLoadDialect | ( | StringRef | dialectNamespace, |
| TypeID | dialectID, | ||
| function_ref< std::unique_ptr< Dialect >()> | ctor ) |
Get a dialect for the provided namespace and TypeID: abort the program if a dialect exist for this namespace with different TypeID.
If a dialect has not been loaded for this namespace/TypeID yet, use the provided ctor to create one on the fly and load it. Returns a pointer to the dialect owned by the context. The use of this method is in general discouraged in favor of 'getOrLoadDialect<DialectClass>()'.
Returns a pointer to the dialect owned by the context.
Definition at line 495 of file MLIRContext.cpp.
References getImpl(), and mlir::detail::StringAttrStorage::referencedDialect.
| Dialect * MLIRContext::getOrLoadDialect | ( | StringRef | name | ) |
Get (or create) a dialect for the given derived dialect name.
The dialect will be loaded from the registry if no dialect is found. If no dialect is loaded for this name and none is available in the registry, returns nullptr.
Definition at line 482 of file MLIRContext.cpp.
References getLoadedDialect().
| DynamicDialect * MLIRContext::getOrLoadDynamicDialect | ( | StringRef | dialectNamespace, |
| function_ref< void(DynamicDialect *)> | ctor ) |
Get (or create) a dynamic dialect for the given name.
Definition at line 560 of file MLIRContext.cpp.
References getImpl(), and getOrLoadDialect().
Referenced by mlir::DialectRegistry::insertDynamic(), and loadEmptyDialects().
| ArrayRef< RegisteredOperationName > MLIRContext::getRegisteredOperations | ( | ) |
Return a sorted array containing the information about all registered operations.
Return information about all registered operations.
Definition at line 820 of file MLIRContext.cpp.
| ArrayRef< RegisteredOperationName > MLIRContext::getRegisteredOperationsByDialect | ( | StringRef | dialectName | ) |
Return a sorted array containing the information for registered operations filtered by dialect name.
Return information for registered operations by dialect.
Definition at line 826 of file MLIRContext.cpp.
| llvm::hash_code MLIRContext::getRegistryHash | ( | ) |
Returns a hash of the registry of the context that may be used to give a rough indicator of if the state of the context registry has changed.
The context registry correlates to loaded dialects and their entities (attributes, operations, types, etc.).
Definition at line 599 of file MLIRContext.cpp.
References hash().
| remark::detail::RemarkEngine * MLIRContext::getRemarkEngine | ( | ) |
Returns the remark engine for this context, or nullptr if none has been set.
Definition at line 427 of file MLIRContext.cpp.
References getImpl(), and mlir::MLIRContextImpl::remarkEngine.
Referenced by mlir::acc::emitRemark(), performActions(), and mlir::remark::detail::withEngine().
| llvm::ThreadPoolInterface & MLIRContext::getThreadPool | ( | ) |
Return the thread pool used by this context.
This method requires that multithreading be enabled within the context, and should generally not be used directly. Users should instead prefer the threading utilities within Threading.h.
Definition at line 679 of file MLIRContext.cpp.
References isMultithreadingEnabled().
Referenced by mlir::failableParallelForEach(), and mlir::MlirOptMain().
| StorageUniquer & MLIRContext::getTypeUniquer | ( | ) |
Returns the storage uniquer used for constructing type storage instances.
This should not be used directly.
Definition at line 1156 of file MLIRContext.cpp.
References mlir::OperationName::getImpl().
Referenced by mlir::detail::TypeUniquer::getWithTypeID(), mlir::detail::TypeUniquer::getWithTypeID(), mlir::detail::TypeUniquer::mutate(), and mlir::detail::TypeUniquer::registerType().
| bool MLIRContext::hasActionHandler | ( | ) |
Return true if a valid ActionHandler is set.
Definition at line 409 of file MLIRContext.cpp.
References mlir::MLIRContextImpl::actionHandler, and getImpl().
Referenced by executeAction(), and executeAction().
| bool MLIRContext::isInTransientScope | ( | ) | const |
Returns true if the context is currently in a transient scope.
Definition at line 785 of file MLIRContext.cpp.
References getImpl(), and mlir::MLIRContextImpl::transientState.
| bool MLIRContext::isMultithreadingEnabled | ( | ) |
Return true if multi-threading is enabled by the context.
Definition at line 621 of file MLIRContext.cpp.
Referenced by mlir::applyPassManagerCLOptions(), mlir::failableParallelForEach(), getNumThreads(), getThreadPool(), mlir::detail::PassCrashReproducerGenerator::initialize(), mlir::MlirOptMain(), mlir::OperationName::OperationName(), performActions(), and setThreadPool().
| bool MLIRContext::isOperationRegistered | ( | StringRef | name | ) |
Return true if this operation name is registered in this context.
Definition at line 847 of file MLIRContext.cpp.
References mlir::RegisteredOperationName::lookup().
| void MLIRContext::loadAllAvailableDialects | ( | ) |
Load all dialects available in the registry in this context.
Definition at line 594 of file MLIRContext.cpp.
References getAvailableDialects(), and getOrLoadDialect().
Referenced by roundTripModule(), and mlir::translateLLVMIRToModule().
Load a dialect in the context.
Definition at line 110 of file MLIRContext.h.
References getOrLoadDialect().
Referenced by mlir::transform::TransformDialectExtension< DerivedTy, ExtraDialects... >::declareDependentDialect(), mlir::transform::TransformDialectExtension< DerivedTy, ExtraDialects... >::declareGeneratedDialect(), deserializeModule(), mlir::query::extractFunction(), loadDialect(), and mlir::linalg::registerRuntimeVerifiableOpInterfaceExternalModels().
|
inline |
Load a list dialects in the context.
Definition at line 119 of file MLIRContext.h.
References loadDialect().
Set the flag specifying if we should attach the operation to diagnostics emitted via Operation::emit.
Definition at line 797 of file MLIRContext.cpp.
Referenced by processBuffer().
Set the flag specifying if we should attach the current stacktrace when emitting diagnostics.
Definition at line 812 of file MLIRContext.cpp.
Register a handler for handling actions that are dispatched through this context.
A nullptr handler can be set to disable a previously set handler.
Definition at line 390 of file MLIRContext.cpp.
References mlir::MLIRContextImpl::actionHandler, and getImpl().
Referenced by mlir::tracing::InstallDebugHandler::Impl::Impl().
| void MLIRContext::setRemarkEngine | ( | std::unique_ptr< remark::detail::RemarkEngine > | engine | ) |
Set the remark engine for this context.
Definition at line 422 of file MLIRContext.cpp.
References getImpl(), and mlir::MLIRContextImpl::remarkEngine.
| void MLIRContext::setThreadPool | ( | llvm::ThreadPoolInterface & | pool | ) |
Set a new thread pool to be used in this context.
This method requires that multithreading is disabled for this context prior to the call. This allows to share a thread pool across multiple contexts, as well as decoupling the lifetime of the threads from the contexts. The thread pool must outlive the context. Multi-threading will be enabled as part of this method. The command line debugging flag --mlir-disable-threading will still prevent threading from being enabled and threading won't be enabled after this call in this case.
Definition at line 661 of file MLIRContext.cpp.
References enableMultithreading(), and isMultithreadingEnabled().
Referenced by processBuffer().
| bool MLIRContext::shouldPrintOpOnDiagnostic | ( | ) |
Return true if we should attach the operation to diagnostics emitted via Operation::emit.
Definition at line 791 of file MLIRContext.cpp.
| bool MLIRContext::shouldPrintStackTraceOnDiagnostic | ( | ) |
Return true if we should attach the current stacktrace to diagnostics when emitted.
Definition at line 806 of file MLIRContext.cpp.
Referenced by emitDiag().