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