This is the third patch in a collection to support prefixing destructive operations, with the MOVPRFX instruction, to build constructive operations. The previous patch is D73212.
Here we add support for DestructiveBinary and DestructiveBinaryComm DestructiveInstTypes, as well as the lowering code to expand the new Pseudos into the final movprfx+instruction pairs.
This patch comes mostly from D71712, with some modifications to SelectDupZero(...) in AArch64ISelDAGToDAG.cpp. IINM, the SelectDupZero(...) difference works around a separate feature (not upstreamed yet) to make use of SPLAT_VECTOR for zero vectors.
BUILD_VECTOR only works for fixed-width vectors, so you'll need to check for SPLAT_VECTOR instead.
This also puzzles me a bit on how the tests could pass; I'd either expect the pattern not to match because the incoming value is not a BUILD_VECTOR, or I'd expect an assertion in BUILD_VECTOR to fail because it doesn't work with scalable vectors.