[llvm] 6a23668 - [SLP] remove uses of 'auto' that obscure functionality; NFC

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 23 15:49:08 PDT 2020


Perhaps use const ref in the first for loop, since it doesn't seem to
be modifying the elements of the pair?

& as for the second - could you skip the use of makeArrayRef and call
the ArrayRef ctor directly now?

On Wed, Sep 16, 2020 at 5:27 AM Sanjay Patel via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
>
>
> Author: Sanjay Patel
> Date: 2020-09-16T08:26:21-04:00
> New Revision: 6a23668e78b05703ccba552e09b09b8055924bb6
>
> URL: https://github.com/llvm/llvm-project/commit/6a23668e78b05703ccba552e09b09b8055924bb6
> DIFF: https://github.com/llvm/llvm-project/commit/6a23668e78b05703ccba552e09b09b8055924bb6.diff
>
> LOG: [SLP] remove uses of 'auto' that obscure functionality; NFC
>
> 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 0fc5d1a810b50..619964a6f457c 100644
> --- a/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> +++ b/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
> @@ -6817,9 +6817,9 @@ class HorizontalReduction {
>      Builder.setFastMathFlags(Unsafe);
>
>      BoUpSLP::ExtraValueToDebugLocsMap ExternallyUsedValues;
> -    // The same extra argument may be used several time, so log each attempt
> +    // The same extra argument may be used several times, so log each attempt
>      // to use it.
> -    for (auto &Pair : ExtraArgs) {
> +    for (std::pair<Instruction *, Value *> &Pair : ExtraArgs) {
>        assert(Pair.first && "DebugLoc must be set.");
>        ExternallyUsedValues[Pair.second].push_back(Pair.first);
>      }
> @@ -6844,7 +6844,7 @@ class HorizontalReduction {
>
>      unsigned i = 0;
>      while (i < NumReducedVals - ReduxWidth + 1 && ReduxWidth > 2) {
> -      auto VL = makeArrayRef(&ReducedVals[i], ReduxWidth);
> +      ArrayRef<Value *> VL = makeArrayRef(&ReducedVals[i], ReduxWidth);
>        V.buildTree(VL, ExternallyUsedValues, IgnoreList);
>        Optional<ArrayRef<unsigned>> Order = V.bestOrder();
>        // TODO: Handle orders of size less than number of elements in the vector.
>
>
>
> _______________________________________________
> 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