13 #ifndef MLIR_INTERFACES_VIEWLIKEINTERFACE_H_
14 #define MLIR_INTERFACES_VIEWLIKEINTERFACE_H_
25 class OffsetSizeAndStrideOpInterface;
32 OffsetSizeAndStrideOpInterface a, OffsetSizeAndStrideOpInterface b,
44 #include "mlir/Interfaces/ViewLikeInterface.h.inc"
57 template <
typename OpType,
typename ResultTypeFn,
typename CastOpFunc>
77 ResultTypeFn()(op, mixedOffsets, mixedSizes, mixedStrides);
81 rewriter.
create<OpType>(op.getLoc(), resultType, op.getSource(),
82 mixedOffsets, mixedSizes, mixedStrides);
83 CastOpFunc()(rewriter, op, newOp);
108 OpAsmPrinter &printer, Operation *op, OperandRange values,
109 ArrayRef<int64_t> integers, ArrayRef<bool> scalables,
110 TypeRange valueTypes = TypeRange(),
150 SmallVectorImpl<OpAsmParser::UnresolvedOperand> &values,
152 SmallVectorImpl<Type> *valueTypes =
nullptr,
170 valueTypes, delimiter);
179 &valueTypes, delimiter);
189 &valueTypes, delimiter);
195 unsigned expectedNumElements,
196 ArrayRef<int64_t> attr,
Delimiter
These are the supported delimiters around operand lists and region argument lists,...
@ Square
Square brackets surrounding zero or more operands.
The OpAsmParser has methods for interacting with the asm parser: parsing things from it,...
This is a pure-virtual base class that exposes the asmprinter hooks necessary to implement a custom p...
Operation * create(const OperationState &state)
Creates an operation given the fields represented as an OperationState.
Pattern to rewrite dynamic offsets/sizes/strides of view/slice-like ops as constant arguments.
LogicalResult matchAndRewrite(OpType op, PatternRewriter &rewriter) const override
This class implements the operand iterators for the Operation class.
Operation is the basic unit of execution within MLIR.
A special type of RewriterBase that coordinates the application of a rewrite pattern on the current I...
This class provides an abstraction over the various different ranges of value types.
Base class for DenseArrayAttr that is instantiated and specialized for each supported element type be...
bool sameOffsetsSizesAndStrides(OffsetSizeAndStrideOpInterface a, OffsetSizeAndStrideOpInterface b, llvm::function_ref< bool(OpFoldResult, OpFoldResult)> cmp)
unsigned getNumDynamicEntriesUpToIdx(ArrayRef< int64_t > staticVals, unsigned idx)
Helper method to compute the number of dynamic entries of staticVals, up to idx.
LogicalResult verifyOffsetSizeAndStrideOp(OffsetSizeAndStrideOpInterface op)
Include the generated interface declarations.
detail::DenseArrayAttrImpl< int64_t > DenseI64ArrayAttr
void printDynamicIndexList(OpAsmPrinter &printer, Operation *op, OperandRange values, ArrayRef< int64_t > integers, ArrayRef< bool > scalables, TypeRange valueTypes=TypeRange(), AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square)
Printer hook for custom directive in assemblyFormat.
detail::DenseArrayAttrImpl< bool > DenseBoolArrayAttr
LogicalResult verifyListOfOperandsOrIntegers(Operation *op, StringRef name, unsigned expectedNumElements, ArrayRef< int64_t > attr, ValueRange values)
Verify that a the values has as many elements as the number of entries in attr for which isDynamic ev...
ParseResult parseDynamicIndexList(OpAsmParser &parser, SmallVectorImpl< OpAsmParser::UnresolvedOperand > &values, DenseI64ArrayAttr &integers, DenseBoolArrayAttr &scalableVals, SmallVectorImpl< Type > *valueTypes=nullptr, AsmParser::Delimiter delimiter=AsmParser::Delimiter::Square)
Parser hook for custom directive in assemblyFormat.
LogicalResult foldDynamicIndexList(SmallVectorImpl< OpFoldResult > &ofrs, bool onlyNonNegative=false, bool onlyNonZero=false)
Returns "success" when any of the elements in ofrs is a constant value.
OpRewritePattern is a wrapper around RewritePattern that allows for matching and rewriting against an...