17 #ifndef MLIR_DIALECT_UTILS_STRUCTUREDOPSUTILS_H
18 #define MLIR_DIALECT_UTILS_STRUCTUREDOPSUTILS_H
27 #include "mlir/Dialect/Utils/DialectUtilsEnums.h.inc"
54 utils::IteratorType iteratorTypeName,
57 if (en.value() == iteratorTypeName)
58 res.push_back(en.index());
65 template <
typename StructuredOpInterface,
typename IteratorTypeT>
72 bool isOfType(IteratorTypeT expectedIter)
const {
73 return expectedIter ==
iter;
92 for (
int i = 0, e = its.size(); i != e; ++i) {
101 return maps == infer(l);
118 template <
typename OpT>
121 return cast<OpT>(
clone(b, op.getOperation(), newResultTypes, newOperands));
127 TypeRange newResultTypes,
128 ValueRange newOperands);
132 SmallVector<NamedAttribute>
static MLIRContext * getContext(OpFoldResult val)
static SmallVector< AffineMap, 4 > inferFromExprList(ArrayRef< ArrayRef< AffineExpr >> exprsList)
Returns a vector of AffineMaps; each with as many results as exprs.size(), as many dims as the larges...
This class defines the main interface for locations in MLIR and acts as a non-nullable wrapper around...
MLIRContext is the top-level object for a collection of MLIR operations.
This class helps build Operations.
Operation is the basic unit of execution within MLIR.
This class coordinates the application of a rewrite on a set of IR, providing a way for clients to tr...
Helper StructuredGenerator class to manipulate and rewrite ops with StructuredOpInterface.
SmallVector< AffineMap, 4 > maps
bool iters(ArrayRef< IteratorType > its)
SmallVector< IteratorTypeT > iterators
StructuredGenerator(RewriterBase &rewriter, StructuredOpInterface op)
This class provides an abstraction over the various different ranges of value types.
This class provides an abstraction over the different types of ranges over Values.
constexpr void enumerate(std::tuple< Tys... > &tuple, CallbackT &&callback)
This header declares functions that assist transformations in the MemRef dialect.
bool isColumnMajorMatmul(ArrayAttr indexingMaps)
Tests whether the given maps describe a column major matmul.
Operation * cloneWithoutRegions(OpBuilder &b, Operation *op, TypeRange newResultTypes, ValueRange newOperands)
bool isRowMajorBatchMatmul(ArrayAttr indexingMaps)
Tests whether the given maps describe a row major batch matmul.
Operation * clone(OpBuilder &b, Operation *op, TypeRange newResultTypes, ValueRange newOperands)
void findPositionsOfType(ArrayRef< utils::IteratorType > iteratorTypes, utils::IteratorType iteratorTypeName, SmallVectorImpl< unsigned > &res)
Return positions in iteratorTypes that match iteratorTypeName.
bool isRowMajorMatmul(ArrayAttr indexingMaps)
Tests whether the given maps describe a row major matmul.
SmallVector< NamedAttribute > getPrunedAttributeList(Operation *op, ArrayRef< StringRef > elidedAttrs)
IteratorType(IteratorTypeT iter)
bool isOfType(IteratorTypeT expectedIter) const