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
31//===----------------------------------------------------------------------===//
32// Passes defined in Passes.td
33//===----------------------------------------------------------------------===//
34
35#define GEN_PASS_DECL
36
37#include "flang/Optimizer/Transforms/Passes.h.inc"
38
39std::unique_ptr<mlir::Pass> createAffineDemotionPass();
40std::unique_ptr<mlir::Pass>
41createArrayValueCopyPass(fir::ArrayValueCopyOptions options = {});
42std::unique_ptr<mlir::Pass> createMemDataFlowOptPass();
43std::unique_ptr<mlir::Pass> createPromoteToAffinePass();
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 populateFIRToSCFRewrites(mlir::RewritePatternSet &patterns,
57 bool parallelUnordered = false);
58
59void populateCfgConversionRewrites(mlir::RewritePatternSet &patterns,
60 bool forceLoopToExecuteOnce = false,
61 bool setNSW = true);
62
63void populateSimplifyFIROperationsPatterns(mlir::RewritePatternSet &patterns,
64 bool preferInlineImplementation);
65
66// declarative passes
67#define GEN_PASS_REGISTRATION
68#include "flang/Optimizer/Transforms/Passes.h.inc"
69
70} // namespace fir
71
72#endif // FORTRAN_OPTIMIZER_TRANSFORMS_PASSES_H
Definition AbstractConverter.h:37
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