In particular, this silences warnings from [-Wsign-compare].
This is a revised version of D137735, which got reverted due to a sign-comparison warning on LLVM's Windows buildbot (which was not on MLIR's Windows buildbot). Differences vs the previous differential:
- vectorToMemref now uses detail::checkOverflowCast to silence the warning that caused the the previous differential to get reverted.
- MEMREF_GET_USIZE now uses detail::checkOverflowCast rather than static_cast
- ASSERT_USIZE_EQ added to abbreviate another common idiom, and to ensure that we use detail::safelyEQ everywhere (to silence a few other warnings)
- A couple for-loops now use index_type for the induction variable, since their upper bound uses that typedef too. (Namely _mlir_ciface_getSparseTensorReaderDimSizes and _mlir_ciface_outSparseTensorWriterNext)
Depends on D138149