1 | //===- LinkAllPassesAndDialects.h - MLIR 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_INITALLPASSES_H_ |
15 | #define MLIR_INITALLPASSES_H_ |
16 | |
17 | #include "mlir/Config/mlir-config.h" |
18 | #include "mlir/Conversion/Passes.h" |
19 | #include "mlir/Dialect/AMDGPU/Transforms/Passes.h" |
20 | #include "mlir/Dialect/Affine/Passes.h" |
21 | #include "mlir/Dialect/Arith/Transforms/Passes.h" |
22 | #include "mlir/Dialect/ArmSME/Transforms/Passes.h" |
23 | #include "mlir/Dialect/ArmSVE/Transforms/Passes.h" |
24 | #include "mlir/Dialect/Async/Passes.h" |
25 | #include "mlir/Dialect/Bufferization/Pipelines/Passes.h" |
26 | #include "mlir/Dialect/Bufferization/Transforms/Passes.h" |
27 | #include "mlir/Dialect/EmitC/Transforms/Passes.h" |
28 | #include "mlir/Dialect/Func/Transforms/Passes.h" |
29 | #include "mlir/Dialect/GPU/Pipelines/Passes.h" |
30 | #include "mlir/Dialect/GPU/Transforms/Passes.h" |
31 | #include "mlir/Dialect/LLVMIR/Transforms/Passes.h" |
32 | #include "mlir/Dialect/Linalg/Passes.h" |
33 | #include "mlir/Dialect/MLProgram/Transforms/Passes.h" |
34 | #include "mlir/Dialect/Math/Transforms/Passes.h" |
35 | #include "mlir/Dialect/MemRef/Transforms/Passes.h" |
36 | #include "mlir/Dialect/Mesh/Transforms/Passes.h" |
37 | #include "mlir/Dialect/NVGPU/Transforms/Passes.h" |
38 | #include "mlir/Dialect/OpenACC/Transforms/Passes.h" |
39 | #include "mlir/Dialect/SCF/Transforms/Passes.h" |
40 | #include "mlir/Dialect/SPIRV/Transforms/Passes.h" |
41 | #include "mlir/Dialect/Shape/Transforms/Passes.h" |
42 | #include "mlir/Dialect/SparseTensor/Pipelines/Passes.h" |
43 | #include "mlir/Dialect/SparseTensor/Transforms/Passes.h" |
44 | #include "mlir/Dialect/Tensor/Transforms/Passes.h" |
45 | #include "mlir/Dialect/Tosa/Transforms/Passes.h" |
46 | #include "mlir/Dialect/Transform/Transforms/Passes.h" |
47 | #include "mlir/Dialect/Vector/Transforms/Passes.h" |
48 | #include "mlir/Dialect/XeGPU/Transforms/Passes.h" |
49 | #include "mlir/Transforms/Passes.h" |
50 | |
51 | #include <cstdlib> |
52 | |
53 | namespace mlir { |
54 | |
55 | // This function may be called to register the MLIR passes with the |
56 | // global registry. |
57 | // If you're building a compiler, you likely don't need this: you would build a |
58 | // pipeline programmatically without the need to register with the global |
59 | // registry, since it would already be calling the creation routine of the |
60 | // individual passes. |
61 | // The global registry is interesting to interact with the command-line tools. |
62 | inline void registerAllPasses() { |
63 | // General passes |
64 | registerTransformsPasses(); |
65 | |
66 | // Conversion passes |
67 | registerConversionPasses(); |
68 | |
69 | // Dialect passes |
70 | acc::registerOpenACCPasses(); |
71 | affine::registerAffinePasses(); |
72 | amdgpu::registerAMDGPUPasses(); |
73 | registerAsyncPasses(); |
74 | arith::registerArithPasses(); |
75 | bufferization::registerBufferizationPasses(); |
76 | func::registerFuncPasses(); |
77 | registerGPUPasses(); |
78 | registerLinalgPasses(); |
79 | registerNVGPUPasses(); |
80 | registerSparseTensorPasses(); |
81 | LLVM::registerLLVMPasses(); |
82 | math::registerMathPasses(); |
83 | memref::registerMemRefPasses(); |
84 | mesh::registerMeshPasses(); |
85 | ml_program::registerMLProgramPasses(); |
86 | registerSCFPasses(); |
87 | registerShapePasses(); |
88 | spirv::registerSPIRVPasses(); |
89 | tensor::registerTensorPasses(); |
90 | tosa::registerTosaOptPasses(); |
91 | transform::registerTransformPasses(); |
92 | vector::registerVectorPasses(); |
93 | arm_sme::registerArmSMEPasses(); |
94 | arm_sve::registerArmSVEPasses(); |
95 | emitc::registerEmitCPasses(); |
96 | xegpu::registerXeGPUPasses(); |
97 | |
98 | // Dialect pipelines |
99 | bufferization::registerBufferizationPipelines(); |
100 | sparse_tensor::registerSparseTensorPipelines(); |
101 | tosa::registerTosaToLinalgPipelines(); |
102 | #if MLIR_ENABLE_CUDA_CONVERSIONS |
103 | gpu::registerGPUToNVVMPipeline(); |
104 | #endif |
105 | } |
106 | |
107 | } // namespace mlir |
108 | |
109 | #endif // MLIR_INITALLPASSES_H_ |
110 |