Prior to this patch it was possible to use the dim operation on a 0-D
memref/tensor.
Unless we want to change the semantic of a 0-D shape, this doesn't make
sense because, paraphrasing the dim op semantic, this is guaranteed to
produce something that is undefined. (The requested index is guaranteed
to be equal to or greater than the rank.)
Harden the type requirements for the dim op by disallowing 0-D shaped
types.
This "fixes" llvm.org/PR60195 by rejecting dim op on 0-D shapes instead of
crashing during LLVM conversion.
Side note: Adding a manual check to the op verifier would just be two lines. Are there any other ops that could benefit from Non0RankedTensorOf etc.?