#include "mlir/IR/MLIRContext.h"
#include "AffineExprDetail.h"
#include "AffineMapDetail.h"
#include "AttributeDetail.h"
#include "IntegerSetDetail.h"
#include "TypeDetail.h"
#include "mlir/IR/Action.h"
#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/IR/BuiltinDialect.h"
#include "mlir/IR/Diagnostics.h"
#include "mlir/IR/Dialect.h"
#include "mlir/IR/ExtensibleDialect.h"
#include "mlir/IR/IntegerSet.h"
#include "mlir/IR/Location.h"
#include "mlir/IR/OpImplementation.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/IR/Types.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/ADT/SmallString.h"
#include "llvm/ADT/StringSet.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/Allocator.h"
#include "llvm/Support/CommandLine.h"
#include "llvm/Support/Compiler.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Mutex.h"
#include "llvm/Support/RWMutex.h"
#include "llvm/Support/ThreadPool.h"
#include "llvm/Support/raw_ostream.h"
#include <memory>
#include <optional>
#define DEBUG_TYPE …
usingnamespacemlir;
usingnamespacemlir::detail;
namespace {
struct MLIRContextOptions { … };
}
static llvm::ManagedStatic<MLIRContextOptions> clOptions;
static bool isThreadingGloballyDisabled() { … }
void mlir::registerMLIRContextCLOptions() { … }
namespace {
struct ScopedWriterLock { … };
}
namespace mlir {
class MLIRContextImpl { … };
}
MLIRContext::MLIRContext(Threading setting)
: … { … }
MLIRContext::MLIRContext(const DialectRegistry ®istry, Threading setting)
: … { … }
MLIRContext::~MLIRContext() = default;
template <typename T>
static ArrayRef<T> copyArrayRefInto(llvm::BumpPtrAllocator &allocator,
ArrayRef<T> elements) { … }
void MLIRContext::registerActionHandler(HandlerTy handler) { … }
void MLIRContext::executeActionInternal(function_ref<void()> actionFn,
const tracing::Action &action) { … }
bool MLIRContext::hasActionHandler() { … }
DiagnosticEngine &MLIRContext::getDiagEngine() { … }
void MLIRContext::appendDialectRegistry(const DialectRegistry ®istry) { … }
const DialectRegistry &MLIRContext::getDialectRegistry() { … }
std::vector<Dialect *> MLIRContext::getLoadedDialects() { … }
std::vector<StringRef> MLIRContext::getAvailableDialects() { … }
Dialect *MLIRContext::getLoadedDialect(StringRef name) { … }
Dialect *MLIRContext::getOrLoadDialect(StringRef name) { … }
Dialect *
MLIRContext::getOrLoadDialect(StringRef dialectNamespace, TypeID dialectID,
function_ref<std::unique_ptr<Dialect>()> ctor) { … }
bool MLIRContext::isDialectLoading(StringRef dialectNamespace) { … }
DynamicDialect *MLIRContext::getOrLoadDynamicDialect(
StringRef dialectNamespace, function_ref<void(DynamicDialect *)> ctor) { … }
void MLIRContext::loadAllAvailableDialects() { … }
llvm::hash_code MLIRContext::getRegistryHash() { … }
bool MLIRContext::allowsUnregisteredDialects() { … }
void MLIRContext::allowUnregisteredDialects(bool allowing) { … }
bool MLIRContext::isMultithreadingEnabled() { … }
void MLIRContext::disableMultithreading(bool disable) { … }
void MLIRContext::setThreadPool(llvm::ThreadPoolInterface &pool) { … }
unsigned MLIRContext::getNumThreads() { … }
llvm::ThreadPoolInterface &MLIRContext::getThreadPool() { … }
void MLIRContext::enterMultiThreadedExecution() { … }
void MLIRContext::exitMultiThreadedExecution() { … }
bool MLIRContext::shouldPrintOpOnDiagnostic() { … }
void MLIRContext::printOpOnDiagnostic(bool enable) { … }
bool MLIRContext::shouldPrintStackTraceOnDiagnostic() { … }
void MLIRContext::printStackTraceOnDiagnostic(bool enable) { … }
ArrayRef<RegisteredOperationName> MLIRContext::getRegisteredOperations() { … }
bool MLIRContext::isOperationRegistered(StringRef name) { … }
void Dialect::addType(TypeID typeID, AbstractType &&typeInfo) { … }
void Dialect::addAttribute(TypeID typeID, AbstractAttribute &&attrInfo) { … }
const AbstractAttribute &AbstractAttribute::lookup(TypeID typeID,
MLIRContext *context) { … }
AbstractAttribute *AbstractAttribute::lookupMutable(TypeID typeID,
MLIRContext *context) { … }
std::optional<std::reference_wrapper<const AbstractAttribute>>
AbstractAttribute::lookup(StringRef name, MLIRContext *context) { … }
OperationName::Impl::Impl(StringRef name, Dialect *dialect, TypeID typeID,
detail::InterfaceMap interfaceMap)
: … { … }
OperationName::OperationName(StringRef name, MLIRContext *context) { … }
StringRef OperationName::getDialectNamespace() const { … }
LogicalResult
OperationName::UnregisteredOpModel::foldHook(Operation *, ArrayRef<Attribute>,
SmallVectorImpl<OpFoldResult> &) { … }
void OperationName::UnregisteredOpModel::getCanonicalizationPatterns(
RewritePatternSet &, MLIRContext *) { … }
bool OperationName::UnregisteredOpModel::hasTrait(TypeID) { … }
OperationName::ParseAssemblyFn
OperationName::UnregisteredOpModel::getParseAssemblyFn() { … }
void OperationName::UnregisteredOpModel::populateDefaultAttrs(
const OperationName &, NamedAttrList &) { … }
void OperationName::UnregisteredOpModel::printAssembly(
Operation *op, OpAsmPrinter &p, StringRef defaultDialect) { … }
LogicalResult
OperationName::UnregisteredOpModel::verifyInvariants(Operation *) { … }
LogicalResult
OperationName::UnregisteredOpModel::verifyRegionInvariants(Operation *) { … }
std::optional<Attribute>
OperationName::UnregisteredOpModel::getInherentAttr(Operation *op,
StringRef name) { … }
void OperationName::UnregisteredOpModel::setInherentAttr(Operation *op,
StringAttr name,
Attribute value) { … }
void OperationName::UnregisteredOpModel::populateInherentAttrs(
Operation *op, NamedAttrList &attrs) { … }
LogicalResult OperationName::UnregisteredOpModel::verifyInherentAttrs(
OperationName opName, NamedAttrList &attributes,
function_ref<InFlightDiagnostic()> emitError) { … }
int OperationName::UnregisteredOpModel::getOpPropertyByteSize() { … }
void OperationName::UnregisteredOpModel::initProperties(
OperationName opName, OpaqueProperties storage, OpaqueProperties init) { … }
void OperationName::UnregisteredOpModel::deleteProperties(
OpaqueProperties prop) { … }
void OperationName::UnregisteredOpModel::populateDefaultProperties(
OperationName opName, OpaqueProperties properties) { … }
LogicalResult OperationName::UnregisteredOpModel::setPropertiesFromAttr(
OperationName opName, OpaqueProperties properties, Attribute attr,
function_ref<InFlightDiagnostic()> emitError) { … }
Attribute
OperationName::UnregisteredOpModel::getPropertiesAsAttr(Operation *op) { … }
void OperationName::UnregisteredOpModel::copyProperties(OpaqueProperties lhs,
OpaqueProperties rhs) { … }
bool OperationName::UnregisteredOpModel::compareProperties(
OpaqueProperties lhs, OpaqueProperties rhs) { … }
llvm::hash_code
OperationName::UnregisteredOpModel::hashProperties(OpaqueProperties prop) { … }
std::optional<RegisteredOperationName>
RegisteredOperationName::lookup(TypeID typeID, MLIRContext *ctx) { … }
std::optional<RegisteredOperationName>
RegisteredOperationName::lookup(StringRef name, MLIRContext *ctx) { … }
void RegisteredOperationName::insert(
std::unique_ptr<RegisteredOperationName::Impl> ownedImpl,
ArrayRef<StringRef> attrNames) { … }
const AbstractType &AbstractType::lookup(TypeID typeID, MLIRContext *context) { … }
AbstractType *AbstractType::lookupMutable(TypeID typeID, MLIRContext *context) { … }
std::optional<std::reference_wrapper<const AbstractType>>
AbstractType::lookup(StringRef name, MLIRContext *context) { … }
StorageUniquer &MLIRContext::getTypeUniquer() { … }
Float6E2M3FNType Float6E2M3FNType::get(MLIRContext *context) { … }
Float6E3M2FNType Float6E3M2FNType::get(MLIRContext *context) { … }
Float8E5M2Type Float8E5M2Type::get(MLIRContext *context) { … }
Float8E4M3Type Float8E4M3Type::get(MLIRContext *context) { … }
Float8E4M3FNType Float8E4M3FNType::get(MLIRContext *context) { … }
Float8E5M2FNUZType Float8E5M2FNUZType::get(MLIRContext *context) { … }
Float8E4M3FNUZType Float8E4M3FNUZType::get(MLIRContext *context) { … }
Float8E4M3B11FNUZType Float8E4M3B11FNUZType::get(MLIRContext *context) { … }
Float8E3M4Type Float8E3M4Type::get(MLIRContext *context) { … }
BFloat16Type BFloat16Type::get(MLIRContext *context) { … }
Float16Type Float16Type::get(MLIRContext *context) { … }
FloatTF32Type FloatTF32Type::get(MLIRContext *context) { … }
Float32Type Float32Type::get(MLIRContext *context) { … }
Float64Type Float64Type::get(MLIRContext *context) { … }
Float80Type Float80Type::get(MLIRContext *context) { … }
Float128Type Float128Type::get(MLIRContext *context) { … }
IndexType IndexType::get(MLIRContext *context) { … }
static IntegerType
getCachedIntegerType(unsigned width,
IntegerType::SignednessSemantics signedness,
MLIRContext *context) { … }
IntegerType IntegerType::get(MLIRContext *context, unsigned width,
IntegerType::SignednessSemantics signedness) { … }
IntegerType
IntegerType::getChecked(function_ref<InFlightDiagnostic()> emitError,
MLIRContext *context, unsigned width,
SignednessSemantics signedness) { … }
NoneType NoneType::get(MLIRContext *context) { … }
StorageUniquer &MLIRContext::getAttributeUniquer() { … }
void AttributeUniquer::initializeAttributeStorage(AttributeStorage *storage,
MLIRContext *ctx,
TypeID attrID) { … }
BoolAttr BoolAttr::get(MLIRContext *context, bool value) { … }
UnitAttr UnitAttr::get(MLIRContext *context) { … }
UnknownLoc UnknownLoc::get(MLIRContext *context) { … }
DistinctAttrStorage *
detail::DistinctAttributeUniquer::allocateStorage(MLIRContext *context,
Attribute referencedAttr) { … }
DictionaryAttr DictionaryAttr::getEmpty(MLIRContext *context) { … }
void StringAttrStorage::initialize(MLIRContext *context) { … }
StringAttr StringAttr::get(MLIRContext *context) { … }
StorageUniquer &MLIRContext::getAffineUniquer() { … }
AffineMap AffineMap::getImpl(unsigned dimCount, unsigned symbolCount,
ArrayRef<AffineExpr> results,
MLIRContext *context) { … }
LLVM_ATTRIBUTE_UNUSED static bool
willBeValidAffineMap(unsigned dimCount, unsigned symbolCount,
ArrayRef<AffineExpr> results) { … }
AffineMap AffineMap::get(MLIRContext *context) { … }
AffineMap AffineMap::get(unsigned dimCount, unsigned symbolCount,
MLIRContext *context) { … }
AffineMap AffineMap::get(unsigned dimCount, unsigned symbolCount,
AffineExpr result) { … }
AffineMap AffineMap::get(unsigned dimCount, unsigned symbolCount,
ArrayRef<AffineExpr> results, MLIRContext *context) { … }
IntegerSet IntegerSet::get(unsigned dimCount, unsigned symbolCount,
ArrayRef<AffineExpr> constraints,
ArrayRef<bool> eqFlags) { … }
llvm::unique_function<InFlightDiagnostic()>
mlir::detail::getDefaultDiagnosticEmitFn(MLIRContext *ctx) { … }
llvm::unique_function<InFlightDiagnostic()>
mlir::detail::getDefaultDiagnosticEmitFn(const Location &loc) { … }