[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


================
@@ -9689,13 +9689,31 @@ X86TargetLowering::LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const {
     // movd/movss) to move this into the low element, then shuffle it into
     // place.
     if (EVTBits == 32) {
+      if ((VT.is256BitVector() || VT.is512BitVector()) && Idx < 4 &&
+          NumZero != 0) {
----------------
RKSimon wrote:

(pendantic) Consistency
```suggestion
          NumZero > 0) {
```

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


More information about the llvm-commits mailing list