1 | /** |
2 | * Copyright (c) Glow Contributors. See CONTRIBUTORS file. |
3 | * |
4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | * you may not use this file except in compliance with the License. |
6 | * You may obtain a copy of the License at |
7 | * |
8 | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | * |
10 | * Unless required by applicable law or agreed to in writing, software |
11 | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | * See the License for the specific language governing permissions and |
14 | * limitations under the License. |
15 | */ |
16 | #ifndef GLOW_OPTIMIZER_IROPTIMIZER_IRFUNCTIONPASSPIPELINE_H |
17 | #define GLOW_OPTIMIZER_IROPTIMIZER_IRFUNCTIONPASSPIPELINE_H |
18 | |
19 | #include "glow/Optimizer/IROptimizer/IRFunctionPass.h" |
20 | #include "glow/PassManager/Pipeline.h" |
21 | |
22 | namespace glow { |
23 | |
24 | /// Define an enum to identify all FunctionPasses, used to declare inside a |
25 | /// FunctionPassConfig for a Pipeline. |
26 | enum class IRFunctionPassID { |
27 | #define IR_FUN_PASS(PASS_NAME) PASS_NAME, |
28 | #include "glow/Optimizer/IROptimizer/IRPasses.def" |
29 | }; |
30 | |
31 | /// IR passes pipeline. |
32 | using IRFunctionPassPipeline = PassPipeline<IRFunctionPass>; |
33 | |
34 | /// \returns the default, target-independent IR optimization pipeline. |
35 | std::unique_ptr<IRFunctionPassPipeline> |
36 | createDefaultIRFunctionOptimizationPipeline(); |
37 | |
38 | /// \returns the name of a Pass given its \p passID. |
39 | llvm::StringRef getNameOfPass(IRFunctionPassID passID); |
40 | |
41 | } // namespace glow |
42 | |
43 | #endif // GLOW_OPTIMIZER_IROPTIMIZER_IRFUNCTIONPASSPIPELINE_H |
44 | |