MLIR 24.0.0git
SubsetOpInterface.h
Go to the documentation of this file.
1//===- SubsetOpInterface.h - Tensor Subsets ---------------------*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9#ifndef MLIR_INTERFACES_SUBSETOPINTERFACE_H_
10#define MLIR_INTERFACES_SUBSETOPINTERFACE_H_
11
13
14namespace mlir {
15class SubsetOpInterface;
16class SubsetExtractionOpInterface;
17class SubsetInsertionOpInterface;
18
19namespace detail {
20
21/// Return the destination/"init" operand of the op if it implements the
22/// `DestinationStyleOpInterface` and has exactly one "init" operand. Asserts
23/// otherwise.
24OpOperand &defaultGetDestinationOperand(Operation *op);
25
26/// Return the updated destination result of the op if it implements the
27/// `DestinationStyleOpInterface`.
28OpResult defaultGetUpdatedDestination(Operation *op);
29
30/// Default implementation of `SubsetInsertionOpInterface::isEquivalentSubset`.
31bool defaultIsEquivalentSubset(Operation *op, Value candidate,
32 function_ref<bool(Value, Value)> equivalenceFn);
33
34/// Default implementation of `SubsetOpInterface::operatesOnEquivalentSubset`.
36 Operation *op, SubsetOpInterface candidate,
37 function_ref<bool(Value, Value)> equivalenceFn);
38
39/// Default implementation of `SubsetOpInterface::operatesOnDisjointSubset`.
41 Operation *op, SubsetOpInterface candidate,
42 function_ref<bool(Value, Value)> equivalenceFn);
43
44/// Return the container that the given subset op is operating on.
45Value getTensorContainer(Operation *op);
46
47/// Verify `SubsetOpInterface`.
48LogicalResult verifySubsetOpInterface(SubsetOpInterface op);
49
50/// Verify `SubsetExtractionOpInterface`.
51LogicalResult verifySubsetExtractionOpInterface(SubsetExtractionOpInterface op);
52
53} // namespace detail
54} // namespace mlir
55
56#include "mlir/Interfaces/SubsetOpInterface.h.inc"
57
58#endif // MLIR_INTERFACES_SUBSETOPINTERFACE_H_
AttrTypeReplacer.
LogicalResult verifySubsetExtractionOpInterface(SubsetExtractionOpInterface op)
Verify SubsetExtractionOpInterface.
bool defaultOperatesOnDisjointSubset(Operation *op, SubsetOpInterface candidate, function_ref< bool(Value, Value)> equivalenceFn)
Default implementation of SubsetOpInterface::operatesOnDisjointSubset.
bool defaultOperatesOnEquivalentSubset(Operation *op, SubsetOpInterface candidate, function_ref< bool(Value, Value)> equivalenceFn)
Default implementation of SubsetOpInterface::operatesOnEquivalentSubset.
Value getTensorContainer(Operation *op)
Return the container that the given subset op is operating on.
OpResult defaultGetUpdatedDestination(Operation *op)
Return the updated destination result of the op if it implements the DestinationStyleOpInterface.
LogicalResult verifySubsetOpInterface(SubsetOpInterface op)
Verify SubsetOpInterface.
bool defaultIsEquivalentSubset(Operation *op, Value candidate, function_ref< bool(Value, Value)> equivalenceFn)
Default implementation of SubsetInsertionOpInterface::isEquivalentSubset.
OpOperand & defaultGetDestinationOperand(Operation *op)
Return the destination/"init" operand of the op if it implements the DestinationStyleOpInterface and ...
Include the generated interface declarations.
llvm::function_ref< Fn > function_ref
Definition LLVM.h:155