<div dir="ltr">Almost all of those instructions end in "sdl" which are the scalar floating point instructions using the lower 32-bits of the xmm registers. The only one that ends in "ps" is an xor of a register with itself which is the idiom for zeroing a register.</div><div class="gmail_extra"><br clear="all"><div><div class="gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote">On Mon, Aug 21, 2017 at 9:14 AM, Charith Mendis <span dir="ltr"><<a href="mailto:char.mendis1989@gmail.com" target="_blank">char.mendis1989@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">I isolated the LLVM IR and the X86 instructions emitted for the function and are attached herewith and it is clearly emitting vector instructions. I am having a hard time figuring out where the vector instructions are formulated. For sure SLP and Loop vectorizer is not doing anything.<div><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 21, 2017 at 11:56 AM, Craig Topper <span dir="ltr"><<a href="mailto:craig.topper@gmail.com" target="_blank">craig.topper@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">The X86 backend shouldn't be doing any additional vectorization. If there are no vector types in IR, I don't think the X86 backend will create any. </div><div class="gmail_extra"><br clear="all"><div><div class="m_-7435400658988547746m_-8056044654751237937gmail_signature" data-smartmail="gmail_signature">~Craig</div></div>
<br><div class="gmail_quote"><div><div class="m_-7435400658988547746h5">On Mon, Aug 21, 2017 at 8:49 AM, Charith Mendis 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></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-7435400658988547746h5"><div dir="ltr"><br clear="all"><div><span style="font-size:12.800000190734863px">Hi all,</span><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Recently I compiled the attached .c file using Clang with "-mavx2 -mfma -m32 -O3" optimization flags. </div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">First I used -emit-llvm and inspected the LLVM IR and there are no vector instructions. Then I got the assembly output of the file in it I can clearly see vector instructions in it.</div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Neither the SLPVectorizer or the LoopVectorizer is however doing any vectorization (also checked it using -debug-only flag) as witnessed by the LLVM IR dump. </div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Therefore, the vectorization should happen in the backend(?). </div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Can I know whether the x86 backend does additional vectorization of scalar code and if so in which passes?</div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">NB - I posed the same question with the source files in a previous email, but the limit of 100kB was reached.</div><div style="font-size:12.800000190734863px"><br></div><div style="font-size:12.800000190734863px">Thank You.</div></div><span class="m_-7435400658988547746m_-8056044654751237937HOEnZb"><font color="#888888">-- <br><div class="m_-7435400658988547746m_-8056044654751237937m_-627655103933930163gmail_signature"><div dir="ltr"><div>Kind regards,<br>Charith Mendis<br><br>Graduate Student,<div>CSAIL,<br><div>Massachusetts Institute of Technology</div></div></div></div></div>
</font></span></div>
<br></div></div>______________________________<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><br><br clear="all"><div><br></div>-- <br><div class="m_-7435400658988547746gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div>Kind regards,<br>Charith Mendis<br><br>Graduate Student,<div>CSAIL,<br><div>Massachusetts Institute of Technology</div></div></div></div></div>
</div></div></div></div>
</blockquote></div><br></div>