[X86] Make constant `mul` -> `shl` + `add`/`sub` work for vector types
Something like: `%r = mul %x, <33, 33, 33, ...>` Is best lowered as: `%tmp = %shl x, <5, 5, 5>; %r = add %tmp, %x` As well, since vectors have non-destructive shifts, we can also do cases where the multiply constant is `Pow2A +/- Pow2B` for arbitrary A and B, unlike in the scalar case where the extra `mov` instructions make it not worth it. Reviewed By: pengfei Differential Revision: https://reviews.llvm.org/D150324
Loading
Please sign in to comment