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
107#include "mlir/IR/Dialect.h"
113
114/// Add all the MLIR dialects to the provided registry.
116 // clang-format off
117 registry.insert<acc::OpenACCDialect,
118 affine::AffineDialect,
119 amdgpu::AMDGPUDialect,
120 arith::ArithDialect,
121 arm_neon::ArmNeonDialect,
122 arm_sme::ArmSMEDialect,
123 arm_sve::ArmSVEDialect,
124 async::AsyncDialect,
125 bufferization::BufferizationDialect,
126 cf::ControlFlowDialect,
127 complex::ComplexDialect,
128 DLTIDialect,
129 emitc::EmitCDialect,
130 func::FuncDialect,
131 gpu::GPUDialect,
132 index::IndexDialect,
133 irdl::IRDLDialect,
134 linalg::LinalgDialect,
135 LLVM::LLVMDialect,
136 math::MathDialect,
137 memref::MemRefDialect,
138 shard::ShardDialect,
139 ml_program::MLProgramDialect,
140 mpi::MPIDialect,
141 nvgpu::NVGPUDialect,
142 NVVM::NVVMDialect,
143 omp::OpenMPDialect,
144 pdl::PDLDialect,
145 pdl_interp::PDLInterpDialect,
146 ptr::PtrDialect,
147 quant::QuantDialect,
148 ROCDL::ROCDLDialect,
149 scf::SCFDialect,
150 shape::ShapeDialect,
151 smt::SMTDialect,
152 sparse_tensor::SparseTensorDialect,
153 spirv::SPIRVDialect,
154 tensor::TensorDialect,
155 tosa::TosaDialect,
156 transform::TransformDialect,
157 ub::UBDialect,
158 vector::VectorDialect,
159 wasmssa::WasmSSADialect,
160 x86::X86Dialect,
161 xegpu::XeGPUDialect,
162 xevm::XeVMDialect>();
163 // clang-format on
164
165 // Register all external models.
176 registry);
215}
216
217/// Append all the MLIR dialects to the registry contained in the given context.
219 DialectRegistry registry;
220 registerAllDialects(registry);
221 context.appendDialectRegistry(registry);
222}
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:63
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 registerMemorySlotExternalModels(DialectRegistry &registry)
void registerAllocationOpInterfaceExternalModels(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 registerSubsetOpInterfaceExternalModels(DialectRegistry &registry)
void registerIndexedAccessOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerMemorySlotOpInterfaceExternalModels(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.