[LLVMdev] Win64 bugs

Eli Friedman eli.friedman at gmail.com
Thu Jul 30 17:54:50 PDT 2009


On Thu, Jul 30, 2009 at 5:32 PM, Peter Shugalev<peter at shugalev.com> wrote:
> Hello!
>
> I've just tried generating Win64 code and the result is not that good.
>
> First of all, XMM registers are saved without reason to do so. Not only
> this slows the performance but leads to random crashes too. XMMs are
> stored to the stack with MOVAPS instruction which requires 16-byte
> alignment which is not always the case. lli.exe (built in debug mode)
> randomly crashes on some simple hello-world-alike tests due to misalignment.

http://llvm.org/bugs/show_bug.cgi?id=3739 is about the extra XMM
stores; I thought the alignment was working, though...

> Though the most problematic stuff is the lack of 'shadow zone' support
> in Win64 ABI. Or maybe I haven't figured out how to turn this on. In
> Win64 any function can treat 32 bytes of stack (RSP+08h..RSP+28h just
> after the call instruction) as scratch data. VC++ compiler stores
> arguments passed in registers there. In debug builds this doesn't get
> optimized away.

Wow, that's really strange... I'm pretty sure that simply isn't implemented.

-Eli



More information about the llvm-dev mailing list