[llvm] r184827 - Fix a typo in the code that collected the costs recursively.

David Blaikie dblaikie at gmail.com
Mon Jun 24 22:40:55 PDT 2013


On Mon, Jun 24, 2013 at 10:30 PM, Nadav Rotem <nrotem at apple.com> wrote:
> Author: nadav
> Date: Tue Jun 25 00:30:56 2013
> New Revision: 184827
>
> URL: http://llvm.org/viewvc/llvm-project?rev=184827&view=rev
> Log:
> Fix a typo in the code that collected the costs recursively.

Any test case for this?

(Hmm, I wonder if there's any way we could warn on something like this
- a combination of typo correction ("hey, you've got a similarly named
variable...") & a somewhat strange way of writing *= 2? I suppose
that's not really a strong enough signal)

>
>
> Modified:
>     llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
>
> Modified: llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?rev=184827&r1=184826&r2=184827&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp (original)
> +++ llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp Tue Jun 25 00:30:56 2013
> @@ -727,7 +727,7 @@ int FuncSLP::getTreeCost_rec(ArrayRef<Va
>        int Cost = getTreeCost_rec(Operands, Depth + 1);
>        if (Cost == MAX_COST)
>          return MAX_COST;
> -      TotalCost += TotalCost;
> +      TotalCost += Cost;
>      }
>
>      // Calculate the cost of this instruction.
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits



More information about the llvm-commits mailing list