[Mlir-commits] [mlir] [mlir][sparse] Collapse dense and compressed iteration ranges (PR #211154)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Aug 5 11:56:56 PDT 2026


================
@@ -168,6 +174,17 @@ class CompressedLevel : public SparseLevel</*hasPosBuf=*/true> {
     ValueRange posRange = posRangeIf.getResults();
     return {posRange.front(), posRange.back()};
   }
+
+  ValuePair collapseRangeBetween(OpBuilder &b, Location l,
+                                 ValueRange batchPrefix,
+                                 ValuePair parentRange) const override {
+    SmallVector<Value> memCrd(batchPrefix);
+    memCrd.push_back(parentRange.first);
+    Value pLo = genIndexLoad(b, l, getPosBuf(), memCrd);
+    memCrd.back() = parentRange.second;
+    Value pHi = genIndexLoad(b, l, getPosBuf(), memCrd);
+    return {pLo, pHi};
+  }
----------------
qyingwu wrote:

Hi Peiming, could you check again? updated as you suggested :)

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


More information about the Mlir-commits mailing list