[AArch64][GlobalISel] Optimize G_BUILD_VECTOR of undef + 1 elt -> SUBREG_TO_REG
This pattern ``` %elt = ... something ... %undef = G_IMPLICIT_DEF %vec = G_BUILD_VECTOR %elt, %undef, %undef, ... %undef ``` Can be selected to a SUBREG_TO_REG, assuming `%elt` and `%vec` have the same register bank. We don't care about any of the bits in `%vec` aside from those in `%elt`, which just happens to be the 0th element. This is preferable to emitting `mov` instructions for every index. This gives minor code size improvements on the test suite at -Os. Differential Revision: https://reviews.llvm.org/D108773
Loading
Please sign in to comment