[LLVMdev] SelectionDAG scalarizes vector operations.
Duncan Sands
baldrick at free.fr
Wed Feb 8 07:38:52 PST 2012
Hi Dave,
>> We generate xEXT nodes in many cases. Unlike GCC which vectorizes
>> inner loops, we vectorize the implicit outermost loop of data-parallel
>> workloads (also called whole function vectorization). We vectorize
>> code even if the user uses xEXT instructions, uses mixed types, etc.
>> We choose a vectorization factor which is likely to generate more
>> legal vector types, but if the user mixes types then we are forced to
>> make a decision. We rely on the LLVM code generator to produce
>> quality code. To my understanding, the GCC vectorizer does not
>> vectorize code if it thinks that it misses a single operation.
>
> My experience is similar to Nadav's. The Cray vectorizer vectorizes
> much more code that the gcc vectorizer. Things are much more
> complicated than gcc vector code would lead one to believe.
I think it is important we produce non-scalarized code for the IR produced by
the GCC vectorizer, since we know it can be done (otherwise GCC wouldn't have
produced it). It is of course important to produce decent code in the most
common cases coming from other vectorizers too. However it seems sensible to
me to start with the case where you know you can easily get perfect results
(GCC vectorizer output) and then try to progressively extend the goodness to
the more problematic cases coming from other vectorizers.
Ciao, Duncan.
More information about the llvm-dev
mailing list