[mlir][sparse] use new permutation utility to avoid codedup

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D108636
This commit is contained in:
Aart Bik 2021-08-24 08:20:08 -07:00
parent 307890f85b
commit fda176892e
1 changed files with 2 additions and 10 deletions

View File

@ -244,16 +244,8 @@ public:
if (!index.hasValue())
return failure();
int64_t idx = index.getValue();
AffineMap p = enc.getDimOrdering();
if (p) {
assert(p.isPermutation());
for (unsigned i = 0, sz = p.getNumResults(); i < sz; i++) {
if (p.getDimPosition(i) == idx) {
idx = i;
break;
}
}
}
if (AffineMap p = enc.getDimOrdering())
idx = p.getPermutedPosition(idx);
// Generate the call.
StringRef name = "sparseDimSize";
SmallVector<Value, 2> params;