[llvm] ef89409 - Fix 'unused-lambda-capture' gcc warning. NFCI.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 3 12:44:12 PDT 2022


On Tue, Sep 27, 2022 at 7:16 AM Simon Pilgrim via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Simon Pilgrim
> Date: 2022-09-27T15:15:43+01:00
> New Revision: ef89409a59f3b79ae143b33b7d8e6ee6285aa42f
>
> URL: https://github.com/llvm/llvm-project/commit/ef89409a59f3b79ae143b33b7d8e6ee6285aa42f
> DIFF: https://github.com/llvm/llvm-project/commit/ef89409a59f3b79ae143b33b7d8e6ee6285aa42f.diff
>
> LOG: Fix 'unused-lambda-capture' gcc warning. NFCI.
>
> Added:
>
>
> Modified:
>     llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
>
> Removed:
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> index b5c73819335e..9584c421bcca 100644
> --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> @@ -6075,7 +6075,7 @@ InstructionCost BoUpSLP::getEntryCost(const TreeEntry *E,
>    bool NeedToShuffleReuses = !E->ReuseShuffleIndices.empty();
>    // FIXME: it tries to fix a problem with MSVC buildbots.
>    TargetTransformInfo &TTIRef = *TTI;
> -  auto &&AdjustExtractsCost = [this, &TTIRef, CostKind, VL, VecTy,
> +  auto &&AdjustExtractsCost = [this, &TTIRef, CostKind, VL,
>                                 VectorizedVals, E](InstructionCost &Cost) {

Generally if a lambda's only going to be used in the current scope,
I'd suggest using default capture "[&]" so the list doesn't need to be
maintained.

Also rvalue reference lifetime extension's probably not helpful here,
and just plain `auto AdjustExtractsCost` could be used.

>      ScalarizationOverheadBuilder ScalarizationCost;
>      SmallPtrSet<Value *, 4> CheckedExtracts;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits


More information about the llvm-commits mailing list