[LLVMdev] is it possible to use gcc vectorizer ?

Devang Patel devang.patel at gmail.com
Tue Mar 16 09:23:46 PDT 2010


On Tue, Mar 16, 2010 at 3:01 AM, Duncan Sands <baldrick at free.fr> wrote:
> Hi Kuan-Hsu,
>
>> gcc provides auto-vectorization on the tree-ssa framework, and llvm-gcc
>> uses tree-ssa to generate LLVM IR.
>> so, is it possible to use gcc vectorizer in LLVM?
>
> in theory yes, but you would have to modify the compiler.  In llvm-gcc all
> gcc optimizers are turned off, and this includes the vectorizer (see the
> #ifdef ENABLE_LLVM clauses in gcc/passes.c), so you would have to reenable
> them.  This might cause problems due to potential bad interactions between
> the gcc optimizers and LLVM modifications to the compiler - I don't know.

GCC's tree-ssa IR is in fact a collection on representations namely,
GENERIC, low GIMPLE, high GIMPLE etc.. The llvm IR convert may need
modifications if gcc optimization pipeline is enabled.
-
Devang

>
> Ciao,
>
> Duncan.
>
> PS: In case anyone is wondering, this is not possible with the dragonegg
> plugin, which is a pity since the auto-vectorizer is much improved in gcc-4.5
> I hear.  The reason is that gimple->IR conversion replaces gcc's LTO logic,
> and this runs before the auto-vectorizer.
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



-- 
-
Devang




More information about the llvm-dev mailing list