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 }})

WaffleLapkin

@rustbot

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

Some changes occurred in coverage instrumentation.

cc @Zalathar

@rustbot rustbot added S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.

labels

Apr 15, 2024

@WaffleLapkin 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

Apr 15, 2024

@WaffleLapkin

@WaffleLapkin

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.

@WaffleLapkin

wesleywiser

// 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).

@WaffleLapkin

@WaffleLapkin

@bors r=wesleywiser rollup=always

@bors

📌 Commit 523fe2b has been approved by wesleywiser

It is now in the queue for this repository.

@bors 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

Apr 18, 2024

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request

Apr 18, 2024

@GuillaumeGomez

…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

Apr 18, 2024

@GuillaumeGomez

…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

Apr 18, 2024

@workingjubilee

…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

Apr 18, 2024

@bors

…kingjubilee

Rollup of 6 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request

Apr 18, 2024

@workingjubilee

…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

Apr 19, 2024

@bors

…kingjubilee

Rollup of 9 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

bors added a commit to rust-lang-ci/rust that referenced this pull request

Apr 19, 2024

@bors

…kingjubilee

Rollup of 7 pull requests

Successful merges:

r? @ghost @rustbot modify labels: rollup

rust-timer added a commit to rust-lang-ci/rust that referenced this pull request

Apr 19, 2024

@rust-timer

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

May 2, 2024

@bors

…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

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

T-compiler

Relevant to the compiler team, which will review and decide on the PR/issue.