[mlir][sparse] Improving error-detection for STEA::get{Pos,Crd}Type

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D150995
This commit is contained in:
wren romano
2023-05-19 13:29:55 -07:00
parent 1fef1f97db
commit d824af535c
2 changed files with 8 additions and 2 deletions

View File

@@ -254,10 +254,12 @@ Type mlir::sparse_tensor::detail::getIntegerOrIndexType(MLIRContext *ctx,
}
Type SparseTensorEncodingAttr::getPosType() const {
assert(getImpl() && "Uninitialized SparseTensorEncodingAttr");
return detail::getIntegerOrIndexType(getContext(), getPosWidth());
}
Type SparseTensorEncodingAttr::getCrdType() const {
assert(getImpl() && "Uninitialized SparseTensorEncodingAttr");
return detail::getIntegerOrIndexType(getContext(), getCrdWidth());
}