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