[llvm] [RISCV] Split long build_vector sequences to reduce critical path (PR #81312)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 13 21:41:55 PST 2024


================
@@ -3877,6 +3877,47 @@ static SDValue lowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG,
     return convertFromScalableVector(VT, Vec, DAG, Subtarget);
   }
 
+  // For m1 vectors, if we have non-undef values in both halves of our vector,
+  // split the vector into low and high halves, build them separately, then
+  // use a vselect to combine them.  For long vectors, this cuts the critical
+  // path of the vslide1down sequence in half, and gives us an oppurtunity
----------------
lukel97 wrote:

```suggestion
  // path of the vslide1down sequence in half, and gives us an opportunity
```

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


More information about the llvm-commits mailing list