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

via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 11 13:53:04 PDT 2026


llvmorg-github-actions[bot] wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-transforms

Author: Kazu Hirata (kazutakahirata)

<details>
<summary>Changes</summary>

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]


---
Full diff: https://github.com/llvm/llvm-project/pull/223057.diff


1 Files Affected:

- (modified) llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp (+2-2) 


``````````diff
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,

``````````

</details>


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


More information about the llvm-commits mailing list