Skip to content

Commit

Permalink
Prefetch exported symbols
Browse files Browse the repository at this point in the history
  • Loading branch information
Zoxc committed Mar 19, 2020
1 parent 1a34cbc commit 03af82b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/librustc_metadata/rmeta/encoder.rs
Expand Up @@ -1726,10 +1726,15 @@ pub(super) fn encode_metadata(tcx: TyCtxt<'_>) -> EncodedMetadata {
|| {
// Prefetch some queries used by metadata encoding
tcx.dep_graph.with_ignore(|| {
par_for_each_in(tcx.mir_keys(LOCAL_CRATE), |&def_id| {
tcx.optimized_mir(def_id);
tcx.promoted_mir(def_id);
});
join(
|| {
par_for_each_in(tcx.mir_keys(LOCAL_CRATE), |&def_id| {
tcx.optimized_mir(def_id);
tcx.promoted_mir(def_id);
})
},
|| tcx.exported_symbols(LOCAL_CRATE),
);
})
},
)
Expand Down

0 comments on commit 03af82b

Please sign in to comment.