Skip to content

Commit 7be27bd

Browse files
Apply code review suggestions
1 parent d276ab7 commit 7be27bd

File tree

2 files changed

+9
-44
lines changed

2 files changed

+9
-44
lines changed

mlir/include/mlir/Dialect/Bufferization/IR/BufferizationTypeInterfaces.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,11 @@
1313
// Bufferization Type Interfaces
1414
//===----------------------------------------------------------------------===//
1515

16-
#include "mlir/IR/BuiltinTypes.h"
1716
#include "mlir/IR/Diagnostics.h"
1817
#include "mlir/IR/Types.h"
1918

2019
namespace mlir::bufferization {
2120
struct BufferizationOptions;
22-
class BufferizationState;
2321
class BufferLikeType;
2422
} // namespace mlir::bufferization
2523

mlir/test/lib/Dialect/Test/TestOps.td

Lines changed: 9 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -3615,29 +3615,16 @@ def TestAllocWithMultipleResults : TEST_Op<"alloc_with_multiple_results"> {
36153615
// Test Ops bufferization
36163616
//===----------------------------------------------------------------------===//
36173617

3618-
def TestDummyTensorOp : TEST_Op<"dummy_tensor_op", [BufferizableOpInterface]> {
3618+
def TestDummyTensorOp : TEST_Op<"dummy_tensor_op",
3619+
[DeclareOpInterfaceMethods<BufferizableOpInterface,
3620+
["bufferize", "bufferizesToMemoryRead",
3621+
"bufferizesToMemoryWrite", "getAliasingValues"]>]> {
36193622
let arguments = (ins
36203623
Arg<TestTensorType>:$input
36213624
);
36223625
let results = (outs
36233626
Arg<TestTensorType>:$output
36243627
);
3625-
let extraClassDeclaration = [{
3626-
// BufferizableOpInterface
3627-
bool bufferizesToMemoryRead(mlir::OpOperand&,
3628-
const mlir::bufferization::AnalysisState&);
3629-
3630-
bool bufferizesToMemoryWrite(mlir::OpOperand&,
3631-
const mlir::bufferization::AnalysisState&);
3632-
3633-
mlir::bufferization::AliasingValueList getAliasingValues(mlir::OpOperand&,
3634-
const mlir::bufferization::AnalysisState&);
3635-
3636-
mlir::LogicalResult bufferize(
3637-
mlir::RewriterBase& rewriter,
3638-
const mlir::bufferization::BufferizationOptions& options,
3639-
mlir::bufferization::BufferizationState &state);
3640-
}];
36413628

36423629
let extraClassDefinition = [{
36433630
bool test::TestDummyTensorOp::bufferizesToMemoryRead(::mlir::OpOperand&,
@@ -3665,33 +3652,13 @@ def TestDummyMemrefOp : TEST_Op<"dummy_memref_op", []> {
36653652
);
36663653
}
36673654

3668-
def TestCreateTensorOp : TEST_Op<"create_tensor_op", [BufferizableOpInterface]> {
3655+
def TestCreateTensorOp : TEST_Op<"create_tensor_op",
3656+
[DeclareOpInterfaceMethods<BufferizableOpInterface,
3657+
["bufferize", "getBufferType", "bufferizesToMemoryRead",
3658+
"bufferizesToMemoryWrite", "getAliasingValues",
3659+
"bufferizesToAllocation"]>]> {
36693660
let arguments = (ins);
36703661
let results = (outs Arg<TestTensorType>:$output);
3671-
let extraClassDeclaration = [{
3672-
// BufferizableOpInterface
3673-
bool bufferizesToMemoryRead(mlir::OpOperand&,
3674-
const mlir::bufferization::AnalysisState&);
3675-
3676-
bool bufferizesToMemoryWrite(mlir::OpOperand&,
3677-
const mlir::bufferization::AnalysisState&);
3678-
3679-
bool bufferizesToAllocation(mlir::Value value);
3680-
3681-
mlir::bufferization::AliasingValueList getAliasingValues(mlir::OpOperand&,
3682-
const mlir::bufferization::AnalysisState&);
3683-
3684-
mlir::LogicalResult bufferize(
3685-
mlir::RewriterBase& rewriter,
3686-
const mlir::bufferization::BufferizationOptions& options,
3687-
mlir::bufferization::BufferizationState &state);
3688-
3689-
mlir::FailureOr<mlir::bufferization::BufferLikeType> getBufferType(
3690-
mlir::Value value, const mlir::bufferization::BufferizationOptions &,
3691-
const mlir::bufferization::BufferizationState &,
3692-
llvm::SmallVector<::mlir::Value> &);
3693-
}];
3694-
36953662
let extraClassDefinition = [{
36963663
bool test::TestCreateTensorOp::bufferizesToMemoryRead(::mlir::OpOperand&,
36973664
const ::mlir::bufferization::AnalysisState&) {

0 commit comments

Comments
 (0)