Skip to content

Commit 3fbd182

Browse files
authored
`CopyOpInterface` is dropped in upstream (llvm/llvm-project#157711). Move this interface to our codebase. Signed-off-by: Yu-Zhewen <[email protected]>
1 parent 84fd3d5 commit 3fbd182

File tree

9 files changed

+31
-18
lines changed

9 files changed

+31
-18
lines changed

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIEDmaOpInterface.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
#include "mlir/IR/Builders.h"
1313
#include "mlir/IR/OpImplementation.h"
1414
#include "mlir/IR/PatternMatch.h"
15-
#include "mlir/Interfaces/CopyOpInterface.h"
1615

1716
namespace mlir::iree_compiler::AMDAIE {
1817

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIEDmaOpInterface.td

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,31 @@
88
#define IREE_AMDAIE_DIALECT_DMAOPINTERFACE
99

1010
include "mlir/IR/OpBase.td"
11-
include "mlir/Interfaces/CopyOpInterface.td"
1211

1312
//===----------------------------------------------------------------------===//
1413
// Defines the interface for dma-like operations.
1514
//===----------------------------------------------------------------------===//
1615

16+
def CopyOpInterface : OpInterface<"CopyOpInterface"> {
17+
let description = [{
18+
A copy-like operation is one that copies from source value to target value.
19+
}];
20+
let cppNamespace = "mlir::iree_compiler::AMDAIE";
21+
22+
let methods = [
23+
InterfaceMethod<
24+
/*desc=*/"Returns the source value for this copy operation",
25+
/*retTy=*/"::mlir::Value",
26+
/*methodName=*/"getSource"
27+
>,
28+
InterfaceMethod<
29+
/*desc=*/"Returns the target value for this copy operation",
30+
/*retTy=*/"::mlir::Value",
31+
/*methodName=*/"getTarget"
32+
>
33+
];
34+
}
35+
1736
def DoublyStridedOpInterface : OpInterface<"DoublyStridedOpInterface"> {
1837
let description = [{
1938
Interface for operations with strided access pattern on both source and target.

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIELogicalObjFifoOpInterface.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ namespace mlir::iree_compiler::AMDAIE {
1313

1414
namespace detail {
1515

16-
SmallVector<mlir::CopyOpInterface> getCopyLikeConsumers(
16+
SmallVector<CopyOpInterface> getCopyLikeConsumers(
1717
LogicalObjFifoOpInterface op) {
18-
SmallVector<mlir::CopyOpInterface> copyLikOps;
18+
SmallVector<CopyOpInterface> copyLikOps;
1919
for (Operation *userOp : op->getUsers()) {
2020
if (auto copyOp = dyn_cast<CopyOpInterface>(userOp);
2121
copyOp && dyn_cast_if_present<LogicalObjFifoOpInterface>(
@@ -26,9 +26,9 @@ SmallVector<mlir::CopyOpInterface> getCopyLikeConsumers(
2626
return copyLikOps;
2727
}
2828

29-
SmallVector<mlir::CopyOpInterface> getCopyLikeProducers(
29+
SmallVector<CopyOpInterface> getCopyLikeProducers(
3030
LogicalObjFifoOpInterface op) {
31-
SmallVector<mlir::CopyOpInterface> copyLikOps;
31+
SmallVector<CopyOpInterface> copyLikOps;
3232
for (Operation *userOp : op->getUsers()) {
3333
if (auto copyOp = dyn_cast<CopyOpInterface>(userOp);
3434
copyOp && dyn_cast_if_present<LogicalObjFifoOpInterface>(

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIELogicalObjFifoOpInterface.h

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77
#ifndef IREE_COMPILER_AMDAIE_LOGICALOBJFIFOOPINTERFACE_H_
88
#define IREE_COMPILER_AMDAIE_LOGICALOBJFIFOOPINTERFACE_H_
99

10+
#include "iree-amd-aie/IR/AMDAIEDmaOpInterface.h"
1011
#include "mlir/IR/OpImplementation.h"
1112
#include "mlir/IR/PatternMatch.h"
12-
#include "mlir/Interfaces/CopyOpInterface.h"
1313

1414
namespace mlir::iree_compiler::AMDAIE {
1515

@@ -18,12 +18,10 @@ class LogicalObjFifoOpInterface;
1818
namespace detail {
1919

2020
/// Return the consumer copy-like operations of the logical objFifo.
21-
SmallVector<mlir::CopyOpInterface> getCopyLikeConsumers(
22-
LogicalObjFifoOpInterface op);
21+
SmallVector<CopyOpInterface> getCopyLikeConsumers(LogicalObjFifoOpInterface op);
2322

2423
/// Return the producer copy-like operations of the logical objFifo.
25-
SmallVector<mlir::CopyOpInterface> getCopyLikeProducers(
26-
LogicalObjFifoOpInterface op);
24+
SmallVector<CopyOpInterface> getCopyLikeProducers(LogicalObjFifoOpInterface op);
2725

2826
} // namespace detail
2927

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIELogicalObjFifoOpInterface.td

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
#define IREE_AMDAIE_DIALECT_LOGICALOBJFIFOOPINTERFACE
99

1010
include "mlir/IR/OpBase.td"
11-
include "mlir/Interfaces/CopyOpInterface.td"
11+
include "iree-amd-aie/IR/AMDAIEDmaOpInterface.td"
1212

1313
//===----------------------------------------------------------------------===//
1414
// Defines the interface for logical objectFifo operations.
@@ -41,7 +41,7 @@ def LogicalObjFifoOpInterface : OpInterface<"LogicalObjFifoOpInterface"> {
4141
/*desc=*/[{
4242
Return the consumer copy-like operations of the logical objFifo.
4343
}],
44-
/*retTy=*/"::llvm::SmallVector<::mlir::CopyOpInterface>",
44+
/*retTy=*/"::llvm::SmallVector<::mlir::iree_compiler::AMDAIE::CopyOpInterface>",
4545
/*methodName=*/"getCopyLikeConsumers",
4646
/*args=*/(ins),
4747
/*methodBody=*/"",
@@ -54,7 +54,7 @@ def LogicalObjFifoOpInterface : OpInterface<"LogicalObjFifoOpInterface"> {
5454
/*desc=*/[{
5555
Return the producer copy-like operations of the logical objFifo.
5656
}],
57-
/*retTy=*/"::llvm::SmallVector<::mlir::CopyOpInterface>",
57+
/*retTy=*/"::llvm::SmallVector<::mlir::iree_compiler::AMDAIE::CopyOpInterface>",
5858
/*methodName=*/"getCopyLikeProducers",
5959
/*args=*/(ins),
6060
/*methodBody=*/"",

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIEOps.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
#include "mlir/IR/BuiltinAttributes.h"
1717
#include "mlir/IR/BuiltinOps.h"
1818
#include "mlir/IR/BuiltinTypes.h"
19-
#include "mlir/Interfaces/CopyOpInterface.h"
2019
#include "mlir/Interfaces/ViewLikeInterface.h"
2120

2221
// clang-format off

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/AMDAIEOps.td

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
#ifndef IREE_AMDAIE_DIALECT_IREEAMDAIE_OPS
88
#define IREE_AMDAIE_DIALECT_IREEAMDAIE_OPS
99

10-
include "mlir/Interfaces/CopyOpInterface.td"
1110
include "mlir/Interfaces/InferTypeOpInterface.td"
1211
include "mlir/Interfaces/SideEffectInterfaces.td"
1312
include "mlir/Interfaces/ViewLikeInterface.td"

compiler/plugins/target/AMD-AIE/iree-amd-aie/IR/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ iree_cc_library(
5050
iree-amd-aie::aie_runtime::AMDAIEEnums
5151
LLVMSupport
5252
MLIRArithUtils
53-
MLIRCopyOpInterface
5453
MLIRDialectUtils
5554
MLIRIR
5655
MLIRParser

third_party/iree

Submodule iree updated 677 files

0 commit comments

Comments
 (0)