[Mlir-commits] [mlir] bca2b14 - [mlir][sparse] fix bufferizableOpInterface for InsertOp

Peiming Liu llvmlistbot at llvm.org
Mon Oct 24 09:45:26 PDT 2022


Author: Peiming Liu
Date: 2022-10-24T16:45:21Z
New Revision: bca2b14a59aa9928e471f719906ca6b0cf6004ab

URL: https://github.com/llvm/llvm-project/commit/bca2b14a59aa9928e471f719906ca6b0cf6004ab
DIFF: https://github.com/llvm/llvm-project/commit/bca2b14a59aa9928e471f719906ca6b0cf6004ab.diff

LOG: [mlir][sparse] fix bufferizableOpInterface for InsertOp

Address comments in D136372

Reviewed By: aartbik, springerm

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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/SparseTensor/Transforms/BufferizableOpInterfaceImpl.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/BufferizableOpInterfaceImpl.cpp
index 7c16cf6933a18..6de3957368fed 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/BufferizableOpInterfaceImpl.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/BufferizableOpInterfaceImpl.cpp
@@ -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


        


More information about the Mlir-commits mailing list