• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
17 #include "mlir/Dialect/AVX512/AVX512Dialect.h"
18 #include "mlir/Dialect/Affine/IR/AffineOps.h"
19 #include "mlir/Dialect/Async/IR/Async.h"
20 #include "mlir/Dialect/GPU/GPUDialect.h"
21 #include "mlir/Dialect/LLVMIR/LLVMAVX512Dialect.h"
22 #include "mlir/Dialect/LLVMIR/LLVMDialect.h"
23 #include "mlir/Dialect/LLVMIR/NVVMDialect.h"
24 #include "mlir/Dialect/LLVMIR/ROCDLDialect.h"
25 #include "mlir/Dialect/Linalg/IR/LinalgOps.h"
26 #include "mlir/Dialect/OpenACC/OpenACC.h"
27 #include "mlir/Dialect/OpenMP/OpenMPDialect.h"
28 #include "mlir/Dialect/PDL/IR/PDL.h"
29 #include "mlir/Dialect/PDLInterp/IR/PDLInterp.h"
30 #include "mlir/Dialect/Quant/QuantOps.h"
31 #include "mlir/Dialect/SCF/SCF.h"
32 #include "mlir/Dialect/SDBM/SDBMDialect.h"
33 #include "mlir/Dialect/SPIRV/SPIRVDialect.h"
34 #include "mlir/Dialect/Shape/IR/Shape.h"
35 #include "mlir/Dialect/StandardOps/IR/Ops.h"
36 #include "mlir/Dialect/Tosa/IR/TosaOps.h"
37 #include "mlir/Dialect/Vector/VectorOps.h"
38 #include "mlir/IR/Dialect.h"
39 
40 namespace mlir {
41 
42 // Add all the MLIR dialects to the provided registry.
registerAllDialects(DialectRegistry & registry)43 inline void registerAllDialects(DialectRegistry &registry) {
44   // clang-format off
45   registry.insert<acc::OpenACCDialect,
46                   AffineDialect,
47                   async::AsyncDialect,
48                   avx512::AVX512Dialect,
49                   gpu::GPUDialect,
50                   LLVM::LLVMAVX512Dialect,
51                   LLVM::LLVMDialect,
52                   linalg::LinalgDialect,
53                   scf::SCFDialect,
54                   omp::OpenMPDialect,
55                   pdl::PDLDialect,
56                   pdl_interp::PDLInterpDialect,
57                   quant::QuantizationDialect,
58                   spirv::SPIRVDialect,
59                   StandardOpsDialect,
60                   vector::VectorDialect,
61                   NVVM::NVVMDialect,
62                   ROCDL::ROCDLDialect,
63                   SDBMDialect,
64                   shape::ShapeDialect,
65                   tosa::TosaDialect>();
66   // clang-format on
67 }
68 
69 } // namespace mlir
70 
71 #endif // MLIR_INITALLDIALECTS_H_
72