For example void f(int, int); void g() { f(1, 2); } Compiled with Clang 3.8 for 32-bit x86 Linux at -Os: g: subl $12, %esp subl $8, %esp pushl $2 pushl $1 calll f addl $16, %esp addl $12, %esp retl I'm working on a patch.
Strange, this should already been handled by X86FrameLowering::mergeSPUpdates.
(In reply to comment #1) > Strange, this should already been handled by > X86FrameLowering::mergeSPUpdates. I think we need to call that some more :-) Sent out http://reviews.llvm.org/D18627
r265623 fixes most of these. The impact was very small (~3KB on chrome_child.dll) but at least the code looks less silly. There is still opportunities to clean up more %esp adjustment, for example if we're doing "add $4, %esp" but %esp is actually dead because we later do "mov %esp, %esi" or something, but that would be a different project, maybe part of PR27076.