Loop Vectorizer: Refactor Memory Cost Computation

Renato Golin renato.golin at linaro.org
Thu Feb 7 10:47:10 PST 2013


LGTM.


On 7 February 2013 18:19, Nadav Rotem <nrotem at apple.com> wrote:

> +        if (SI)
> +          // In case of STORE, the cost of ExtractElement from the vector.
> +          Cost += TTI.getVectorInstrCost(Instruction::ExtractElement,
> VectorTy,
> +                                         i);
> +        else
> +          // In case of LOAD, the cost of InsertElement into the returned
> +          // vector.
> +          Cost += TTI.getVectorInstrCost(Instruction::InsertElement,
> VectorTy,
> +                                         i);
>
> Can be written as:
>
> +          // In case of STORE, the cost of ExtractElement from the vector.
> +          // In case of LOAD, the cost of InsertElement into the returned
> vector.
> +          Cost += TTI.getVectorInstrCost(SI  ?
> Instruction::ExtractElement :  Instruction::InsertElement,
>                                         VectorTy, i);
>
> LGTM.   Thanks!
>
>
>
> On Feb 7, 2013, at 10:15 AM, Arnold Schwaighofer <aschwaighofer at apple.com>
> wrote:
>
> > As per feedback.
> >
> > We don't want too many classes in a pass and the classes obscure the
> details. I
> > was going a little overboard with object modeling here. Replace classes
> by
> > generic code that handles both loads and stores.
> >
> > <0001-Loop-Vectorizer-Refactor-Memory-Cost-Computation.patch>
> >
> > Thanks,
> > Arnold
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130207/bb278f4d/attachment.html>


More information about the llvm-commits mailing list