diff --git a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h --- a/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h +++ b/llvm/include/llvm/Transforms/Vectorize/SLPVectorizer.h @@ -91,9 +91,6 @@ /// every time we run into a memory barrier. void collectSeedInstructions(BasicBlock *BB); - /// Try to vectorize a chain that starts at two arithmetic instrs. - bool tryToVectorizePair(Value *A, Value *B, slpvectorizer::BoUpSLP &R); - /// Try to vectorize a list of operands. /// \param MaxVFOnly Vectorize only using maximal allowed register size. /// \returns true if a value was vectorized. diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp @@ -12418,15 +12418,6 @@ } } -bool SLPVectorizerPass::tryToVectorizePair(Value *A, Value *B, BoUpSLP &R) { - if (!A || !B) - return false; - if (isa(A) || isa(B)) - return false; - Value *VL[] = {A, B}; - return tryToVectorizeList(VL, R); -} - bool SLPVectorizerPass::tryToVectorizeList(ArrayRef VL, BoUpSLP &R, bool MaxVFOnly) { if (VL.size() < 2) @@ -12602,14 +12593,14 @@ } if (Candidates.size() == 1) - return tryToVectorizePair(Op0, Op1, R); + return tryToVectorizeList({Op0, Op1}, R); // We have multiple options. Try to pick the single best. std::optional BestCandidate = R.findBestRootPair(Candidates); if (!BestCandidate) return false; - return tryToVectorizePair(Candidates[*BestCandidate].first, - Candidates[*BestCandidate].second, R); + return tryToVectorizeList( + {Candidates[*BestCandidate].first, Candidates[*BestCandidate].second}, R); } namespace {