Skip to content

Improve stack optimization pass #846

Open
@bjorn3

Description

@bjorn3
  • Fold stack_addr into load/store.
  • Remove stack_{addr,load} with unused return value.
  • Perform store to load forwarding when stack_addr is not used on a stack slot.
    • Single ebb store to load forwarding
    • Cross ebb store to load forwarding
    • Store to load forwarding with are multiple stores, but is always after others and before the load
    • Store to load forwarding with phi's
  • Remove redundant stack_store. (no stack_load between current and next stack_store and no stack_addr before current stack_store)
  • Fold stack_load into bitcast when stack_load is only used by that bitcast.

WIP implementation at https://github.com/bjorn3/rustc_codegen_cranelift/tree/opt_stack2reg
Edit: merged

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-enhancementCategory: An issue proposing an enhancement or a PR with one.optimize-speedThe speed of the generated executable

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions