This was one of the potential follow-ups suggested in D48236, and these will be used to make matching the patterns in PR38691 cleaner:
https://bugs.llvm.org/show_bug.cgi?id=38691
I'm not sure if we have preferred/existing vocabulary for these operations. In the DAG, I think these would be concat_vector with an undef operand or extract_subvector. Alternate naming suggestions welcome.
isIdentityWithExtend() sounds very much like [[ https://llvm.org/docs/LangRef.html#zext-to-instruction | zext ]]-but-with-undef.
So maybe isIdentityWithExtract() can follow suit and be named isIdentityWithTruncate()?