[llvm] [SLP] Initial vectorization of non-power-of-2 ops. (PR #77790)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 20 08:42:10 PST 2024


================
@@ -7145,7 +7185,8 @@ class BoUpSLP::ShuffleCostEstimator : public BaseShuffleAnalysis {
         for (unsigned I = 0, End = VL.size(); I < End; I += VF) {
           if (VectorizedLoads.contains(VL[I]))
             continue;
-          GatherCost += getBuildVectorCost(VL.slice(I, VF), Root);
+          GatherCost += getBuildVectorCost(
+              VL.slice(I, std::min(VL.size() - I, size_t(VF))), Root);
----------------
alexey-bataev wrote:

```suggestion
              VL.slice(I, std::min<unsigned>(VL.size() - I, VF)), Root);
```


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


More information about the llvm-commits mailing list