[llvm] [SLP] Enable full non-power-of-2 vectorization by default (PR #196825)

Ryan Buchner via llvm-commits llvm-commits at lists.llvm.org
Tue May 12 16:47:09 PDT 2026


================
@@ -30142,7 +30224,10 @@ bool SLPVectorizerPass::tryToVectorize(Instruction *I, BoUpSLP &R) {
   auto *Op0 = dyn_cast<Instruction>(I->getOperand(0));
   auto *Op1 = dyn_cast<Instruction>(I->getOperand(1));
   if (!Op0 || !Op1 || Op0->getParent() != P || Op1->getParent() != P ||
-      R.isDeleted(Op0) || R.isDeleted(Op1))
+      R.isDeleted(Op0) || R.isDeleted(Op1) ||
+      ((Op0 == Op1 || isa<LoadInst, ExtractValueInst>(Op0) ||
+        isa<LoadInst, ExtractValueInst>(Op1)) &&
+       SLPCostThreshold >= 0))
----------------
bababuck wrote:

Should this be its own MR? I don't see how it relates to non-power-of-2 vectorization, and I worry this masks compile time increases from the rest of the MR.

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


More information about the llvm-commits mailing list