scalar-to-vector (binop (extractelt V, Idx), C) --> shuffle (bo V, C'), {Idx, -1, -1...}
We generally try to avoid ad-hoc vectorization in SDAG, but the motivating case from issue #39482
escapes our normal vectorization folds in IR. It seems like it should always be a win to transform this pattern in cases where we have the same vector type for input and output and the target supports the vector operation because we avoid transfers from vector to scalar and back.
In the x86 shift examples, we create the scalar-to-vector node during legalization. I'm not sure if there's a more general way to create the pattern for testing. (If so, I could add tests for other targets.)
is anything stopping a vectorized integer division with undef elements occurring apart from the fact that almost no target has such an instruction?