[llvm] [SLP][NFC]Fix building on windows, NFC (PR #194903)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 29 09:32:55 PDT 2026


https://github.com/alexey-bataev created https://github.com/llvm/llvm-project/pull/194903

None

>From da7f50194c5c9a947c35184b9190030c1ce78b91 Mon Sep 17 00:00:00 2001
From: Alexey Bataev <a.bataev at outlook.com>
Date: Wed, 29 Apr 2026 09:32:34 -0700
Subject: [PATCH] =?UTF-8?q?[=F0=9D=98=80=F0=9D=97=BD=F0=9D=97=BF]=20initia?=
 =?UTF-8?q?l=20version?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Created using spr 1.3.7
---
 llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index f631ec963d491..cc5a206cacbd0 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -17537,9 +17537,9 @@ bool BoUpSLP::isTreeTinyAndNotFullyVectorizable(bool ForReduction) const {
   const bool ThresholdSet = SLPCostThreshold.getNumOccurrences() > 0;
   const bool ThresholdNonNegative = SLPCostThreshold >= 0;
 
-  constexpr int Limit = 4;
+  constexpr unsigned Limit = 4;
   constexpr unsigned LargeTree = 20;
-  constexpr int LimitTreeSize = 36;
+  constexpr unsigned LimitTreeSize = 36;
 
   // The remaining size-1/size-<=MinTreeSize early bail-outs only apply to
   // non-reduction trees; group them under a single guard to avoid 3 separate
@@ -17582,7 +17582,7 @@ bool BoUpSLP::isTreeTinyAndNotFullyVectorizable(bool ForReduction) const {
   if (TreeSize == 3 && SLPCostThreshold == 0 &&
       (!ForReduction || Front.getVectorFactor() <= 2) &&
       all_of(ArrayRef(VectorizableTree).drop_front(),
-             [](const std::unique_ptr<TreeEntry> &TE) {
+             [&](const std::unique_ptr<TreeEntry> &TE) {
                return TE->isGather() && TE->getVectorFactor() <= Limit &&
                       !all_of(
                           TE->Scalars,
@@ -17599,7 +17599,7 @@ bool BoUpSLP::isTreeTinyAndNotFullyVectorizable(bool ForReduction) const {
     // is default. The cost of vectorized PHI nodes is almost always 0 + the
     // cost of gathers/buildvectors.
     if (!ThresholdSet &&
-        all_of(VectorizableTree, [](const std::unique_ptr<TreeEntry> &TE) {
+        all_of(VectorizableTree, [&](const std::unique_ptr<TreeEntry> &TE) {
           const bool IsGather = TE->isGather();
           const bool HasState = TE->hasState();
           const unsigned Op = HasState ? TE->getOpcode() : 0u;



More information about the llvm-commits mailing list