MLIR  16.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 AffineForOp;
16 class Location;
17 struct LogicalResult;
18 class OpBuilder;
19 class Pass;
20 class RewritePattern;
21 class Value;
22 class ValueRange;
23 
24 class RewritePatternSet;
25 
26 #define GEN_PASS_DECL_CONVERTAFFINETOSTANDARD
27 #include "mlir/Conversion/Passes.h.inc"
28 
29 /// Collect a set of patterns to convert from the Affine dialect to the Standard
30 /// dialect, in particular convert structured affine control flow into CFG
31 /// branch-based control flow.
32 void populateAffineToStdConversionPatterns(RewritePatternSet &patterns);
33 
34 /// Collect a set of patterns to convert vector-related Affine ops to the Vector
35 /// dialect.
36 void populateAffineToVectorConversionPatterns(RewritePatternSet &patterns);
37 
38 /// Emit code that computes the lower bound of the given affine loop using
39 /// standard arithmetic operations.
40 Value lowerAffineLowerBound(AffineForOp op, OpBuilder &builder);
41 
42 /// Emit code that computes the upper bound of the given affine loop using
43 /// standard arithmetic operations.
44 Value lowerAffineUpperBound(AffineForOp op, OpBuilder &builder);
45 
46 /// Lowers affine control flow operations (ForStmt, IfStmt and AffineApplyOp)
47 /// to equivalent lower-level constructs (flow of basic blocks and arithmetic
48 /// primitives).
49 std::unique_ptr<Pass> createLowerAffinePass();
50 
51 } // namespace mlir
52 
53 #endif // MLIR_CONVERSION_AFFINETOSTANDARD_AFFINETOSTANDARD_H
Include the generated interface declarations.
Value lowerAffineUpperBound(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(AffineForOp op, OpBuilder &builder)
Emit code that computes the lower bound of the given affine loop using standard arithmetic operations...