MLIR  21.0.0git
InitAllDialects.h
Go to the documentation of this file.
1 //===- InitAllDialects.h - 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 
14 #ifndef MLIR_INITALLDIALECTS_H_
15 #define MLIR_INITALLDIALECTS_H_
16 
37 #include "mlir/Dialect/DLTI/DLTI.h"
99 #include "mlir/IR/Dialect.h"
104 
105 namespace mlir {
106 
107 /// Add all the MLIR dialects to the provided registry.
108 inline void registerAllDialects(DialectRegistry &registry) {
109  // clang-format off
110  registry.insert<acc::OpenACCDialect,
111  affine::AffineDialect,
112  amdgpu::AMDGPUDialect,
113  amx::AMXDialect,
114  arith::ArithDialect,
115  arm_neon::ArmNeonDialect,
116  arm_sme::ArmSMEDialect,
117  arm_sve::ArmSVEDialect,
118  async::AsyncDialect,
119  bufferization::BufferizationDialect,
120  cf::ControlFlowDialect,
121  complex::ComplexDialect,
122  DLTIDialect,
123  emitc::EmitCDialect,
124  func::FuncDialect,
125  gpu::GPUDialect,
126  index::IndexDialect,
127  irdl::IRDLDialect,
128  linalg::LinalgDialect,
129  LLVM::LLVMDialect,
130  math::MathDialect,
131  memref::MemRefDialect,
132  mesh::MeshDialect,
133  ml_program::MLProgramDialect,
134  mpi::MPIDialect,
135  nvgpu::NVGPUDialect,
136  NVVM::NVVMDialect,
137  omp::OpenMPDialect,
138  pdl::PDLDialect,
139  pdl_interp::PDLInterpDialect,
140  polynomial::PolynomialDialect,
141  ptr::PtrDialect,
142  quant::QuantDialect,
143  ROCDL::ROCDLDialect,
144  scf::SCFDialect,
145  shape::ShapeDialect,
146  sparse_tensor::SparseTensorDialect,
147  spirv::SPIRVDialect,
148  tensor::TensorDialect,
149  tosa::TosaDialect,
150  transform::TransformDialect,
151  ub::UBDialect,
152  vector::VectorDialect,
153  x86vector::X86VectorDialect,
154  xegpu::XeGPUDialect>();
155  // clang-format on
156 
157  // Register all external models.
165  registry);
199 }
200 
201 /// Append all the MLIR dialects to the registry contained in the given context.
202 inline void registerAllDialects(MLIRContext &context) {
203  DialectRegistry registry;
204  registerAllDialects(registry);
205  context.appendDialectRegistry(registry);
206 }
207 
208 } // namespace mlir
209 
210 #endif // MLIR_INITALLDIALECTS_H_
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:60
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:71
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 registerShardingInterfaceExternalModels(DialectRegistry &registry)
void registerSubsetOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
Include the generated interface declarations.
void registerAllDialects(DialectRegistry &registry)
Add all the MLIR dialects to the provided registry.