[Migrated] For loops need more optimizations
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 3.4k
- Forks
- 125
- PR merge metrics
- No merged PRs in 30d
Description
Issue automatically imported from old repo: https://github.com/EmbarkStudios/rust-gpu/issues/739
Old labels: t: enhancement,a: codegen
Originally creatd by hrydgard on 2021-08-30T12:50:21Z
Due to how for loops over a range work in Rust, a lot of scaffolding code is generated that is then expected to be optimized away, but in rust-gpu, that doesn't happen enough yet. We had a case where I had to change a for i in 0..8 {} to a while i < 8 { ...; i++ } loop to work around SPIRV-Cross making a right mess out of it.
Filing this issue to have something to point to from the code comment, mainly, not expectations for a quick resolution as I know it's a thorny one.
Contributor guide
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
The issue names Rust range-based for loops, rust-gpu code generation, and SPIRV-Cross, but provides no source file, test, or entry point. Start by locating the referenced code comment and the codegen path for range loops; done would require reducing the generated scaffolding and confirming that SPIRV-Cross produces acceptable output without the while-loop workaround.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100