18 struct LinalgCopyOpSubsetOpInterface
19 :
public SubsetOpInterface::ExternalModel<LinalgCopyOpSubsetOpInterface,
21 bool operatesOnEquivalentSubset(
22 Operation *op, SubsetOpInterface candidate,
25 if (
auto otherCopyOp = dyn_cast<linalg::CopyOp>(candidate.getOperation()))
26 return equivalenceFn(cast<linalg::CopyOp>(op).getOutputs()[0],
27 otherCopyOp.getOutputs()[0]);
33 bool operatesOnDisjointSubset(
34 Operation *op, SubsetOpInterface candidate,
42 struct LinalgCopyOpInterface
43 :
public SubsetInsertionOpInterface::ExternalModel<LinalgCopyOpInterface,
46 auto copyOp = cast<CopyOp>(op);
47 assert(copyOp.getInputs().size() == 1 &&
"expected single input");
48 return copyOp.getInputsMutable()[0];
54 auto copyOp = cast<CopyOp>(op);
55 assert(copyOp.getOutputs().size() == 1 &&
"expected single output");
56 return equivalenceFn(candidate, copyOp.getOutputs()[0]);
61 auto copyOp = cast<CopyOp>(op);
62 assert(copyOp.getOutputs().size() == 1 &&
"expected single output");
63 return copyOp.getOutputs()[0];
67 getValuesNeededToBuildSubsetExtraction(
Operation *op)
const {
68 auto copyOp = cast<CopyOp>(op);
69 assert(copyOp.getOutputs().size() == 1 &&
"expected single output");
70 return {copyOp.getOutputs()[0]};
78 linalg::CopyOp::attachInterface<LinalgCopyOpSubsetOpInterface>(*ctx);
79 linalg::CopyOp::attachInterface<LinalgCopyOpInterface>(*ctx);
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.
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 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.