Skip to content

Don't save/restore the stack if it's unused in the current function #1148

@bnjbvr

Description

@bnjbvr
  • What is the feature or code improvement you would like to do in Cranelift? Small functions which don't make usage of the stack will still preserve the stack pointer by saving it into the frame pointer register, which is spurious. It's a few instructions per call which could be removed in general.
  • What is the value of adding this in Cranelift? Runtime speedup.
  • Do you have an implementation plan, and/or ideas for data structures or
    algorithms to use? Have you considered alternative implementations? If so, how are they better
    or worse than your proposal? Implementation should be trivial: lookup the number of stack slots
    and don't preserve SP if there are no stack slots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    craneliftIssues related to the Cranelift code generatorcranelift:E-compiler-easyBeginner–Intermediate compiler issues.cranelift:goal:optimize-speedFocus area: the speed of the code produced by Cranelift.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions