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

Only use the new DepNode hashmap for anonymous nodes. #109050

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
11 changes: 6 additions & 5 deletions compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,11 +1056,12 @@ pub fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) ->
// know that later). If we are not doing LTO, there is only one optimized
// version of each module, so we re-use that.
let dep_node = cgu.codegen_dep_node(tcx);
assert!(
!tcx.dep_graph.dep_node_exists(&dep_node),
"CompileCodegenUnit dep-node for CGU `{}` already exists before marking.",
cgu.name()
);
cjgillot marked this conversation as resolved.
Show resolved Hide resolved
tcx.dep_graph.assert_nonexistent_node(dep_node, || {
format!(
"CompileCodegenUnit dep-node for CGU `{}` already exists before marking.",
cgu.name()
)
});

if tcx.try_mark_green(&dep_node) {
// We can re-use either the pre- or the post-thinlto state. If no LTO is
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_incremental/src/persist/save.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ pub(crate) fn build_dep_graph(
sess.opts.dep_tracking_hash(false).encode(&mut encoder);

Some(DepGraph::new(
&sess.prof,
sess,
prev_graph,
prev_work_products,
encoder,
Expand Down
7 changes: 7 additions & 0 deletions compiler/rustc_query_system/src/dep_graph/edges.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,13 @@ impl EdgesVec {
Self::default()
}

#[inline]
pub(crate) fn eval_always() -> Self {
let mut vec = EdgesVec::new();
vec.push(DepNodeIndex::FOREVER_RED_NODE);
vec
}

#[inline]
pub(crate) fn push(&mut self, edge: DepNodeIndex) {
self.max = self.max.max(edge.as_u32());
Expand Down
Loading
Loading