18 #ifndef MLIR_DIALECT_FUNC_TRANSFORMS_DECOMPOSECALLGRAPHTYPES_H
19 #define MLIR_DIALECT_FUNC_TRANSFORMS_DECOMPOSECALLGRAPHTYPES_H
56 template <
typename FnT,
typename T =
typename llvm::function_traits<
57 std::decay_t<FnT>>::template arg_t<2>>
59 decomposeValueConversions.emplace_back(
60 wrapDecomposeValueConversionCallback<T>(std::forward<FnT>(callback)));
64 using DecomposeValueConversionCallFn =
65 std::function<std::optional<LogicalResult>(
69 template <
typename T,
typename FnT>
70 DecomposeValueConversionCallFn
71 wrapDecomposeValueConversionCallback(FnT &&callback) {
73 [callback = std::forward<FnT>(callback)](
76 if (T derivedType = dyn_cast<T>(type))
77 return callback(builder, loc, derivedType, value, newValues);
82 SmallVector<DecomposeValueConversionCallFn, 2> decomposeValueConversions;
88 TypeConverter &typeConverter,
89 ValueDecomposer &decomposer,
90 RewritePatternSet &patterns);
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
This class helps build Operations.
Instances of the Type class are uniqued, have an immutable identifier and an optional mutable compone...
This class provides a hook that expands one Value into multiple Value's, with a TypeConverter-inspire...
void addDecomposeValueConversion(FnT &&callback)
This method registers a callback function that will be called to decompose a value of a certain type ...
void decomposeValue(OpBuilder &, Location, Type, Value, SmallVectorImpl< Value > &)
This method tries to decompose a value of a certain type using provided decompose callback functions.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
Include the generated interface declarations.
void populateDecomposeCallGraphTypesPatterns(MLIRContext *context, TypeConverter &typeConverter, ValueDecomposer &decomposer, RewritePatternSet &patterns)
Populates the patterns needed to drive the conversion process for decomposing call graph types with t...