[Mlir-commits] [mlir] [mlir][sparse] assemble SoA COO correctly. (PR #82449)

Aart Bik llvmlistbot at llvm.org
Tue Feb 20 17:22:51 PST 2024


================
@@ -22,16 +22,13 @@ using namespace sparse_tensor;
 // Helper methods.
 //===----------------------------------------------------------------------===//
 
-// TODO: reuse StorageLayout::foreachField?
-
-// TODO: we need COO AoS and SoA
-
 // Convert type range to new types range, with sparse tensors externalized.
-void convTypes(TypeRange types, SmallVectorImpl<Type> &convTypes,
-               SmallVectorImpl<Type> *extraTypes = nullptr) {
+static void convTypes(TypeRange types, SmallVectorImpl<Type> &convTypes,
+                      SmallVectorImpl<Type> *extraTypes = nullptr) {
   for (auto type : types) {
+    auto enc = getSparseTensorEncoding(type);
     // All "dense" data passes through unmodified.
-    if (!getSparseTensorEncoding(type)) {
+    if (!enc) {
----------------
aartbik wrote:

why did you make this change?
we don't really use enc later?

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


More information about the Mlir-commits mailing list