This diff fixes the inconsistency between the parameters of the
SparseElementsAttr type and the arguments to the custom builder.
The previous implementation used assert() calls in the builder to ensure
that the indices argument (of type DenseElementsAttr) had an underlying
integer type. This diff changes the builder to use the DenseIntElementsAttr
type for the argument, instead of DenseElementsAttr, making the requirement
on the argument explicit to code that creates the SparseElementsAttr
attribute.
(This was uncovered during a separate effort to add attribute/type parameter
verification, but these changes are independent.)
cast already asserts that it succeeds (i.e. it never returns nullptr), dyn_cast is the one that is failable.