[Mlir-commits] [mlir] [mlir][sparse] use shared value storage between wrapped iterator and the wrapper. (PR #80046)

Aart Bik llvmlistbot at llvm.org
Tue Jan 30 11:32:52 PST 2024


================
@@ -219,7 +242,16 @@ class SparseIterator {
   // For trivial iterators, it is the position; for dedup iterators, it consists
   // of the positon and the segment high, for non-empty subsection iterator, it
   // is the metadata that specifies the subsection.
-  MutableArrayRef<Value> itVals;
+  // Note that the wrapped iterator shares the same storage to maintain itVals
+  // with it wrapper, which means the wrapped iterator might only owns a subset
+  // of all the values stored in itValStorage.
+  const unsigned itValsCnt;
+  SmallVectorImpl<Value> &itValsStorageRef;
+  // All other (loop invariant) values used by the iterator. Although these
+  // values are not updated between loop iterations, they still need to be
+  // passed as function parameters to reconstruct the iterator in a new function
+  // scope.
+  // SmallVectorImpl<Value> &metaValsStorageRef;
----------------
aartbik wrote:

remove dead code?

https://github.com/llvm/llvm-project/pull/80046


More information about the Mlir-commits mailing list