@@ -368,11 +368,6 @@ SparseTensorEncodingAttr::getStaticDimSliceOffset(Dimension dim) const {
368
368
return getDimSlice (dim).getStaticOffset ();
369
369
}
370
370
371
- std::optional<uint64_t >
372
- SparseTensorEncodingAttr::getStaticDimSliceSize (Dimension dim) const {
373
- return getDimSlice (dim).getStaticSize ();
374
- }
375
-
376
371
std::optional<uint64_t >
377
372
SparseTensorEncodingAttr::getStaticDimSliceStride (Dimension dim) const {
378
373
return getDimSlice (dim).getStaticStride ();
@@ -384,12 +379,6 @@ SparseTensorEncodingAttr::getStaticLvlSliceOffset(Level lvl) const {
384
379
return getStaticDimSliceOffset (toOrigDim (*this , lvl));
385
380
}
386
381
387
- std::optional<uint64_t >
388
- SparseTensorEncodingAttr::getStaticLvlSliceSize (Level lvl) const {
389
- // FIXME: `toOrigDim` is deprecated.
390
- return getStaticDimSliceSize (toOrigDim (*this , lvl));
391
- }
392
-
393
382
std::optional<uint64_t >
394
383
SparseTensorEncodingAttr::getStaticLvlSliceStride (Level lvl) const {
395
384
// FIXME: `toOrigDim` is deprecated.
@@ -1744,33 +1733,26 @@ LogicalResult SortOp::verify() {
1744
1733
if (!xPerm.isPermutation ())
1745
1734
emitError (llvm::formatv (" Expected a permutation map, got {0}" , xPerm));
1746
1735
1747
- std::optional<int64_t > cn = getConstantIntValue (getN ());
1748
1736
// We can't check the size of the buffers when n or buffer dimensions aren't
1749
1737
// compile-time constants.
1738
+ std::optional<int64_t > cn = getConstantIntValue (getN ());
1750
1739
if (!cn)
1751
1740
return success ();
1752
1741
1753
- uint64_t n = cn.value ();
1754
- uint64_t ny = 0 ;
1755
- if (auto nyAttr = getNyAttr ()) {
1756
- ny = nyAttr.getInt ();
1757
- }
1758
-
1759
- // FIXME: update the types of variables used in expressions bassed as
1760
- // the `minSize` argument, to avoid implicit casting at the callsites
1761
- // of this lambda.
1742
+ // Verify dimensions.
1762
1743
const auto checkDim = [&](Value v, Size minSize, const char *message) {
1763
1744
const Size sh = getMemRefType (v).getShape ()[0 ];
1764
1745
if (!ShapedType::isDynamic (sh) && sh < minSize)
1765
1746
emitError (llvm::formatv (" {0} got {1} < {2}" , message, sh, minSize));
1766
1747
};
1767
-
1748
+ uint64_t n = cn.value ();
1749
+ uint64_t ny = 0 ;
1750
+ if (auto nyAttr = getNyAttr ())
1751
+ ny = nyAttr.getInt ();
1768
1752
checkDim (getXy (), n * (nx + ny),
1769
1753
" Expected dimension(xy) >= n * (rank(perm_map) + ny)" );
1770
-
1771
- for (Value opnd : getYs ()) {
1754
+ for (Value opnd : getYs ())
1772
1755
checkDim (opnd, n, " Expected dimension(y) >= n" );
1773
- }
1774
1756
1775
1757
return success ();
1776
1758
}
0 commit comments