MLIR  18.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 
35 #include "mlir/Dialect/DLTI/DLTI.h"
90 #include "mlir/IR/Dialect.h"
95 
96 namespace mlir {
97 
98 /// Add all the MLIR dialects to the provided registry.
99 inline void registerAllDialects(DialectRegistry &registry) {
100  // clang-format off
101  registry.insert<acc::OpenACCDialect,
102  affine::AffineDialect,
103  amdgpu::AMDGPUDialect,
104  amx::AMXDialect,
105  arith::ArithDialect,
106  arm_neon::ArmNeonDialect,
107  arm_sme::ArmSMEDialect,
108  arm_sve::ArmSVEDialect,
109  async::AsyncDialect,
110  bufferization::BufferizationDialect,
111  cf::ControlFlowDialect,
112  complex::ComplexDialect,
113  DLTIDialect,
114  emitc::EmitCDialect,
115  func::FuncDialect,
116  gpu::GPUDialect,
117  index::IndexDialect,
118  irdl::IRDLDialect,
119  linalg::LinalgDialect,
120  LLVM::LLVMDialect,
121  math::MathDialect,
122  memref::MemRefDialect,
123  mesh::MeshDialect,
124  ml_program::MLProgramDialect,
125  nvgpu::NVGPUDialect,
126  NVVM::NVVMDialect,
127  omp::OpenMPDialect,
128  pdl::PDLDialect,
129  pdl_interp::PDLInterpDialect,
130  quant::QuantizationDialect,
131  ROCDL::ROCDLDialect,
132  scf::SCFDialect,
133  shape::ShapeDialect,
134  sparse_tensor::SparseTensorDialect,
135  spirv::SPIRVDialect,
136  tensor::TensorDialect,
137  tosa::TosaDialect,
138  transform::TransformDialect,
139  ub::UBDialect,
140  vector::VectorDialect,
141  x86vector::X86VectorDialect>();
142  // clang-format on
143 
144  // Register all external models.
150  registry);
180 }
181 
182 /// Append all the MLIR dialects to the registry contained in the given context.
183 inline void registerAllDialects(MLIRContext &context) {
184  DialectRegistry registry;
185  registerAllDialects(registry);
186  context.appendDialectRegistry(registry);
187 }
188 
189 } // namespace mlir
190 
191 #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:58
void registerROCDLTargetInterfaceExternalModels(DialectRegistry &registry)
Registers the TargetAttrInterface for the #rocdl.target attribute in the given registry.
Definition: Target.cpp:72
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(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 registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerSubsetOpInterfaceExternalModels(DialectRegistry &registry)
void registerTilingInterfaceExternalModels(DialectRegistry &registry)
void registerMemorySlotExternalModels(DialectRegistry &registry)
void registerAllocationOpInterfaceExternalModels(DialectRegistry &registry)
void registerValueBoundsOpInterfaceExternalModels(DialectRegistry &registry)
void registerRuntimeVerifiableOpInterfaceExternalModels(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)
Include the generated interface declarations.
void registerAllDialects(DialectRegistry &registry)
Add all the MLIR dialects to the provided registry.