Skip to content
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

incr.comp.: Introduce the concept of anonymous DepNodes and use them for trait selection #42769

Closed

Conversation

michaelwoerister
Copy link
Member

This PR implements "anonymous" DepNodes, which are DepNodes the identity of which is not known beforehand and is automatically computed from its set of input edges. These nodes allow for fine-grained dependency tracking in cases like trait selection where it is hard to come up with a good DepNode ID.

This is an important step towards implementing #42298.

r? @nikomatsakis

@arielb1 arielb1 added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 20, 2017
if self.current_node().is_some() {
let source = self.make_node(v);
self.add_edge_from_current_node(|current| (source, current))
match self.task_stack.last_mut() {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, this can't be right: We are ignoring reads from anonymous tasks :/

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The OpenTask::Anon variant is missing from the match, so reads during anonymous tasks are just dropped. I should have made the match exhaustive indeed :)

I'm in the process of fixing this but there are some complications (especially around

self.dep_graph.read(data.dep_node(tcx));
).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see what you mean. Indeed, this is broken. Ha, score one for my persnicketiness about being exhaustive. =)

let forbidden_edge = if !ENABLED {
None
} else {
match env::var("RUST_FORBID_DEP_GRAPH_EDGE") {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there no value to this check anymore? Does it not make sense in the new environment?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(It still seems fairly useful to me =)

reads.push(v);
}
}
_ => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: exhaustive plz =)

@Mark-Simulacrum
Copy link
Member

@michaelwoerister Looks like this is waiting on some changes from you.

@michaelwoerister
Copy link
Member Author

@Mark-Simulacrum Yes, this PR is currently on hold because of an issue with caching DepNodes in trait selection.

@michaelwoerister
Copy link
Member Author

I'm closing this in favor of #43028 and a subsequent PR that will introduce anonymous nodes without using them for trait selection yet.

bors added a commit that referenced this pull request Jul 10, 2017
incr.comp.: Deduplicate some DepNodes and introduce anonymous DepNodes

This is a parallel PR to the pending #42769. It implements most of what is possible in terms of DepNode re-opening without having anonymous DepNodes yet (#42298).

r? @nikomatsakis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants