MLIR  22.0.0git
StructuralTypeConversions.h
Go to the documentation of this file.
1 //===- StructuralTypeConversions.h - CF Type Conversions --------*- 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_DIALECT_CONTROL_FLOW_TRANSFORMS_STRUCTURAL_TYPE_CONVERSIONS_H
10 #define MLIR_DIALECT_CONTROL_FLOW_TRANSFORMS_STRUCTURAL_TYPE_CONVERSIONS_H
11 
12 #include "mlir/IR/PatternMatch.h"
13 
14 namespace mlir {
15 
16 class ConversionTarget;
17 class TypeConverter;
18 
19 namespace cf {
20 
21 /// Populates patterns for CF structural type conversions and sets up the
22 /// provided ConversionTarget with the appropriate legality configuration for
23 /// the ops to get converted properly.
24 ///
25 /// A "structural" type conversion is one where the underlying ops are
26 /// completely agnostic to the actual types involved and simply need to update
27 /// their types. An example of this is cf.br -- the cf.br op needs to update
28 /// its types accordingly to the TypeConverter, but otherwise does not care
29 /// what type conversions are happening.
31  const TypeConverter &typeConverter, RewritePatternSet &patterns,
32  ConversionTarget &target, PatternBenefit benefit = 1);
33 
34 /// Similar to `populateCFStructuralTypeConversionsAndLegality` but does not
35 /// populate the conversion target.
36 void populateCFStructuralTypeConversions(const TypeConverter &typeConverter,
37  RewritePatternSet &patterns,
38  PatternBenefit benefit = 1);
39 
40 /// Updates the ConversionTarget with dynamic legality of CF operations based
41 /// on the provided type converter.
43  const TypeConverter &typeConverter, ConversionTarget &target);
44 
45 } // namespace cf
46 } // namespace mlir
47 
48 #endif // MLIR_DIALECT_CONTROL_FLOW_TRANSFORMS_STRUCTURAL_TYPE_CONVERSIONS_H
void populateCFStructuralTypeConversionTarget(const TypeConverter &typeConverter, ConversionTarget &target)
Updates the ConversionTarget with dynamic legality of CF operations based on the provided type conver...
void populateCFStructuralTypeConversions(const TypeConverter &typeConverter, RewritePatternSet &patterns, PatternBenefit benefit=1)
Similar to populateCFStructuralTypeConversionsAndLegality but does not populate the conversion target...
void populateCFStructuralTypeConversionsAndLegality(const TypeConverter &typeConverter, RewritePatternSet &patterns, ConversionTarget &target, PatternBenefit benefit=1)
Populates patterns for CF structural type conversions and sets up the provided ConversionTarget with ...
Include the generated interface declarations.
const FrozenRewritePatternSet & patterns