[llvm] [SLP] Allow non-power-of-2 VF in tryToVectorizeList (PR #206259)

Harrison Hao via llvm-commits llvm-commits at lists.llvm.org
Sat Jun 27 20:04:55 PDT 2026


================
@@ -28576,6 +28576,10 @@ bool SLPVectorizerPass::tryToVectorizeList(ArrayRef<Value *> VL, BoUpSLP &R,
   unsigned MaxVF = std::max<unsigned>(
       getFloorFullVectorNumberOfElements(*TTI, ScalarTy, VL.size()), MinVF);
   MaxVF = std::min(R.getMaximumVF(Sz, S.getOpcode()), MaxVF);
+  if (isAllowedNonPowerOf2VF(VL.size()))
+    MaxVF = std::max<unsigned>(
+        MaxVF,
+        std::min<unsigned>(VL.size(), R.getMaximumVF(Sz, S.getOpcode())));
----------------
harrisonGPU wrote:

Thanks, I have updated.

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


More information about the llvm-commits mailing list