Add an opt-in to store incoming edges in VecGraph
+ misc by WaffleLapkin · Pull Request #123980 · rust-lang/rust (original) (raw)
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation7 Commits4 Checks12 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
Some changes occurred to MIR optimizations
cc @rust-lang/wg-mir-opt
Some changes occurred in coverage instrumentation.
cc @Zalathar
rustbot added S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
Relevant to the compiler team, which will review and decide on the PR/issue.
labels
WaffleLapkin changed the title
Add an opt-in to store incoming edges in VecGraph + misc Add an opt-in to store incoming edges in VecGraph
+ misc
It's required for the next commit.
Note that you can still have G = &H
, since there are implementations of all
the graph traits for references.
// similarly to its successors but offsetting by `edge_count`. `edge_count` is |
---|
// `edge_targets.len()/2` (again, in case BR is true) because half of the vec is back refs. |
// |
// All of this might be confusing, so here is an example graph and its representation: |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice diagram! 💯
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
@@ -1,99 +1,235 @@ |
---|
use crate::graph::{DirectedGraph, NumEdges, Successors}; |
use crate::graph::{DirectedGraph, NumEdges, Predecessors, Successors}; |
use rustc_index::{Idx, IndexVec}; |
#[cfg(test)] |
mod tests; |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: could you add a basic test or two for the predecessors functionality? (I think you also need to update some of the existing tests to compile with the extra generic parameter) 🙂
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not need to update existing tests, since the new generic parameter has a default.
I added a test for predecessors + added predecessor-aware mode for existing tests (so that we are more sure that enabling predecessors doesn't break other stuff).
@bors r=wesleywiser rollup=always
📌 Commit 523fe2b has been approved by wesleywiser
It is now in the queue for this repository.
bors added S-waiting-on-bors
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
and removed S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
labels
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request
…r, r=wesleywiser
Add an opt-in to store incoming edges in VecGraph
+ misc
r? @fmease
needed for rust-lang#123939
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request
…r, r=wesleywiser
Add an opt-in to store incoming edges in VecGraph
+ misc
r? @fmease
needed for rust-lang#123939
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request
…r, r=wesleywiser
Add an opt-in to store incoming edges in VecGraph
+ misc
r? @fmease
needed for rust-lang#123939
bors added a commit to rust-lang-ci/rust that referenced this pull request
…kingjubilee
Rollup of 6 pull requests
Successful merges:
- rust-lang#117919 (Introduce perma-unstable
wasm-c-abi
flag) - rust-lang#123571 (Correctly change type when adding adjustments on top of
NeverToAny
) - rust-lang#123752 (Properly handle emojis as literal prefix in macros)
- rust-lang#123980 ( Add an opt-in to store incoming edges in
VecGraph
+ misc) - rust-lang#124110 (Fix negating
f16
andf128
constants) - rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation)
r? @ghost
@rustbot
modify labels: rollup
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request
…r, r=wesleywiser
Add an opt-in to store incoming edges in VecGraph
+ misc
r? @fmease
needed for rust-lang#123939
bors added a commit to rust-lang-ci/rust that referenced this pull request
…kingjubilee
Rollup of 9 pull requests
Successful merges:
- rust-lang#117919 (Introduce perma-unstable
wasm-c-abi
flag) - rust-lang#123406 (Force exhaustion in iter::ArrayChunks::into_remainder)
- rust-lang#123752 (Properly handle emojis as literal prefix in macros)
- rust-lang#123935 (Don't inline integer literals when they overflow - new attempt)
- rust-lang#123980 ( Add an opt-in to store incoming edges in
VecGraph
+ misc) - rust-lang#124019 (Use raw-dylib for Windows synchronization functions)
- rust-lang#124110 (Fix negating
f16
andf128
constants) - rust-lang#124112 (Fix ICE when there is a non-Unicode entry in the incremental crate directory)
- rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation)
r? @ghost
@rustbot
modify labels: rollup
bors added a commit to rust-lang-ci/rust that referenced this pull request
…kingjubilee
Rollup of 7 pull requests
Successful merges:
- rust-lang#123406 (Force exhaustion in iter::ArrayChunks::into_remainder)
- rust-lang#123752 (Properly handle emojis as literal prefix in macros)
- rust-lang#123935 (Don't inline integer literals when they overflow - new attempt)
- rust-lang#123980 ( Add an opt-in to store incoming edges in
VecGraph
+ misc) - rust-lang#124019 (Use raw-dylib for Windows synchronization functions)
- rust-lang#124110 (Fix negating
f16
andf128
constants) - rust-lang#124116 (when suggesting RUST_BACKTRACE=1, add a special note for Miri's env var isolation)
r? @ghost
@rustbot
modify labels: rollup
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request
Rollup merge of rust-lang#123980 - WaffleLapkin:graph-average-refactor, r=wesleywiser
Add an opt-in to store incoming edges in VecGraph
+ misc
r? @fmease
needed for rust-lang#123939
bors added a commit to rust-lang-ci/rust that referenced this pull request
…int, r=compiler-errors
Add a lint against never type fallback affecting unsafe code
I'm not very happy with the code quality... (ended up updating VecGraph
not allowing you to get predecessors is very annoying. This should work though, so there is that.VecGraph
to support getting predecessors)
~~First few commits are from rust-lang#123934 rust-lang#123980
Labels
Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Relevant to the compiler team, which will review and decide on the PR/issue.