1 | //===- Passes.h - SPIR-V pass entry points ----------------------*- 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 header file defines prototypes that expose pass constructors. |
10 | // |
11 | //===----------------------------------------------------------------------===// |
12 | |
13 | #ifndef MLIR_DIALECT_SPIRV_TRANSFORMS_PASSES_H_ |
14 | #define MLIR_DIALECT_SPIRV_TRANSFORMS_PASSES_H_ |
15 | |
16 | #include "mlir/Dialect/SPIRV/IR/SPIRVAttributes.h" |
17 | #include "mlir/Pass/Pass.h" |
18 | |
19 | namespace mlir { |
20 | |
21 | class ModuleOp; |
22 | |
23 | namespace spirv { |
24 | |
25 | class ModuleOp; |
26 | |
27 | //===----------------------------------------------------------------------===// |
28 | // Passes |
29 | //===----------------------------------------------------------------------===// |
30 | |
31 | #define GEN_PASS_DECL |
32 | #include "mlir/Dialect/SPIRV/Transforms/Passes.h.inc" |
33 | |
34 | /// Creates an operation pass that unifies access of multiple aliased resources |
35 | /// into access of one single resource. |
36 | using GetTargetEnvFn = std::function<spirv::TargetEnvAttr(spirv::ModuleOp)>; |
37 | std::unique_ptr<OperationPass<spirv::ModuleOp>> |
38 | createUnifyAliasedResourcePass(GetTargetEnvFn getTargetEnv = nullptr); |
39 | |
40 | //===----------------------------------------------------------------------===// |
41 | // Registration |
42 | //===----------------------------------------------------------------------===// |
43 | |
44 | /// Generate the code for registering passes. |
45 | #define GEN_PASS_REGISTRATION |
46 | #include "mlir/Dialect/SPIRV/Transforms/Passes.h.inc" |
47 | |
48 | } // namespace spirv |
49 | } // namespace mlir |
50 | |
51 | #endif // MLIR_DIALECT_SPIRV_TRANSFORMS_PASSES_H_ |
52 | |