MLIR  20.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 
36 #include "mlir/Dialect/DLTI/DLTI.h"
96 #include "mlir/IR/Dialect.h"
101 
102 namespace mlir {
103 
104 /// Add all the MLIR dialects to the provided registry.
105 inline void registerAllDialects(DialectRegistry &registry) {
106  // clang-format off
107  registry.insert<acc::OpenACCDialect,
108  affine::AffineDialect,
109  amdgpu::AMDGPUDialect,
110  amx::AMXDialect,
111  arith::ArithDialect,
112  arm_neon::ArmNeonDialect,
113  arm_sme::ArmSMEDialect,
114  arm_sve::ArmSVEDialect,
115  async::AsyncDialect,
116  bufferization::BufferizationDialect,
117  cf::ControlFlowDialect,
118  complex::ComplexDialect,
119  DLTIDialect,
120  emitc::EmitCDialect,
121  func::FuncDialect,
122  gpu::GPUDialect,
123  index::IndexDialect,
124  irdl::IRDLDialect,
125  linalg::LinalgDialect,
126  LLVM::LLVMDialect,
127  math::MathDialect,
128  memref::MemRefDialect,
129  mesh::MeshDialect,
130  ml_program::MLProgramDialect,
131  mpi::MPIDialect,
132  nvgpu::NVGPUDialect,
133  NVVM::NVVMDialect,
134  omp::OpenMPDialect,
135  pdl::PDLDialect,
136  pdl_interp::PDLInterpDialect,
137  polynomial::PolynomialDialect,
138  ptr::PtrDialect,
139  quant::QuantizationDialect,
140  ROCDL::ROCDLDialect,
141  scf::SCFDialect,
142  shape::ShapeDialect,
143  sparse_tensor::SparseTensorDialect,
144  spirv::SPIRVDialect,
145  tensor::TensorDialect,
146  tosa::TosaDialect,
147  transform::TransformDialect,
148  ub::UBDialect,
149  vector::VectorDialect,
150  x86vector::X86VectorDialect,
151  xegpu::XeGPUDialect>();
152  // clang-format on
153 
154  // Register all external models.
161  registry);
192 }
193 
194 /// Append all the MLIR dialects to the registry contained in the given context.
195 inline void registerAllDialects(MLIRContext &context) {
196  DialectRegistry registry;
197  registerAllDialects(registry);
198  context.appendDialectRegistry(registry);
199 }
200 
201 } // namespace mlir
202 
203 #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 registerNVVMTargetInterfaceExternalModels(DialectRegistry &registry)
Registers the TargetAttrInterface for the #nvvm.target attribute in the given registry.
Definition: Target.cpp:59
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 registerBufferDeallocationOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerCastOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferDeallocationOpInterfaceExternalModels(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.