[llvm] [Vectorize] Fix a warning (PR #223057)

Kazu Hirata via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 13:52:28 PDT 2026


https://github.com/kazutakahirata created https://github.com/llvm/llvm-project/pull/223057

This patch fixes:

  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:33452:18: error:
  lambda capture 'Limit' is not required to be captured for this use
  [-Werror,-Wunused-lambda-capture]


>From 61e5858856b61dc637a020621313a0ed80ab6a81 Mon Sep 17 00:00:00 2001
From: Kazu Hirata <kazu at google.com>
Date: Fri, 11 Sep 2026 13:47:43 -0700
Subject: [PATCH] [Vectorize] Fix a warning

This patch fixes:

  llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:33452:18: error:
  lambda capture 'Limit' is not required to be captured for this use
  [-Werror,-Wunused-lambda-capture]
---
 llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
index a0adca7aabad0..8c264062a9f2b 100644
--- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
+++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
@@ -33446,10 +33446,10 @@ bool SLPVectorizerPass::vectorizeNonVectorizableInsts(
   }
   if (Operands.size() <= 1)
     return Changed;
-  constexpr unsigned Limit = 32;
   Changed |= tryToVectorizeSequence<Value>(
       Operands, OperandSorter, AreCompatibleOperands,
-      [this, &R, Limit](ArrayRef<Value *> Candidates, bool MaxVFOnly) {
+      [this, &R](ArrayRef<Value *> Candidates, bool MaxVFOnly) {
+        constexpr unsigned Limit = 32;
         // Limit to StandaloneSeeds if !MaxVFOnly to avoid quadratic scan for
         // large set of candidates.
         return tryToVectorizeList(Candidates, R, MaxVFOnly,



More information about the llvm-commits mailing list