[mlir][sparse] partially support lowering sparse coiteration loops to scf.while/for. (#105565)

This commit is contained in:
Peiming Liu
2024-08-23 10:47:44 -07:00
committed by GitHub
parent ebc4a66e9b
commit f607102a0d
9 changed files with 549 additions and 91 deletions

View File

@@ -2745,6 +2745,16 @@ LogicalResult CoIterateOp::verifyRegions() {
return success();
}
SmallVector<Region *> CoIterateOp::getSubCasesOf(unsigned regionIdx) {
SmallVector<Region *> ret;
I64BitSet caseBit = getRegionDefinedSpace(regionIdx);
for (Region &r : getCaseRegions())
if (getRegionDefinedSpace(r.getRegionNumber()).isSubSetOf(caseBit))
ret.push_back(&r);
return ret;
}
//===----------------------------------------------------------------------===//
// Sparse Tensor Dialect Setups.
//===----------------------------------------------------------------------===//