[Haskell-cafe] llvm is generating invalid instructions (problem with autovectorization?)

Mike Izbicki mike at izbicki.me
Wed May 21 22:50:54 UTC 2014

I have some code* that is causing llvm to throw a fit.  In particular, I
get (compiling with GHC 7.8 and llvm 3.4):

         Error: no such instruction: `sarxq %rax,%rbx,%r14'

Similar errors get repeated several thousand times, and it's always a sarxq
instruction.  Now, my code doesn't use any of the simd primops, so the
sarxq must be coming from llvm's autovectorization.  Is it possible that
somehow GHC's output bytecode could be responsible, or is the problem more
likely with llvm proper?  Is there any way I can force GHC to pass flags to
llvm so I can experiment with different settings?

Another clue that the cause might be in llvm's autovectorization is that
when I compile with llvm 3.0 (which does not support autovectorization),
there are no error messages.

* I suspect my code is far too complicated for it to shed any light on this
question, but it's available at:
If need be, I can create a minimal sample of code that causes the error,
but I don't want to go through the trouble if it's not needed.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140521/d0025bae/attachment.html>

More information about the Haskell-Cafe mailing list