<div dir="ltr"><div><div><div>Hi Renato,<br><br></div>Thanks a lot for your help! I will perform some experimentation with pragma directives as suggested by you.<br><br></div>Regards,<br></div>Santanu<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 23, 2016 at 5:27 PM, Renato Golin <span dir="ltr"><<a href="mailto:renato.golin@linaro.org" target="_blank">renato.golin@linaro.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 20 August 2016 at 09:22, Santanu Das via llvm-dev<br>
<span class=""><<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br>
> I have been analyzing the LLVM vectorizer by running some benchmarks. For<br>
> vectorization, I have used the following flags:<br>
><br>
> -O3<br>
> -ffast-math<br>
> -mavx2<br>
><br>
> Am I missing any other flags which will improve vectorizer performance?<br>
<br>
</span>Hi Santanu,<br>
<br>
These flags should be enough for Clang to vectorise your code based on<br>
AVX2 support.<br>
<br>
If that doesn't give you the vectorisation you want, you can try to<br>
force the vector width or unroll factor by either command line options<br>
or pragmas in the code:<br>
<br>
<a href="http://llvm.org/docs/Vectorizers.html" rel="noreferrer" target="_blank">http://llvm.org/docs/<wbr>Vectorizers.html</a><br>
<br>
If you don't understand why a loop is not being vectorised, you can<br>
try the Clang diagnostics:<br>
<br>
<a href="http://blog.llvm.org/2014/11/loop-vectorization-diagnostics-and.html" rel="noreferrer" target="_blank">http://blog.llvm.org/2014/11/<wbr>loop-vectorization-<wbr>diagnostics-and.html</a><br>
<br>
And, of course, if you spot a loop or a basic block that could have<br>
been vectorised but wasn't, please open a bug on our bugzilla with the<br>
results of the diagnostics and your experimentation with widths and<br>
factors:<br>
<br>
<a href="https://llvm.org/bugs/" rel="noreferrer" target="_blank">https://llvm.org/bugs/</a><br>
<br>
Hope that helps.<br>
<br>
cheers,<br>
--renato<br>
</blockquote></div><br></div>