FLANG
Passes.h
1//===-- Optimizer/Transforms/Passes.h ---------------------------*- 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#ifndef FORTRAN_OPTIMIZER_TRANSFORMS_PASSES_H
10#define FORTRAN_OPTIMIZER_TRANSFORMS_PASSES_H
11
12#include "flang/Optimizer/Dialect/CUF/CUFDialect.h"
13#include "flang/Optimizer/Dialect/FIROps.h"
14#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
15#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
16#include "mlir/Pass/Pass.h"
17#include "mlir/Pass/PassRegistry.h"
18#include <memory>
19
20namespace mlir {
21class IRMapping;
22class GreedyRewriteConfig;
23class Operation;
24class Pass;
25class Region;
26class ModuleOp;
27} // namespace mlir
28
29namespace fir {
30
38
39//===----------------------------------------------------------------------===//
40// Passes defined in Passes.td
41//===----------------------------------------------------------------------===//
42
43#define GEN_PASS_DECL
44
45#include "flang/Optimizer/Transforms/Passes.h.inc"
46
47std::unique_ptr<mlir::Pass> createAffineDemotionPass();
48std::unique_ptr<mlir::Pass>
49createArrayValueCopyPass(fir::ArrayValueCopyOptions options = {});
50std::unique_ptr<mlir::Pass> createMemDataFlowOptPass();
51std::unique_ptr<mlir::Pass> createPromoteToAffinePass();
52std::unique_ptr<mlir::Pass>
53createAddDebugInfoPass(fir::AddDebugInfoOptions options = {});
54
55std::unique_ptr<mlir::Pass> createAnnotateConstantOperandsPass();
56std::unique_ptr<mlir::Pass> createAlgebraicSimplificationPass();
57std::unique_ptr<mlir::Pass>
58createAlgebraicSimplificationPass(const mlir::GreedyRewriteConfig &config);
59
60std::unique_ptr<mlir::Pass> createVScaleAttrPass();
61std::unique_ptr<mlir::Pass>
62createVScaleAttrPass(std::pair<unsigned, unsigned> vscaleAttr);
63
64void populateFIRToSCFRewrites(mlir::RewritePatternSet &patterns,
65 bool parallelUnordered = false);
66
67void populateCfgConversionRewrites(mlir::RewritePatternSet &patterns,
68 bool forceLoopToExecuteOnce = false,
69 bool setNSW = true);
70
71void populateSimplifyFIROperationsPatterns(mlir::RewritePatternSet &patterns,
72 bool preferInlineImplementation);
73
74// declarative passes
75#define GEN_PASS_REGISTRATION
76#include "flang/Optimizer/Transforms/Passes.h.inc"
77
78} // namespace fir
79
80#endif // FORTRAN_OPTIMIZER_TRANSFORMS_PASSES_H
Definition AbstractConverter.h:37
LICMNestedHoistingMode
Definition Passes.h:33
@ Aggressive
Hoist all safe invariant ops.
Definition Passes.h:36
@ Cheap
Only hoist cheap ops like fir.convert.
Definition Passes.h:35
std::unique_ptr< mlir::Pass > createPromoteToAffinePass()
Convert FIR loop constructs to the Affine dialect.
Definition AffinePromotion.cpp:646
void populateCfgConversionRewrites(mlir::RewritePatternSet &patterns, bool forceLoopToExecuteOnce=false, bool setNSW=true)
Expose conversion rewriters to other passes.
Definition ControlFlowConverter.cpp:365
Definition AbstractConverter.h:32