19 template <
typename OpTy>
20 struct XferOpSubsetOpInterface
21 :
public SubsetOpInterface::ExternalModel<XferOpSubsetOpInterface<OpTy>,
23 FailureOr<HyperrectangularSlice>
24 getAccessedHyperrectangularSlice(
Operation *op)
const {
25 auto xferOp = cast<OpTy>(op);
26 Builder b(xferOp->getContext());
30 xferOp.getTransferChunkAccessed(),
31 [&](int64_t sz) ->
OpFoldResult { return b.getIndexAttr(sz); });
36 struct TransferReadOpSubsetExtractionOpInterface
37 :
public SubsetExtractionOpInterface::ExternalModel<
38 TransferReadOpSubsetExtractionOpInterface, vector::TransferReadOp> {
40 return cast<vector::TransferReadOp>(op).getSourceMutable();
44 struct TransferWriteOpSubsetInsertionOpInterface
45 :
public SubsetInsertionOpInterface::ExternalModel<
46 TransferWriteOpSubsetInsertionOpInterface, vector::TransferWriteOp> {
48 return cast<vector::TransferWriteOp>(op).getVectorMutable();
52 return cast<vector::TransferWriteOp>(op).getSourceMutable();
62 getValuesNeededToBuildSubsetExtraction(
Operation *op)
const {
73 TransferReadOp::attachInterface<XferOpSubsetOpInterface<TransferReadOp>>(
75 TransferReadOp::attachInterface<TransferReadOpSubsetExtractionOpInterface>(
77 TransferWriteOp::attachInterface<XferOpSubsetOpInterface<TransferWriteOp>>(
79 TransferWriteOp::attachInterface<TransferWriteOpSubsetInsertionOpInterface>(
This class is a general helper class for creating context-global objects like types,...
The DialectRegistry maps a dialect namespace to a constructor for the matching dialect.
bool addExtension(TypeID extensionID, std::unique_ptr< DialectExtensionBase > extension)
Add the given extension to the registry.
A hyperrectangular slice, represented as a list of offsets, sizes and strides.
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.
This class represents a single result from folding an operation.
This class represents an operand of an operation.
Operation is the basic unit of execution within MLIR.
This class represents an instance of an SSA value in the MLIR system, representing a computable value...
void registerSubsetOpInterfaceExternalModels(DialectRegistry ®istry)
Include the generated interface declarations.