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

Eli Friedman eli.friedman at gmail.com
Thu Dec 22 16:29:29 PST 2011


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




More information about the llvm-commits mailing list