[llvm] [X86] Generalize scalar-to-vector lowering for BUILD_VECTOR with a single non-zero 32-bit element (PR #219554)

Simon Pilgrim via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 22 04:19:23 PDT 2026


================
@@ -9728,7 +9746,7 @@ X86TargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const {
   // If this is a splat of pairs of 32-bit elements, we can use a narrower
   // build_vector and broadcast it.
   // TODO: We could probably generalize this more.
-  if (Subtarget.hasAVX2() && EVTBits == 32 && Values.size() == 2) {
+  if (Subtarget.hasAVX2() && EVTBits == 32 && Values.size() <= 2) {
----------------
RKSimon wrote:

Are we still using this fold much?

https://github.com/llvm/llvm-project/pull/219554


More information about the llvm-commits mailing list