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

More parallel tweaks #68218

Closed
wants to merge 43 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
c5d42b1
Ensure all iterations in Rayon iterators run in the presence of panics
Zoxc Jan 13, 2020
69276ba
Update tests
Zoxc Jan 13, 2020
934abf2
Use $crate
Zoxc Jan 16, 2020
c621cd6
Parallelize type collecting and item-types checking
Zoxc Jan 2, 2020
8c07291
Tweak misc checking 1
Zoxc Jan 2, 2020
bef0c61
Run item-types checking and item-bodies checking in parallel
Zoxc Jan 3, 2020
337d647
Handle panics with `join`
Zoxc Jan 3, 2020
6b67617
Make typeck_item_bodies eval_always
Zoxc Jan 3, 2020
6283565
Make coherence checking parallel
Zoxc Jan 3, 2020
efe44ff
Move privacy_access_levels out of misc checking 3 and run it in paral…
Zoxc Jan 3, 2020
ff125ff
Move some other passes into a parallel block
Zoxc Jan 3, 2020
7a6895f
Make liveness checking more parallel
Zoxc Jan 3, 2020
db0bd38
Prefetch upstream_monomorphizations
Zoxc Jan 3, 2020
171b1bb
Add a new misc checking 3 block
Zoxc Jan 3, 2020
133190b
Prefetch lint_levels and visible_parent_map
Zoxc Jan 4, 2020
f68672b
Fix duplicate test fallout
Zoxc Jan 11, 2020
c7aabbd
Drop `ensure` for privacy_access_levels. Add some comments.
Zoxc Jan 13, 2020
477ad98
Calculate accessor_map in parallel earlier
Zoxc Jan 11, 2020
85fa6a8
Add par_partition
Zoxc Jan 14, 2020
e478795
Parallelize place_root_mono_items
Zoxc Jan 11, 2020
730689e
Estimate CGU cost in place_root_mono_items
Zoxc Jan 12, 2020
1a37f05
Parallelize assert_symbols_are_distinct
Zoxc Jan 12, 2020
20fd50d
Make impl WF inference more parallel
Zoxc Jan 12, 2020
0fdcfe1
Check `Copy` impls in parallel
Zoxc Jan 12, 2020
98d0f7d
Prefetch mir_keys
Zoxc Jan 12, 2020
2bc0d3f
Use a parallel block for coherence checking
Zoxc Jan 12, 2020
9bfdcde
Ensure type checking each function is stealable by other threads
Zoxc Jan 13, 2020
c010632
Tune misc_checking_1
Zoxc Jan 13, 2020
36cbf0e
Prefetch queries used by the metadata encoder
Zoxc Jan 4, 2020
d739ca9
Encode exported symbols last
Zoxc Jan 11, 2020
9f257bb
Prefetch exported symbols
Zoxc Jan 11, 2020
8ea0206
Make the timer more verbose
Zoxc Jan 11, 2020
4cea70f
Make metadata prefetching more accurate
Zoxc Jan 13, 2020
6674519
Run HIR indexing and loading of query results in parallel
Zoxc Jan 9, 2020
fbb9396
Move check_for_entry_fn and check_unused to a later stage
Zoxc Jan 14, 2020
13910d4
Add sync::spawn
Zoxc Jan 9, 2020
9972b3e
Add a Future type
Zoxc Jan 7, 2020
1e02626
Drop the AST in the background
Zoxc Jan 9, 2020
62b7273
Run link_binary_remove_temps in the background
Zoxc Jan 10, 2020
64f2bbd
Make copy_cgu_workproducts_to_incr_comp_cache_dir parallel
Zoxc Jan 10, 2020
0a36b4d
Do incremental setup in the background
Zoxc Jan 11, 2020
3e2090c
Check Session reference count
Zoxc Jan 14, 2020
a6ca4ff
Run early lint checks in the background
Zoxc Jan 7, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use a parallel block for coherence checking
Zoxc committed Jan 16, 2020
commit 2bc0d3fb277e7098fc843d5cd7af1dc3266f06f9
31 changes: 21 additions & 10 deletions src/librustc_typeck/coherence/mod.rs
Original file line number Diff line number Diff line change
@@ -142,16 +142,27 @@ fn coherent_trait(tcx: TyCtxt<'_>, def_id: DefId) {
}

pub fn check_coherence(tcx: TyCtxt<'_>) {
par_for_each(&tcx.hir().krate().trait_impls, |(&trait_def_id, _)| {
tcx.ensure().coherent_trait(trait_def_id);
});

tcx.sess.time("unsafety_checking", || unsafety::check(tcx));
tcx.sess.time("orphan_checking", || orphan::check(tcx));

// these queries are executed for side-effects (error reporting):
tcx.ensure().crate_inherent_impls(LOCAL_CRATE);
tcx.ensure().crate_inherent_impls_overlap_check(LOCAL_CRATE);
parallel!(
{
par_for_each(&tcx.hir().krate().trait_impls, |(&trait_def_id, _)| {
tcx.ensure().coherent_trait(trait_def_id);
});
},
{
tcx.sess.time("unsafety_checking", || unsafety::check(tcx));
},
{
tcx.sess.time("orphan_checking", || orphan::check(tcx));
},
{
// This query is executed for side-effects (error reporting)
tcx.ensure().crate_inherent_impls(LOCAL_CRATE);
},
{
// This query is executed for side-effects (error reporting)
tcx.ensure().crate_inherent_impls_overlap_check(LOCAL_CRATE);
}
);
}

/// Overlap: no two impls for the same trait are implemented for the
3 changes: 3 additions & 0 deletions src/librustc_typeck/lib.rs
Original file line number Diff line number Diff line change
@@ -75,6 +75,9 @@ extern crate log;
#[macro_use]
extern crate rustc;

#[macro_use]
extern crate rustc_data_structures;

// This is used by Clippy.
pub mod expr_use_visitor;