MLIR  16.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 
30 #include "mlir/Dialect/DLTI/DLTI.h"
67 #include "mlir/IR/Dialect.h"
68 
69 namespace mlir {
70 
71 /// Add all the MLIR dialects to the provided registry.
72 inline void registerAllDialects(DialectRegistry &registry) {
73  // clang-format off
74  registry.insert<acc::OpenACCDialect,
75  AffineDialect,
76  arith::ArithmeticDialect,
77  amdgpu::AMDGPUDialect,
78  amx::AMXDialect,
79  arm_neon::ArmNeonDialect,
80  async::AsyncDialect,
81  bufferization::BufferizationDialect,
82  cf::ControlFlowDialect,
83  complex::ComplexDialect,
84  DLTIDialect,
85  emitc::EmitCDialect,
86  func::FuncDialect,
87  gpu::GPUDialect,
88  LLVM::LLVMDialect,
89  linalg::LinalgDialect,
90  math::MathDialect,
91  memref::MemRefDialect,
92  ml_program::MLProgramDialect,
93  nvgpu::NVGPUDialect,
94  scf::SCFDialect,
95  omp::OpenMPDialect,
96  pdl::PDLDialect,
97  pdl_interp::PDLInterpDialect,
98  quant::QuantizationDialect,
99  spirv::SPIRVDialect,
100  arm_sve::ArmSVEDialect,
101  vector::VectorDialect,
102  NVVM::NVVMDialect,
103  ROCDL::ROCDLDialect,
104  shape::ShapeDialect,
105  sparse_tensor::SparseTensorDialect,
106  tensor::TensorDialect,
107  transform::TransformDialect,
108  tosa::TosaDialect,
109  x86vector::X86VectorDialect>();
110  // clang-format on
111 
112  // Register all dialect extensions.
116 
117  // Register all external models.
120  registry);
130 }
131 
132 /// Append all the MLIR dialects to the registry contained in the given context.
133 inline void registerAllDialects(MLIRContext &context) {
134  DialectRegistry registry;
135  registerAllDialects(registry);
136  context.appendDialectRegistry(registry);
137 }
138 
139 } // namespace mlir
140 
141 #endif // MLIR_INITALLDIALECTS_H_
Include the generated interface declarations.
void registerTilingInterfaceExternalModels(DialectRegistry &registry)
void appendDialectRegistry(const DialectRegistry &registry)
Append the contents of the given dialect registry to the registry associated with this context...
void registerTilingOpInterfaceExternalModels(mlir::DialectRegistry &registry)
Registers external models for Tiling interface for tensor ops.
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerInferTypeOpInterfaceExternalModels(mlir::DialectRegistry &registry)
Registers external models for Infer Type interfaces for tensor ops.
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerTransformDialectExtension(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerTransformDialectExtension(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
void registerBufferizableOpInterfaceExternalModels(DialectRegistry &registry)
MLIRContext is the top-level object for a collection of MLIR operations.
Definition: MLIRContext.h:55
void registerAllDialects(DialectRegistry &registry)
Add all the MLIR dialects to the provided registry.
void registerTransformDialectExtension(DialectRegistry &registry)