[PATCH] [X86] Convert esp-relative movs of function arguments to pushes, step 1

Nadav Rotem nrotem at apple.com
Wed Dec 3 08:23:50 PST 2014


Hi Michael, 

Overall it looks really good.  Did you measure the performance of this patch on the llvm test suite?  Do you know if this transformation is beneficial for all recent x86 processors?  If it is not then we can enable it for specific processors. 

Also, can you use DenseMap instead of std::map?

Thanks,
Nadav

> On Dec 3, 2014, at 8:06 AM, Michael Kuperstein <michael.m.kuperstein at intel.com> wrote:
> 
> Hi nadav, delena, eliben,
> 
> I've started working on using pushes instead of esp-relative movs to pass function arguments.
> The main motivation is code size (e.g. 2 bytes instead of 7 to pass an 8-bit immediate), but it some cases it is also faster.
> 
> This is just the first step, that handles the simplest case:
> 1) x86-32 calling convention, everything is passed through the stack.
> 2) There is no reserved frame (for x86 this happens is there is a dynamic stack allocation in the caller).
> 
> Does this look reasonably sane?
> 
> http://reviews.llvm.org/D6503
> 
> Files:
>  lib/Target/X86/X86FrameLowering.cpp
>  lib/Target/X86/X86FrameLowering.h
>  test/CodeGen/X86/force-align-stack-alloca.ll
>  test/CodeGen/X86/inalloca-ctor.ll
>  test/CodeGen/X86/inalloca-invoke.ll
>  test/CodeGen/X86/inalloca-stdcall.ll
>  test/CodeGen/X86/mem-intrin-base-reg.ll
>  test/CodeGen/X86/movtopush.ll
> <D6503.16864.patch>





More information about the llvm-commits mailing list