-
Notifications
You must be signed in to change notification settings - Fork 13.9k
Closed
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-mir-optArea: MIR optimizationsArea: MIR optimizationsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.metabugIssues about issues themselves ("bugs about bugs")Issues about issues themselves ("bugs about bugs")
Description
As all efforts have more stalled, I'll use this to note down some ideas (cc @rust-lang/compiler):
-
rustc_mir::expand: take a MIR fragment (e.g. an intrinsic call) and lazily emit another MIR fragment which is the equivalent expansion -
rustc_mir::reduce: generalized dataflow toolkit for writing localized transformations which must cause dataflow information to converge, and thus can be run until fixpoint- this will require require a lot of design work if we want to pull it off, at least for anything more than constant folding and CFG simplification
- similar to
expandbut instead of (just) emitting a MIR fragment, a few blessed mutations (somewhat like @arielb1's patch tools) could be allowed, which are interpreted by the dataflow toolkit with minimal recomputation
- extract and cache the points of the CFG through which dataflow might change during iterations (e.g. loop bodies and the backedges pointing to them) to minimize the copies of the dataflow state that must be kept around - that is, a function with no loops should complete forward dataflow with no per-block state caching (assuming RPO traversal)
- would allow keeping more than plain bits without worrying as much about memory usage
- could let us switch to EBBs without caching the non-EBB CFG, which is what @Mark-Simulacrum hit when he attempted EBBs
- [[MIR] Restrict ProjectionElem::Index and Storage{Live,Dead} to Local. #44308]
useLocalinstead ofOperandfor index projections, so thatLvaluestops being a tree - [[MIR] Restrict ProjectionElem::Index and Storage{Live,Dead} to Local. #44308]
useLocalinstead ofLvalueinStorage{Live,Dead} - compress some lvalues (field/const-index paths) into
[u8; 8]/u64forO(1)dataflow lookup or even on-the-fly SROA - [MIR: split Operand::Consume into Copy and Move. #46142]
splitOperand::Consumeinto copies and moves, the latter invalidating all borrows - last-use analysis to turn the last copy of an unborrowed local into a move
- MIR borrowck could do more here, at least in safe code
- shrink/regenerate live ranges based on moves
- propagate destinations backwards (and sources forward?) through moves
- remove
Rvalue::Aggregatein favor of field assignment andSetDiscriminantSetDiscriminant(0)on non-enums can be pruned after borrowck runs
- track fields and overlaps within a local, in def-use chains
- [[Place 2.0] Convert Place's projection to a boxed slice #63420]
mir::Placeshould not be a recursive datastructure (https://paper.dropbox.com/doc/Place-2.0-current-PR-status--AYpEHnZVlMVhug5z7XDxiqgbAg-vmbnFv8VkCEuL57QfWWMH) - Make
Derefnot a place projection (https://paper.dropbox.com/doc/Place-2.0--AYrQzvo5k2eL2v57XD__sDrZAg-9NjhX4N9I3dEt6YCJM8Ln) - Make
Indexnot a place projection (https://paper.dropbox.com/doc/Place-2.0--AYrQzvo5k2eL2v57XD__sDrZAg-9NjhX4N9I3dEt6YCJM8Ln)
Techcable, oli-obk and Dushistovhanna-kruppe, Techcable and Dushistov
Metadata
Metadata
Assignees
Labels
A-MIRArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlArea: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.htmlA-mir-optArea: MIR optimizationsArea: MIR optimizationsC-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.metabugIssues about issues themselves ("bugs about bugs")Issues about issues themselves ("bugs about bugs")