17 #ifndef MLIR_DIALECT_UTILS_STRUCTUREDOPSUTILS_H
18 #define MLIR_DIALECT_UTILS_STRUCTUREDOPSUTILS_H
27 #include "mlir/Dialect/Utils/DialectUtilsEnums.h.inc"
56 bool isVecmat(ArrayAttr indexingMaps);
68 bool isMatvec(ArrayAttr indexingMaps);
78 utils::IteratorType iteratorTypeName,
81 if (en.value() == iteratorTypeName)
82 res.push_back(en.index());
89 template <
typename StructuredOpInterface,
typename IteratorTypeT>
96 bool isOfType(IteratorTypeT expectedIter)
const {
97 return expectedIter ==
iter;
116 for (
int i = 0, e = its.size(); i != e; ++i) {
127 return maps == infer(l);
144 template <
typename OpT>
147 return cast<OpT>(
clone(b, op.getOperation(), newResultTypes, newOperands));
153 TypeRange newResultTypes,
154 ValueRange newOperands);
158 SmallVector<NamedAttribute>
static MLIRContext * getContext(OpFoldResult val)
static SmallVector< AffineMap, 4 > inferFromExprList(ArrayRef< ArrayRef< AffineExpr >> exprsList, MLIRContext *context)
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)
Include the generated interface declarations.
bool isColumnMajorMatmul(ArrayAttr indexingMaps)
Tests whether the given maps describe a column major matmul.
bool isBatchMatvec(ArrayAttr indexingMaps)
Tests whether the given maps describe a batch matrix vector multiplication.
Operation * cloneWithoutRegions(OpBuilder &b, Operation *op, TypeRange newResultTypes, ValueRange newOperands)
bool isMatvec(ArrayAttr indexingMaps)
Tests whether the given maps describe a matrix vector multiplication.
bool isBatchVecmat(ArrayAttr indexingMaps)
Tests whether the given maps describe a batch vector matrix multiplication.
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)
bool isVecmat(ArrayAttr indexingMaps)
Tests whether the given maps describe a vector matrix multiplication.
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