[LLVMdev] loop vectorizer: JIT + AVX segfaults

Frank Winter fwinter at jlab.org
Sun Nov 10 17:36:44 PST 2013


It's not much.

(gdb) bt
#0  0x00007ffff7f6506b in ?? ()
#1  0x000000000045d01a in main () at main.cc:165

Line 165 is the call to the function that was compiled by the JIT'er. 
Meaning that JIT'ing the function went well, but the code or the pointer 
are somehow corrupt.

There is no particular reason why I am working with the legacy 
interface. Would you recommend to use the MCJIT interface in general?

Any ideas how to proceed here?

Frank


On 10/11/13 20:16, Craig Topper wrote:
> Do you have a stack trace of the segfault?
>
> 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.
>
>
> On Sun, Nov 10, 2013 at 3:32 PM, Frank Winter <fwinter at jlab.org 
> <mailto:fwinter at jlab.org>> wrote:
>
>     Is it possible that the AVX support in the JIT engine or x86-64
>     backend
>     is not mature? I am getting segfaults when switching from a vector
>     length 4 to 8 in my application. I isolated the barfing function
>     and it
>     still segfaults in the minimal setup:
>
>     The IR attached implements the following simple function:
>
>     void bar(int start, int end, int ignore , bool add , bool addme ,
>     float* out, float* in)
>     {
>       int loop_start = add ? start+add : start;
>       int loop_end = add ? end+add : end;
>       loop_start /= 8;
>       loop_end /= 8;
>       for ( int i = loop_start ; i < loop_end ; ++i )
>         for ( int q = 0 ; q < 8 ; ++q )
>           out[ i * 8 + q ] = in[ i * 8 + q ];
>     }
>
>     The main.cc program implements the following:
>
>     Set loop vectorizer min trip count to 4
>     Create Module from file (given as program argument)
>     Set loop vectorizer debug info output
>     Optimize including loop vectorization
>     Create payload
>     Call function
>     Check result
>
>
>     I tried this on various CPUs. On those which support SSE only this
>     program
>     works fine (vectorized to length 4). Now, running it on a CPU with AVX
>     support, the loop vectorizer goes for vector length 8, JIT'ing the
>     function
>     works still fine but then the call to the function suddenly segfaults.
>
>     The LLVM website says that the x86-64 backend includes support for ISA
>     extensions such as MMX and SSE but it doesn't say explicitly AVX.
>     Is this
>     on purpose and there's no AVX support?
>
>     Frank
>
>
>
>     _______________________________________________
>     LLVM Developers mailing list
>     LLVMdev at cs.uiuc.edu <mailto:LLVMdev at cs.uiuc.edu>
>     http://llvm.cs.uiuc.edu
>     http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
>
>
>
> -- 
> ~Craig


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131110/e66152ec/attachment.html>


More information about the llvm-dev mailing list