
On 03/12/2013 03:12 PM, Johan Tibell wrote:
On Tue, Mar 12, 2013 at 8:08 AM, Geoffrey Mainland
wrote: LLVM needs to know statically whether or not an SSE move is aligned---it can't be computed at runtime. I don't think passing an extra Int# argument (or whatever) to a primop is going to work.
Ah, but sometimes optimization exposes that information statically (i.e. by inlining). In my case I know Array# is word-aligned and if someone uses memcpy with a 0 offset the compiler might spot this and use the right alignment (this is what happens today). Now, if e.g. ByteArray# can never allocated 16-byte aligned, this doesn't help us much.
So you are suggesting that if the inliner doesn't happen to expose the argument statically, then we should fall back to unaligned SSE move instructions?