MLIR  19.0.0git
AffineToStandard.h
Go to the documentation of this file.
1 //===- AffineToStandard.h - Convert Affine to Standard dialect --*- 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 MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H
10 #define MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H
11 
12 #include "mlir/Support/LLVM.h"
13 
14 namespace mlir {
15 class Location;
16 struct LogicalResult;
17 class OpBuilder;
18 class Pass;
19 class RewritePattern;
20 class RewritePatternSet;
21 class Value;
22 class ValueRange;
23 
24 namespace affine {
25 class AffineForOp;
26 } // namespace affine
27 
28 #define GEN_PASS_DECL_CONVERTAFFINETOSTANDARD
29 #include "mlir/Conversion/Passes.h.inc"
30 
31 /// Collect a set of patterns to convert from the Affine dialect to the Standard
32 /// dialect, in particular convert structured affine control flow into CFG
33 /// branch-based control flow.
34 void populateAffineToStdConversionPatterns(RewritePatternSet &patterns);
35 
36 /// Collect a set of patterns to convert vector-related Affine ops to the Vector
37 /// dialect.
38 void populateAffineToVectorConversionPatterns(RewritePatternSet &patterns);
39 
40 /// Emit code that computes the lower bound of the given affine loop using
41 /// standard arithmetic operations.
42 Value lowerAffineLowerBound(affine::AffineForOp op, OpBuilder &builder);
43 
44 /// Emit code that computes the upper bound of the given affine loop using
45 /// standard arithmetic operations.
46 Value lowerAffineUpperBound(affine::AffineForOp op, OpBuilder &builder);
47 
48 /// Lowers affine control flow operations (ForStmt, IfStmt and AffineApplyOp)
49 /// to equivalent lower-level constructs (flow of basic blocks and arithmetic
50 /// primitives).
51 std::unique_ptr<Pass> createLowerAffinePass();
52 
53 } // namespace mlir
54 
55 #endif // MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H
This class helps build Operations.
Definition: Builders.h:209
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Definition: Value.h:96
Include the generated interface declarations.
Value lowerAffineUpperBound(affine::AffineForOp op, OpBuilder &builder)
Emit code that computes the upper bound of the given affine loop using standard arithmetic operations...
void populateAffineToVectorConversionPatterns(RewritePatternSet &patterns)
Collect a set of patterns to convert vector-related Affine ops to the Vector dialect.
std::unique_ptr< Pass > createLowerAffinePass()
Lowers affine control flow operations (ForStmt, IfStmt and AffineApplyOp) to equivalent lower-level c...
void populateAffineToStdConversionPatterns(RewritePatternSet &patterns)
Collect a set of patterns to convert from the Affine dialect to the Standard dialect,...
Value lowerAffineLowerBound(affine::AffineForOp op, OpBuilder &builder)
Emit code that computes the lower bound of the given affine loop using standard arithmetic operations...