Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[X86] Redundant adjacent stack adjustments after call frame optimization #27514

Closed
zmodem opened this issue Mar 30, 2016 · 4 comments
Closed
Labels
backend:X86 bugzilla Issues migrated from bugzilla

Comments

@zmodem
Copy link
Collaborator

zmodem commented Mar 30, 2016

Bugzilla Link 27140
Resolution FIXED
Resolved on Apr 07, 2016 11:01
Version trunk
OS Linux
Blocks #26673
CC @qcolombet

Extended Description

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.

@qcolombet
Copy link
Collaborator

Strange, this should already been handled by X86FrameLowering::mergeSPUpdates.

@zmodem
Copy link
Collaborator Author

zmodem commented Mar 31, 2016

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

@zmodem
Copy link
Collaborator Author

zmodem commented Apr 7, 2016

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 llvm/llvm-bugzilla-archive#27076 .

@rnk
Copy link
Collaborator

rnk commented Nov 27, 2021

mentioned in issue llvm/llvm-bugzilla-archive#43155

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:X86 bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

3 participants