[mlir][sparse] fix bufferizableOpInterface for InsertOp
authorPeiming Liu <peiming@google.com>
Fri, 21 Oct 2022 23:21:53 +0000 (23:21 +0000)
committerPeiming Liu <peiming@google.com>
Mon, 24 Oct 2022 16:45:21 +0000 (16:45 +0000)
Address comments in D136372

Reviewed By: aartbik, springerm

Differential Revision: https://reviews.llvm.org/D136510

mlir/lib/Dialect/SparseTensor/Transforms/BufferizableOpInterfaceImpl.cpp

index 7c16cf6..6de3957 100644 (file)
@@ -97,14 +97,9 @@ struct NewOpInterface
 struct InsertOpInterface
     : public BufferizableOpInterface::ExternalModel<InsertOpInterface,
                                                     sparse_tensor::InsertOp> {
-  bool bufferizesToAllocation(Operation *op, OpResult opResult) const {
-    // Does bufferization handle realloc?
-    return false;
-  }
-
   bool bufferizesToMemoryRead(Operation *op, OpOperand &opOperand,
                               const AnalysisState &state) const {
-    return false;
+    return true;
   }
 
   bool bufferizesToMemoryWrite(Operation *op, OpOperand &opOperand,
@@ -126,11 +121,6 @@ struct InsertOpInterface
     // aliases).
     return BufferRelation::Equivalent;
   }
-
-  bool isWritable(Operation *op, Value value,
-                  const AnalysisState &state) const {
-    return true;
-  }
 };
 
 } // namespace