summaryrefslogtreecommitdiff
path: root/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp')
-rw-r--r--mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp b/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
index 681ba21dd4a3..9c2465d25737 100644
--- a/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
+++ b/mlir/lib/Dialect/SparseTensor/Transforms/Sparsification.cpp
@@ -232,7 +232,7 @@ static bool findAffine(Merger &merger, TensorId tid, Level lvl, AffineExpr a,
switch (a.getKind()) {
case AffineExprKind::DimId: {
const LoopId idx = merger.makeLoopId(a.cast<AffineDimExpr>().getPosition());
- if (!isUndefDLT(merger.getDimLevelType(tid, idx)))
+ if (!isUndefDLT(merger.getLvlType(tid, idx)))
return false; // used more than once
if (setLvlFormat)
@@ -243,7 +243,7 @@ static bool findAffine(Merger &merger, TensorId tid, Level lvl, AffineExpr a,
case AffineExprKind::Mul:
case AffineExprKind::Constant: {
if (!isDenseDLT(dlt) && setLvlFormat) {
- assert(isUndefDLT(merger.getDimLevelType(tid, filterLdx)));
+ assert(isUndefDLT(merger.getLvlType(tid, filterLdx)));
// Use a filter loop for sparse affine expression.
merger.setLevelAndType(tid, filterLdx, lvl, dlt);
++filterLdx;
@@ -287,7 +287,7 @@ static bool findDepIdxSet(Merger &merger, TensorId tensor, Level lvl,
switch (a.getKind()) {
case AffineExprKind::DimId: {
const LoopId ldx = merger.makeLoopId(a.cast<AffineDimExpr>().getPosition());
- if (!isUndefDLT(merger.getDimLevelType(tensor, ldx)))
+ if (!isUndefDLT(merger.getLvlType(tensor, ldx)))
return false; // used more than once, e.g., A[i][i]
// TODO: Generalizes the following two cases. A[i] (with trivial index
@@ -624,8 +624,7 @@ static void addFilterLoopBasedConstraints(CodegenEnv &env, OpOperand &t,
// Filter loops should be constructed after all the dependent loops,
// i.e., d0 + d1 < filter_loop(d0 + d1)
if (tldx && env.merger().isFilterLoop(*tldx)) {
- assert(!ta.isa<AffineDimExpr>() &&
- !isDenseDLT(enc.getDimLevelType()[lvl]));
+ assert(!ta.isa<AffineDimExpr>() && !isDenseDLT(enc.getLvlTypes()[lvl]));
addAffineOrderings(adjM, inDegree, ta, AffineExpr(), std::nullopt, tldx);
// Now that the ordering of affine expression is captured by filter
// loop idx, we only need to ensure the affine ordering against filter
@@ -1922,7 +1921,7 @@ private:
//
auto srcTp = getRankedTensorType(tval);
auto dstEnc = SparseTensorEncodingAttr::get(
- getContext(), srcEnc.getDimLevelType(),
+ getContext(), srcEnc.getLvlTypes(),
permute(env, env.op().getMatchingIndexingMap(t)), // new order
srcEnc.getHigherOrdering(), srcEnc.getPosWidth(),
srcEnc.getCrdWidth());