[LLVMdev] Enabling vectorization with LLVM 3.3 for a DSL emitting LLVM IR

Tobias Grosser
2013-07-05T02:11:26Z

On 07/04/2013 01:39 PM, Stéphane Letz wrote:
> Hi,
>
> Our DSL can generate C or directly generate LLVM IR. With LLVM 3.3, we can
vectorize the C produced code using clang with -O3, or clang with -O1 then opt
-O3 -vectorize-loops. But the same program generating LLVM IR version cannot be
vectorized with opt -O3 -vectorize-loops. So our guess is that our generated
LLVM IR lacks some informations that are needed by the vectorization passes to
correctly work.
>
> Any idea of what could be lacking?

Without any knowledge about the code guessing is hard. You may miss the
'noalias' keyword or nsw/nuw flags, but there are many possibilities.

If you add '-debug' to opt you may get some hints. Also, if you have a
small test case, posting the LLVM-IR may help.

Cheers,
Tobias