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/FIROps.h"
13#include "mlir/Dialect/LLVMIR/LLVMAttrs.h"
14#include "mlir/Dialect/OpenMP/OpenMPDialect.h"
15#include "mlir/Pass/Pass.h"
16#include "mlir/Pass/PassRegistry.h"
17#include <memory>
18
19namespace mlir {
20class IRMapping;
21class GreedyRewriteConfig;
22class Operation;
23class Pass;
24class Region;
25class ModuleOp;
26} // namespace mlir
27
28namespace fir {
29
30//===----------------------------------------------------------------------===//
31// Passes defined in Passes.td
32//===----------------------------------------------------------------------===//
33
34#define GEN_PASS_DECL
35
36#include "flang/Optimizer/Transforms/Passes.h.inc"
37
38std::unique_ptr<mlir::Pass> createAffineDemotionPass();
39std::unique_ptr<mlir::Pass>
40createArrayValueCopyPass(fir::ArrayValueCopyOptions options = {});
41std::unique_ptr<mlir::Pass> createMemDataFlowOptPass();
42std::unique_ptr<mlir::Pass> createPromoteToAffinePass();
43std::unique_ptr<mlir::Pass> createFIRToSCFPass();
44std::unique_ptr<mlir::Pass>
45createAddDebugInfoPass(fir::AddDebugInfoOptions options = {});
46
47std::unique_ptr<mlir::Pass> createAnnotateConstantOperandsPass();
48std::unique_ptr<mlir::Pass> createAlgebraicSimplificationPass();
49std::unique_ptr<mlir::Pass>
50createAlgebraicSimplificationPass(const mlir::GreedyRewriteConfig &config);
51
52std::unique_ptr<mlir::Pass> createVScaleAttrPass();
53std::unique_ptr<mlir::Pass>
54createVScaleAttrPass(std::pair<unsigned, unsigned> vscaleAttr);
55
56void populateCfgConversionRewrites(mlir::RewritePatternSet &patterns,
57 bool forceLoopToExecuteOnce = false,
58 bool setNSW = true);
59
60void populateSimplifyFIROperationsPatterns(mlir::RewritePatternSet &patterns,
61 bool preferInlineImplementation);
62
63// declarative passes
64#define GEN_PASS_REGISTRATION
65#include "flang/Optimizer/Transforms/Passes.h.inc"
66
67} // namespace fir
68
69#endif // FORTRAN_OPTIMIZER_TRANSFORMS_PASSES_H
Definition AbstractConverter.h:34
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:29