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