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