• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 //===- FuncConversions.h - Patterns for converting std.funcs ----*- 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 // This files contains patterns for converting standard functions.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef MLIR_DIALECT_STANDARDOPS_TRANSFORMS_FUNCCONVERSIONS_H_
14 #define MLIR_DIALECT_STANDARDOPS_TRANSFORMS_FUNCCONVERSIONS_H_
15 
16 namespace mlir {
17 
18 // Forward declarations.
19 class MLIRContext;
20 class OwningRewritePatternList;
21 class TypeConverter;
22 
23 /// Add a pattern to the given pattern list to convert the operand and result
24 /// types of a CallOp with the given type converter.
25 void populateCallOpTypeConversionPattern(OwningRewritePatternList &patterns,
26                                          MLIRContext *ctx,
27                                          TypeConverter &converter);
28 
29 /// Add a pattern to the given pattern list to rewrite branch operations and
30 /// `return` to use operands that have been legalized by the conversion
31 /// framework. This can only be done if the branch operation implements the
32 /// BranchOpInterface. Only needed for partial conversions.
33 void populateBranchOpInterfaceAndReturnOpTypeConversionPattern(
34     OwningRewritePatternList &patterns, MLIRContext *ctx,
35     TypeConverter &converter);
36 } // end namespace mlir
37 
38 #endif // MLIR_DIALECT_STANDARDOPS_TRANSFORMS_FUNCCONVERSIONS_H_
39