rust-lang / rust-lang/rustc_codegen_cranelift
Improve stack optimization pass
Open
Nobody has claimed this yet.
C-enhancement
optimize-speed
- Dominant language
- Rust
- Stars
- 2.1k
- Forks
- 157
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 3
Description
- Fold
stack_addrintoload/store. - Remove
stack_{addr,load}with unused return value. - Perform store to load forwarding when
stack_addris 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. (nostack_loadbetween current and nextstack_storeand nostack_addrbefore currentstack_store) - Fold
stack_loadintobitcastwhenstack_loadis only used by thatbitcast.
WIP implementation at https://github.com/bjorn3/rustc_codegen_cranelift/tree/opt_stack2reg
Edit: merged
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files, tests, or entry points are named. First verify the current stack optimization pass and whether the unchecked checklist items remain unresolved, since the issue notes that the WIP implementation was merged. Done would mean the remaining stack optimization cases are implemented and covered by the project's existing compiler tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 18/100