forked from OSchip/llvm-project
[mlir][sparse] use new permutation utility to avoid codedup
Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D108636
This commit is contained in:
parent
307890f85b
commit
fda176892e
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue