[llvm-dev] LLVM flags for Vectorization

Santanu Das via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 23 07:03:34 PDT 2016


Hi Renato,

Thanks a lot for your help! I will perform some experimentation with pragma
directives as suggested by you.

Regards,
Santanu

On Tue, Aug 23, 2016 at 5:27 PM, Renato Golin <renato.golin at linaro.org>
wrote:

> On 20 August 2016 at 09:22, Santanu Das via llvm-dev
> <llvm-dev at lists.llvm.org> wrote:
> > I have been analyzing the LLVM vectorizer by running some benchmarks. For
> > vectorization, I have used the following flags:
> >
> > -O3
> > -ffast-math
> > -mavx2
> >
> > Am I missing any other flags which will improve vectorizer performance?
>
> Hi Santanu,
>
> These flags should be enough for Clang to vectorise your code based on
> AVX2 support.
>
> If that doesn't give you the vectorisation you want, you can try to
> force the vector width or unroll factor by either command line options
> or pragmas in the code:
>
> http://llvm.org/docs/Vectorizers.html
>
> If you don't understand why a loop is not being vectorised, you can
> try the Clang diagnostics:
>
> http://blog.llvm.org/2014/11/loop-vectorization-diagnostics-and.html
>
> And, of course, if you spot a loop or a basic block that could have
> been vectorised but wasn't, please open a bug on our bugzilla with the
> results of the diagnostics and your experimentation with widths and
> factors:
>
> https://llvm.org/bugs/
>
> Hope that helps.
>
> cheers,
> --renato
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20160823/58f32132/attachment.html>


More information about the llvm-dev mailing list