Looks like an oversight. The linked post says:
so it may be reasonable to do exactly that. We also have a “promised interfaces” mechanism that we may adapt to have the memref element type interface implement a sort of check, ideally static rather then verifier, for the type implementing it also implementing the data layout interface.
Alternatively, we can entirely remove getElementTypeBitWidth
from the memref type. Bit width is a data layout-related quantity, and this method was added long time before the data layout modeling. It would be then the responsibility of the caller to get the element type and obtain its bitwidth using the data layout object or otherwise, depending on the use case.
I have a slight preference for the latter.
cc: @rolfmorel @rengolin for the data layout part.