<p dir="ltr">Hi Andrey,</p>
<p dir="ltr">Thanks. I found even when loop vectorizer and SLP vectorizer are enabled, my simple test still not get optimized. I also tried clang pragma in my test to force vectorization. What do you think is the problem?</p>
<p dir="ltr">Test:</p>
<p dir="ltr">#define SIZE 8</p>
<p dir="ltr">void bar(int *A, int* B,int K) {</p>
<p dir="ltr"> #pragma clang loop vectorize(enable) vectorize_width(2) unroll_count(8)</p>
<p dir="ltr"> for (int i = 0; i < SIZE; ++i)</p>
<p dir="ltr"> A[i] += B[i] + K;</p>
<p dir="ltr">}</p>
<p dir="ltr">Thanks,<br>
Xiaochu</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Aug 12, 2016 4:06 AM, "Andrey Bokhanko" <<a href="mailto:andreybokhanko@gmail.com">andreybokhanko@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi <span style="font-size:12.8px">Xiaochu,</span><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Clang uses -O0 by default, that doesn't run any optimizations. Try supplying -O1 or higher.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Yours,</span></div><div><span style="font-size:12.8px">Andrey</span></div><div><span style="font-size:12.8px"><br></span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Aug 12, 2016 at 1:04 AM, Xiaochu Liu via llvm-dev <span dir="ltr"><<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">Hi there ,</p>
<p dir="ltr">I use clang-cl /Qvec test.c to compile the code. But the pass LoopVectorizer is never invoked. </p>
<p dir="ltr">I was wondering if this is sufficient to enable auto vectorizer? </p>
<p dir="ltr">Thanks,<br>
Xiaochu</p>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/llvm-dev</a><br>
<br></blockquote></div><br></div>
</blockquote></div></div>