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