[LLVMdev] Spilling & UNPCKLPS Question

David Greene dag at cray.com
Fri Nov 20 14:45:54 PST 2009


On Friday 20 November 2009 14:49, David Greene wrote:
> I'm working on adding some more annotations to asm and I
> cam across this odd construct generated for X86/split-vector-rem.ll:
>
>         movss   %xmm0, 32(%rsp)                         # Scalar Spill
> [...]
>         unpcklps        48(%rsp), %xmm0                 # Vector Folded
> Reload [...]
>         movaps  %xmm0, 16(%rsp)                         # Vector Spill
> [...]
>         unpcklps        32(%rsp), %xmm0                 # Vector Folded
> Reload
>
> How is this possibly legal?  First we spill %xmm0 (a 32-bit value)
> to a stack slot that's onlt 16 bits wide (the next $rsp offsets are 48
> and 16).  Then we load 64 bits from 32(%rsp) via unpcklps and consider it a
> reload of the spill.
>
> This seems really wrong.  Can someone explain?

Hah.  I am silly.  bytes != bits.

I've been working in LLVM codegen for too long.  :)

                                     -Dave



More information about the llvm-dev mailing list