@@ -3615,29 +3615,16 @@ def TestAllocWithMultipleResults : TEST_Op<"alloc_with_multiple_results"> {
3615
3615
// Test Ops bufferization
3616
3616
//===----------------------------------------------------------------------===//
3617
3617
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"]>]> {
3619
3622
let arguments = (ins
3620
3623
Arg<TestTensorType>:$input
3621
3624
);
3622
3625
let results = (outs
3623
3626
Arg<TestTensorType>:$output
3624
3627
);
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
- }];
3641
3628
3642
3629
let extraClassDefinition = [{
3643
3630
bool test::TestDummyTensorOp::bufferizesToMemoryRead(::mlir::OpOperand&,
@@ -3665,33 +3652,13 @@ def TestDummyMemrefOp : TEST_Op<"dummy_memref_op", []> {
3665
3652
);
3666
3653
}
3667
3654
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"]>]> {
3669
3660
let arguments = (ins);
3670
3661
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
-
3695
3662
let extraClassDefinition = [{
3696
3663
bool test::TestCreateTensorOp::bufferizesToMemoryRead(::mlir::OpOperand&,
3697
3664
const ::mlir::bufferization::AnalysisState&) {
0 commit comments