[LLVMdev] Vectorizer using Instruction, not opcodes

Renato Golin renato.golin at linaro.org
Mon Feb 4 12:34:40 PST 2013


On 4 February 2013 20:21, Arnold Schwaighofer <aschwaighofer at apple.com>wrote:

> The loop vectorized does not estimate the cost of vectorization by looking
> at the IR you list below. It does not vectorize and then run the
> CostAnalysis pass. It estimates the cost itself before it even performs the
> vectorization.
>

Ok, I see my mistake. I thought that they were being taken into account
(even before being created).


(note, that they will all go away any way).
>

Thus, my worry. ;)


The corresponding code is in
> LoopVectorizationCostModel::getInstructionCost(). Basically, it just takes
> the scalar instruction, its type, creates a vector type and asks: How much
> would an instruction of that vector type cost (Slight simplification).
>

And then divide by VF in the end. Ok, things are making more sense, now. ;)

Thanks!
--renato
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130204/30588fa4/attachment.html>


More information about the llvm-dev mailing list