<div dir="ltr"><div><div><div>I will qualify this answer with a caveat that I know nothing about X86.<br></div>I presume that the vector instructions in the assembly that you're referring to are things like <span style="font-family:monospace,monospace">vaddsd, vmulsd, vdivsd</span>, ... (simply because I assume the v stands for vector).<br><br></div>If that is the case, you should note that those are not vector instructions as far as the SDAG is concerned. If you compile this IR file with <span style="font-family:monospace,monospace">-debug-only=isel</span>, you'll notice where these are coming from. Namely, there will be nodes such as <span style="font-family:monospace,monospace">t99: f64 = VADDSDrr t98, t300</span>. Notice - it is not a vector result. These come from nodes such as <span style="font-family:monospace,monospace">t99: f64 = fadd t98, t300</span> via patterns such as:<br><span style="font-family:monospace,monospace">// Src: (fadd:f64 FR64:f64:$src1, FR64:f64:$src2) - Complexity = 3<br>// Dst: (VADDSDrr:f64 FR64:f64:$src1, FR64:f64:$src2)</span><br><br></div>If these are not the instructions you're referring to, then either they come from similar patterns or this response does not apply. But one thing that seems quite certain is that the basic block does not contain any vectors according to the SDAG (i.e. there are no <span style="font-family:monospace,monospace">vXXfYY</span> types in the SDAG).<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 21, 2017 at 9:09 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><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi all,<div><br></div><div>Recently I compiled the attached .c file using Clang with "-mavx2 -mfma -m32 -O3" optimization flags. </div><div><br></div><div>First I used -emit-llvm and inspected the LLVM IR (.ll file attached) and there are no vector instructions in the if.else BB in compressStream function. Then I got the assembly output of the file in it I can clearly see vector instructions in the compressStream function (.S file attached)</div><div><br></div><div>Neither the SLPVectorizer or the LoopVectorizer is however doing any vectorization (also checked it using -debug-only flag) as witnessed by the non-vectorized code in the attached .ll file. </div><div><br></div><div>Therefore, the vectorization should happen in the backend(?). </div><div><br></div><div>Can I know whether the x86 backend does additional vectorization of scalar code and if so in which passes?</div><div><br></div><div>Thank You.<span class="HOEnZb"><font color="#888888"><br clear="all"><div><br></div>-- <br><div class="m_4422487852259080115gmail_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></div>
<br>______________________________<wbr>_________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org">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>