[LLVMdev] stack alignment (again)

Chuck Rose III cfr at adobe.com
Fri Mar 28 17:17:19 PDT 2008


Hola LLVMers,

 

I was curious about the state of stack alignment on x86.  I noticed
there are a few bugs outstanding on the issue.  I recently added some
code which had the effect of throwing an extra function parameter on our
stack at runtime, a 4 byte pointer.  

 

Esp is now not 16-byte aligned, so instructions like unpcklps xmm1,
dword ptr [eps] cause grief.  My AllocaInstr instructions are told to be
16 byte aligned, so the addition of a 4-byte parameter shouldn't have
changed alignment on the objects.

 

The unpcklps instruction is coming from an ExtractElementInst or
InsertElementInst.  I can always hard code these by cyling my vectors to
memory and doing things one scalar at a time, though perf will suffer.
I'll try it Monday to see if it gets rid of the alignment sensitive
instructions.

 

I'm noticing this under windows via JIT.  I'm going to check to see if
my mac has similar issues.

 

Thanks,

Chuck. 

 

 

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


More information about the llvm-dev mailing list