[llvm-commits] Intel Atom optimization - use LEA to adjust stack pointer

Zhang, Andy andy.zhang at intel.com
Fri Dec 23 10:23:28 PST 2011


On Thursday, December 22, 2011 7:29 PM, Eli Friedman <eli.friedman at gmail.com> wrote: 
> On Wed, Dec 21, 2011 at 2:28 PM, Zhang, Andy <andy.zhang at intel.com>
> wrote:
> > Hi all,
> >
> > Please find attached a patch that implements an optimization for the
> Intel Atom processor. We can avoid an ALU to AGU dependency by using
> the LEA instruction to update the stack pointer so as to prevent a
> stall, as recommended by the Intel Optimization Reference Manual
> (coding rule 5, specifically).
> >
> > Commit message:
> >
> > Use LEA instruction to adjust stack pointer when generating code for
> Atom to
> > avoid an ALU to AGU dependency (and subsequent stall).
> > - Modified stack pointer adjustment in X86FrameLowering to emit LEA
> >  instructions instead of SUB/ADD when Atom is specified or detected.
> > - Created lit tests for allocating on the stack (array and scalars),
> and
> >  calling a function with many arguments.
> > - Modified TableGen to use 'const uint64_t' instead of an anonymous
> enum
> >  when there are more than 32 subtarget features. When compiling with
> >  Visual C++, enums are always 'int's, so "1 << 32" overflows.
> >
> > I'd like to commit this to LLVM trunk; your feedback would be most
> appreciated.
> 
> It looks like you forgot to include your tests in the patch.
> Otherwise, I don't see any issues.
> 
> -Eli

Sorry, looks like I forgot to add the test file to svn before creating the patch. Attached is the patch including the tests.

Regards,
Andy
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lea_sp.diff
Type: application/octet-stream
Size: 12441 bytes
Desc: lea_sp.diff
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20111223/cfe65e34/attachment.obj>


More information about the llvm-commits mailing list