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

[llvm][peephole] merge successive stack pointer modifications #58237

Closed
nickdesaulniers opened this issue Oct 7, 2022 · 3 comments
Closed

[llvm][peephole] merge successive stack pointer modifications #58237

nickdesaulniers opened this issue Oct 7, 2022 · 3 comments
Labels
invalid Resolved as invalid, i.e. not a bug

Comments

@nickdesaulniers
Copy link
Member

for an i386 linux kernel build, I noticed in the prolog of core_sys_select() that we have:

     380: 55                            pushl   %ebp
     381: 89 e5                         movl    %esp, %ebp
     383: 53                            pushl   %ebx
     384: 57                            pushl   %edi
     385: 56                            pushl   %esi
     386: 83 e4 f8                      andl    $-8, %esp
     389: 81 ec f0 03 00 00             subl    $1008, %esp

Can't we merge the and of a negative value with the sub of a positive value into one instruction? I don't see control flow reliant on one of those vs both.

@nickdesaulniers nickdesaulniers changed the title [llvm][peephole] merge successive stack point modifications [llvm][peephole] merge successive stack pointer modifications Oct 7, 2022
@llvmbot
Copy link
Collaborator

llvmbot commented Oct 7, 2022

@llvm/issue-subscribers-backend-x86

@asl
Copy link
Collaborator

asl commented Oct 7, 2022

@nickdesaulniers How? It's and not add. It is used for stack realignment here...

@nickdesaulniers
Copy link
Member Author

d'oh! For some reason I was reading that as ADD...

@nickdesaulniers nickdesaulniers added invalid Resolved as invalid, i.e. not a bug and removed backend:X86 missed-optimization labels Oct 10, 2022
@EugeneZelenko EugeneZelenko closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Resolved as invalid, i.e. not a bug
Projects
None yet
Development

No branches or pull requests

4 participants