-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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 and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an opt-in to store incoming edges in VecGraph
+ misc
#123980
Conversation
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in coverage instrumentation. cc @Zalathar |
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.
451c3cb
to
fa134b5
Compare
// 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice diagram! 💯
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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) 🙂
There was a problem hiding this comment.
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 |
…r, r=wesleywiser Add an opt-in to store incoming edges in `VecGraph` + misc r? `@fmease` needed for rust-lang#123939
…r, r=wesleywiser Add an opt-in to store incoming edges in `VecGraph` + misc r? ``@fmease`` needed for rust-lang#123939
…r, r=wesleywiser Add an opt-in to store incoming edges in `VecGraph` + misc r? `@fmease` needed for rust-lang#123939
…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` and `f128` 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
…r, r=wesleywiser Add an opt-in to store incoming edges in `VecGraph` + misc r? ``@fmease`` needed for rust-lang#123939
…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` and `f128` 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
…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` and `f128` 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
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
…int, r=compiler-errors Add a lint against never type fallback affecting unsafe code ~~I'm not very happy with the code quality... `VecGraph` not allowing you to get predecessors is very annoying. This should work though, so there is that.~~ (ended up updating `VecGraph` to support getting predecessors) ~~First few commits are from rust-lang#123934 rust-lang#123980
r? @fmease
needed for #123939