<div dir="ltr">Do you have a stack trace of the segfault?<div><br></div><div>We have two different code emitters for X86 in LLVM. The one used by the normal compiler and MCJIT and the other used by the legacy JIT. All of the test cases for AVX support go through the first one so it gets the most attention. We try to keep the legacy JIT in sync with it, but have a history of failing at that. The stack trace of the segfault may point to what part is missing.</div>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, Nov 10, 2013 at 3:32 PM, Frank Winter <span dir="ltr"><<a href="mailto:fwinter@jlab.org" target="_blank">fwinter@jlab.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is it possible that the AVX support in the JIT engine or x86-64 backend<br>
is not mature? I am getting segfaults when switching from a vector<br>
length 4 to 8 in my application. I isolated the barfing function and it<br>
still segfaults in the minimal setup:<br>
<br>
The IR attached implements the following simple function:<br>
<br>
void bar(int start, int end, int ignore , bool add , bool addme , float* out, float* in)<br>
{<br>
  int loop_start = add ? start+add : start;<br>
  int loop_end = add ? end+add : end;<br>
  loop_start /= 8;<br>
  loop_end /= 8;<br>
  for ( int i = loop_start ; i < loop_end ; ++i )<br>
    for ( int q = 0 ; q < 8 ; ++q )<br>
      out[ i * 8 + q ] = in[ i * 8 + q ];<br>
}<br>
<br>
The main.cc program implements the following:<br>
<br>
Set loop vectorizer min trip count to 4<br>
Create Module from file (given as program argument)<br>
Set loop vectorizer debug info output<br>
Optimize including loop vectorization<br>
Create payload<br>
Call function<br>
Check result<br>
<br>
<br>
I tried this on various CPUs. On those which support SSE only this program<br>
works fine (vectorized to length 4). Now, running it on a CPU with AVX<br>
support, the loop vectorizer goes for vector length 8, JIT'ing the function<br>
works still fine but then the call to the function suddenly segfaults.<br>
<br>
The LLVM website says that the x86-64 backend includes support for ISA<br>
extensions such as MMX and SSE but it doesn't say explicitly AVX. Is this<br>
on purpose and there's no AVX support?<span class="HOEnZb"><font color="#888888"><br>
<br>
Frank<br>
<br>
<br>
</font></span><br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br>~Craig
</div>