[llvm-commits] [llvm][PATCH][Review Requested] Fix failure to realign stack on x86

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Jan 18 12:53:58 PST 2012


On Jan 18, 2012, at 12:30 PM, Gurd, Preston wrote:

> Thank you for your swift response, Jakob.
>  
> I am not the originator of this patch, but I have been tasked with getting it (or a better version) committed to the LLVM trunk.
>  
> The original problem came up when trying to run JITed code using 16 byte aligned memory accesses on x86 Android, where, for whatever reason, the stack pointer was not aligned mod 16 on entry.

This expression:

> unsigned StackAlign = TM.getFrameLowering()->getStackAlignment();

is the default stack alignment of the target you are compiling for.

MFI->getMaxAlignment() is the maximum alignment required by the slots in the current stack frame.

If the Android x86 ABI doesn't specify a 16-byte aligned stack, you need to ensure that the TargetFrameLowering class knows that. Look at the X86Subtarget class.

/jakob




More information about the llvm-commits mailing list