[LLVMdev] Getting llvm-gcc to generate vectors

Eli Friedman eli.friedman at gmail.com
Wed Mar 4 20:38:40 PST 2009


On Wed, Mar 4, 2009 at 7:19 PM, Jon Harrop <jon at ffconsultancy.com> wrote:
> But it did not generate the vector code that I was expecting and my hand
> written IR is 2.5x faster. Is it possible to get llvm-gcc to do this
> optimization and, if so, how?

LLVM doesn't have an auto-vectorization pass at the moment, so it
can't do the optimization in question.  That said, you can explicitly
write vectors in C using something like "typedef float v4f
__attribute__((vector_size(16)));".

-Eli



More information about the llvm-dev mailing list