MLIR 24.0.0git
RegisterAllDialects.cpp
Go to the documentation of this file.
1//===- RegisterAllDialects.cpp - MLIR Dialects Registration -----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This file defines a helper to trigger the registration of all dialects and
10// passes to the system.
11//
12//===----------------------------------------------------------------------===//
13
15
108#include "mlir/IR/Dialect.h"
114
115/// Add all the MLIR dialects to the provided registry.
117 // clang-format off
118 registry.insert<acc::OpenACCDialect,
119 affine::AffineDialect,
120 amdgpu::AMDGPUDialect,
121 arith::ArithDialect,
122 arm_neon::ArmNeonDialect,
123 arm_sme::ArmSMEDialect,
124 arm_sve::ArmSVEDialect,
125 async::AsyncDialect,
126 bufferization::BufferizationDialect,
127 cf::ControlFlowDialect,
128 complex::ComplexDialect,
129 DLTIDialect,
130 emitc::EmitCDialect,
131 func::FuncDialect,
132 gpu::GPUDialect,
133 index::IndexDialect,
134 irdl::IRDLDialect,
135 linalg::LinalgDialect,
136 LLVM::LLVMDialect,
137 math::MathDialect,
138 memref::MemRefDialect,
139 shard::ShardDialect,
140 ml_program::MLProgramDialect,
141 mpi::MPIDialect,
142 nvgpu::NVGPUDialect,
143 NVVM::NVVMDialect,
144 omp::OpenMPDialect,
145 pdl::PDLDialect,
146 pdl_interp::PDLInterpDialect,
147 ptr::PtrDialect,
148 quant::QuantDialect,
149 ROCDL::ROCDLDialect,
150 scf::SCFDialect,
151 shape::ShapeDialect,
152 smt::SMTDialect,
153 sparse_tensor::SparseTensorDialect,
154 spirv::SPIRVDialect,
155 tensor::TensorDialect,
156 tosa::TosaDialect,
157 transform::TransformDialect,
158 ub::UBDialect,
159 vector::VectorDialect,
160 wasmssa::WasmSSADialect,
161 x86::X86Dialect,
162 xegpu::XeGPUDialect,
163 xevm::XeVMDialect>();
164 // clang-format on
165
166 // Register all external models.
177 registry);
217}
218
219/// Append all the MLIR dialects to the registry contained in the given context.
221 DialectRegistry registry;
222 registerAllDialects(registry);
223 context.appendDialectRegistry(registry);
224}
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
MLIRContext is the top-level object for a collection of MLIR operations.
Definition MLIRContext.h:64
void appendDialectRegistry(const DialectRegistry &registry)
Append the contents of the given dialect registry to the registry associated with this context.
void registerInlinerInterface(DialectRegistry &registry)
Register the LLVMInlinerInterface implementation of DialectInlinerInterface with the LLVM dialect.
void registerNVVMTargetInterfaceExternalModels(DialectRegistry &registry)
Registers the TargetAttrInterface for the #nvvm.target attribute in the given registry.
Definition Target.cpp:73
void registerROCDLTargetInterfaceExternalModels(DialectRegistry &registry)
Registers the TargetAttrInterface for the #rocdl.target attribute in the given registry.
Definition Target.cpp:70
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerMemoryAccessOpInterfacesExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferViewFlowOpInterfaceExternalModels(DialectRegistry &registry)
void registerShardingInterfaceExternalModels(DialectRegistry &registry)
void registerBufferDeallocationOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerCastOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferDeallocationOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerIndexedAccessOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferDeallocationOpInterfaceExternalModels(DialectRegistry &registry)
void registerAllDialectInterfaceImplementations(DialectRegistry &registry)
void registerRuntimeVerifiableOpInterfaceExternalModels(DialectRegistry &registry)
void registerMemorySlotOpInterfaceExternalModels(DialectRegistry &registry)
void registerAllocationOpInterfaceExternalModels(DialectRegistry &registry)
void registerDestructurableTypeExternalModels(DialectRegistry &registry)
void registerBufferViewFlowOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerRuntimeVerifiableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerMemoryAccessOpInterfacesExternalModels(DialectRegistry &registry)
void registerBufferDeallocationOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerSPIRVTargetInterfaceExternalModels(DialectRegistry &registry)
Registers the TargetAttrInterface for the #spirv.target_env attribute in the given registry.
Definition Target.cpp:44
void registerInferTypeOpInterfaceExternalModels(mlir::DialectRegistry &registry)
Registers external models for Infer Type interfaces for tensor ops.
void registerSubsetOpInterfaceExternalModels(DialectRegistry &registry)
void registerFindPayloadReplacementOpInterfaceExternalModels(DialectRegistry &registry)
void registerTilingInterfaceExternalModels(mlir::DialectRegistry &registry)
Registers external models for Tiling interface for tensor ops.
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerRuntimeVerifiableOpInterfaceExternalModels(DialectRegistry &registry)
void registerShardingInterfaceExternalModels(DialectRegistry &registry)
void registerMemorySlotExternalModels(DialectRegistry &registry)
void registerSubsetOpInterfaceExternalModels(DialectRegistry &registry)
void registerIndexedAccessOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerXeVMTargetInterfaceExternalModels(mlir::DialectRegistry &registry)
Registers the TargetAttrInterface for the #xevm.target attribute in the given registry.
Definition Target.cpp:153
void registerAllDialects(DialectRegistry &registry)
Add all the MLIR dialects to the provided registry.