I’m trying to map extract_vector_elt use the following pattern in tbl file.
Def : Pat <(i64 (extractelt v2i32:$src, 0)), (i64 (SRLIMM GPR:$src, 32))>;
But the tblgen shows :
Type inference contradiction found , forcing v2i32 to have a vector element of type i64
But the manual says this instruction allows return type to be larger than element type.
Anyone can show me any pointers ?
I think this is just intended as a quirk for some weird targets that have a legal vector type, but the scalar type itself is not legal, so it requires an implicit extension when extracting it. I don't think it's intended as something you can arbitrarily do for any vector type, and I wouldn't recommend trying to use it if you don't have to. This probably requires custom selector code
For some reason EXTRACT_VECTOR_ELEMENT seems to have two TableGen
defs. This should work with "vector_extract" instead of "extractelt"
(despite the deprecation warning, which I don't really understand).
I think it's a pretty common RISC situation. I notice you deprecated
the mismatching types in r255359, but I don't really see an
alternative after type-legalization with the current nodes. I suppose
we could add ISD::EXTRACT_SEXT_VECTOR_ELEMENT and
ISD::EXTRACT_ZEXT_VECTOR_ELEMENT or something.
I think that would be an improvement. I manage to break the mismatched element case for most every vector combine I've done
vector_extract does the job for me.