summary refs log tree commit diff
path: root/src/librustc/ty/query
AgeCommit message (Collapse)AuthorLines
2019-02-15Always emit an error for a query cycleJohn Kåre Alsaker-118/+84
2019-02-14Rollup merge of #58309 - wesleywiser:add_more_profiler_events, ↵Mazdak Farrokhzad-2/+15
r=michaelwoerister Add more profiler events - Adds Start\Stop events for time spent loading incremental query results from disk. - Adds Start\Stop events for time spent blocked waiting for queries to complete (when parallel queries are enabled). r? @michaelwoerister
2019-02-13Rollup merge of #58386 - Zoxc:fix-54242, r=michaelwoeristerMazdak Farrokhzad-58/+56
Fix #54242 r? @michaelwoerister
2019-02-13Rollup merge of #58273 - taiki-e:rename-dependency, r=matthewjasperMazdak Farrokhzad-15/+16
Rename rustc_errors dependency in rust 2018 crates I think this is a better solution than `use rustc_errors as errors` in `lib.rs` and `use crate::errors` in modules. Related: rust-lang/cargo#5653 cc #58099 r? @Centril
2019-02-13Cleanup importsTaiki Endo-15/+16
2019-02-13Rename rustc_errors dependency in rust 2018 cratesTaiki Endo-6/+6
2019-02-12Set the query in the ImplicitCtxt before trying to mark it greenJohn Kåre Alsaker-58/+56
2019-02-11Capture time spent blocked waiting on queriesWesley Wiser-2/+13
This captures time spent blocked when a query is waiting for another query to finish executing in another thread.
2019-02-11Add self profiler events for loading incremental query results from diskWesley Wiser-0/+2
2019-02-10rustc: doc commentsAlexander Regueiro-51/+52
2019-02-10Auto merge of #58085 - wesleywiser:profiler_2, r=wesleywiserbors-9/+10
Implement more detailed self profiling Timing data and cache hits/misses are now recorded at the query level. This allows us to show detailed per query information such as total time for each query. To see detailed query information in the summary pass the `-Z verbose` flag. For example: ``` rustc -Z self-profile -Z verbose hello_world.rs ``` results in something like: ```md Self profiling results: | Phase | Time (ms) | Time (%) | Queries | Hits (%) | ----------------------------------------- | -------------- | -------- | -------------- | -------- | Other | 177 | 54.97 | 8094 | 45.47 | - {time spent not running queries} | 113 | 35.09 | 0 | 0.00 | - const_eval | 16 | 4.97 | 26 | 11.54 | - type_of | 9 | 2.80 | 627 | 27.75 | - const_eval_raw | 8 | 2.48 | 22 | 0.00 | - adt_def | 7 | 2.17 | 381 | 11.55 | - visible_parent_map | 7 | 2.17 | 99 | 98.99 | - item_attrs | 6 | 1.86 | 698 | 50.14 | - item_children | 5 | 1.55 | 2815 | 0.00 | - adt_dtorck_constraint | 4 | 1.24 | 2 | 0.00 | - adt_destructor | 2 | 0.62 | 15 | 86.67 | TypeChecking | 53 | 16.46 | 2834 | 79.89 | - trait_impls_of | 9 | 2.80 | 65 | 86.15 | - evaluate_obligation | 7 | 2.17 | 80 | 2.50 | - const_is_rvalue_promotable_to_static | 6 | 1.86 | 1 | 0.00 | - is_copy_raw | 6 | 1.86 | 29 | 58.62 | - rvalue_promotable_map | 6 | 1.86 | 2 | 50.00 | - {time spent not running queries} | 6 | 1.86 | 0 | 0.00 | - typeck_item_bodies | 5 | 1.55 | 1 | 0.00 | - typeck_tables_of | 5 | 1.55 | 19 | 94.74 | - dropck_outlives | 2 | 0.62 | 1 | 0.00 | - layout_raw | 1 | 0.31 | 668 | 87.87 | Linking | 48 | 14.91 | 43 | 46.51 | - {time spent not running queries} | 48 | 14.91 | 0 | 0.00 | Codegen | 29 | 9.01 | 420 | 61.90 | - {time spent not running queries} | 16 | 4.97 | 0 | 0.00 | - collect_and_partition_mono_items | 11 | 3.42 | 13 | 92.31 | - mir_const | 1 | 0.31 | 1 | 0.00 | - mir_validated | 1 | 0.31 | 3 | 66.67 | Expansion | 14 | 4.35 | 0 | 0.00 | - {time spent not running queries} | 14 | 4.35 | 0 | 0.00 | BorrowChecking | 1 | 0.31 | 12 | 41.67 | - borrowck | 1 | 0.31 | 2 | 50.00 | Parsing | 0 | 0.00 | 0 | 0.00 Optimization level: No Incremental: off ``` <details> <summary>Rendered</summary> Self profiling results: | Phase | Time (ms) | Time (%) | Queries | Hits (%) | ----------------------------------------- | -------------- | -------- | -------------- | -------- | **Other** | **177** | **54.97** | **8094** | **45.47** | - {time spent not running queries} | 113 | 35.09 | 0 | 0.00 | - const_eval | 16 | 4.97 | 26 | 11.54 | - type_of | 9 | 2.80 | 627 | 27.75 | - const_eval_raw | 8 | 2.48 | 22 | 0.00 | - adt_def | 7 | 2.17 | 381 | 11.55 | - visible_parent_map | 7 | 2.17 | 99 | 98.99 | - item_attrs | 6 | 1.86 | 698 | 50.14 | - item_children | 5 | 1.55 | 2815 | 0.00 | - adt_dtorck_constraint | 4 | 1.24 | 2 | 0.00 | - adt_destructor | 2 | 0.62 | 15 | 86.67 | TypeChecking | 53 | 16.46 | 2834 | 79.89 | - trait_impls_of | 9 | 2.80 | 65 | 86.15 | - evaluate_obligation | 7 | 2.17 | 80 | 2.50 | - const_is_rvalue_promotable_to_static | 6 | 1.86 | 1 | 0.00 | - is_copy_raw | 6 | 1.86 | 29 | 58.62 | - rvalue_promotable_map | 6 | 1.86 | 2 | 50.00 | - {time spent not running queries} | 6 | 1.86 | 0 | 0.00 | - typeck_item_bodies | 5 | 1.55 | 1 | 0.00 | - typeck_tables_of | 5 | 1.55 | 19 | 94.74 | - dropck_outlives | 2 | 0.62 | 1 | 0.00 | - layout_raw | 1 | 0.31 | 668 | 87.87 | Linking | 48 | 14.91 | 43 | 46.51 | - {time spent not running queries} | 48 | 14.91 | 0 | 0.00 | Codegen | 29 | 9.01 | 420 | 61.90 | - {time spent not running queries} | 16 | 4.97 | 0 | 0.00 | - collect_and_partition_mono_items | 11 | 3.42 | 13 | 92.31 | - mir_const | 1 | 0.31 | 1 | 0.00 | - mir_validated | 1 | 0.31 | 3 | 66.67 | Expansion | 14 | 4.35 | 0 | 0.00 | - {time spent not running queries} | 14 | 4.35 | 0 | 0.00 | BorrowChecking | 1 | 0.31 | 12 | 41.67 | - borrowck | 1 | 0.31 | 2 | 50.00 | Parsing | 0 | 0.00 | 0 | 0.00 Optimization level: No Incremental: off </details> cc @nikomatsakis @michaelwoerister @Zoxc Fixes #54141
2019-02-08Remove no_hash from optimized_mirJohn Kåre Alsaker-1/+1
2019-02-08Move no_hash from mir_built to optimized_mirJohn Kåre Alsaker-2/+2
2019-02-08Remove no_hash from typeck_tables_ofJohn Kåre Alsaker-1/+1
2019-02-08Remove no_hash from optimized_mirJohn Kåre Alsaker-1/+1
2019-02-08Add a query type which is always marked as red if it runsJohn Kåre Alsaker-15/+38
2019-02-07Implement more detailed self profilingWesley Wiser-9/+10
Timing data and cache hits/misses are now recorded at the query level. This allows us to show detailed per query information such as total time for each query. To see detailed query information in the summary pass the `-Z verbose` flag. For example: ``` rustc -Z self-profile -Z verbose hello_world.rs ```
2019-02-05move librustc to 2018Mark Mansi-114/+116
2019-01-29Only store the result of mir_borrowck for closuresJohn Kåre Alsaker-26/+29
2019-01-29Make impl_wf_check incrementalJohn Kåre Alsaker-0/+12
2019-01-29Add an ensure() method to TyCtxt used to ensure queries are runJohn Kåre Alsaker-12/+21
2019-01-28Use multiple threads by default. Limits tests to one thread. Do some renaming.John Kåre Alsaker-26/+26
2019-01-26Auto merge of #55641 - nagisa:optimize-attr, r=pnkfelixbors-1/+11
Implement optimize(size) and optimize(speed) attributes This PR implements both `optimize(size)` and `optimize(speed)` attributes. While the functionality itself works fine now, this PR is not yet complete: the code might be messy in places and, most importantly, the compiletest must be improved with functionality to run tests with custom optimization levels. Otherwise the new attribute cannot be tested properly. Oh, and not all of the RFC is implemented – attribute propagation is not implemented for example. # TODO * [x] Improve compiletest so that tests can be written; * [x] Assign a proper error number (E9999 currently, no idea how to allocate a number properly); * [ ] Perhaps reduce the duplication in LLVM attribute assignment code…
2019-01-25Rollup merge of #57652 - mark-i-m:remove-old, r=nikomatsakisMazdak Farrokhzad-301/+2
Update/remove some old readmes r? @nikomatsakis cc #48478 There are a bunch of READMEs with content that I would like to see a final decision made on: - https://github.com/rust-lang/rust/tree/master/src/librustc/ty/query - https://github.com/rust-lang/rust/tree/master/src/librustc/dep_graph - https://github.com/rust-lang/rust/blob/master/src/librustc/infer/region_constraints - https://github.com/rust-lang/rust/tree/master/src/librustc/infer/higher_ranked - https://github.com/rust-lang/rust/tree/master/src/librustc/infer/lexical_region_resolve - https://github.com/rust-lang/rust/blob/master/src/librustc_borrowck/borrowck It's not clear how useful or obsolete any of these are. I would really appreciate if the appropriate domain experts for each of these could respond with one of (a) delete it, (b) wait for system to be remove, or (c) move it to rustc-guide. @nikomatsakis do you know who to ping for any of these (sorry, I suspect many of them are you)?
2019-01-24Implement optimize(size) and optimize(speed)Simonas Kazlauskas-1/+11
2019-01-19Auto merge of #57752 - Centril:rollup, r=Centrilbors-1/+14
Rollup of 10 pull requests Successful merges: - #57268 (Add a target option "merge-functions", and a corresponding -Z flag (works around #57356)) - #57476 (Move glob map use to query and get rid of CrateAnalysis) - #57501 (High priority resolutions for associated variants) - #57573 (Querify `entry_fn`) - #57610 (Fix nested `?` matchers) - #57634 (Remove an unused function argument) - #57653 (Make the contribution doc reference the guide more) - #57666 (Generalize `huge-enum.rs` test and expected stderr for more cross platform cases) - #57698 (Fix typo bug in DepGraph::try_mark_green().) - #57746 (Update README.md) Failed merges: r? @ghost
2019-01-19Rollup merge of #57573 - Xanewok:querify-entry-fn, r=ZoxcMazdak Farrokhzad-1/+11
Querify `entry_fn` Analogous to https://github.com/rust-lang/rust/pull/57570 but this will also require few fixups in Miri so I decided to separate that (and it seems [CI doesn't let us break tools anymore](https://github.com/rust-lang/rust/pull/57392#issuecomment-453801540)? Or was that because it was a rollup PR?) r? @nikomatsakis
2019-01-19Rollup merge of #57476 - Xanewok:bye-crate-analysis, r=ZoxcMazdak Farrokhzad-0/+3
Move glob map use to query and get rid of CrateAnalysis ~Also includes commits from ~https://github.com/rust-lang/rust/pull/57392~ and ~https://github.com/rust-lang/rust/pull/57436~.~ With glob map calculated unconditionally in https://github.com/rust-lang/rust/pull/57392, this PR moves the calculated glob map to `GlobalCtxt` and exposes a relevant query (as we do with other queries which copy precomputed data over from the `Resolver`). This allows us to get rid of the `CrateAnalysis` struct in an attempt to simplify the compiler interface. cc @Zoxc r? @nikomatsakis @Zoxc @petrochenkov
2019-01-19Auto merge of #57253 - Zoxc:incr-passes2, r=michaelwoeristerbors-0/+36
Make privacy checking, intrinsic checking and liveness checking incremental Blocked on https://github.com/rust-lang/rust/pull/51487 r? @michaelwoerister
2019-01-18remove more old readmesmark-301/+2
2019-01-17Querify glob map usage (last use of CrateAnalysis)Igor Matuszewski-0/+3
2019-01-15Make the query comment into a doc commentIgor Matuszewski-1/+2
2019-01-15Querify entry_fnIgor Matuszewski-1/+10
2019-01-15Optimize try_mark_green and eliminate the lock on dep node colorsJohn Kåre Alsaker-41/+8
2019-01-15Make privacy checking, intrinsic checking and liveness checking incrementalJohn Kåre Alsaker-0/+36
2019-01-14Rollup merge of #57480 - Zoxc:query-fix, r=michaelwoeristerMazdak Farrokhzad-20/+21
Clean up and fix a bug in query plumbing r? @michaelwoerister
2019-01-13Auto merge of #57580 - Centril:rollup, r=Centrilbors-42/+54
Rollup of 4 pull requests Successful merges: - #56874 (Simplify foreign type rendering.) - #57113 (Move diagnostics out from QueryJob and optimize for the case with no diagnostics) - #57366 (Point at match discriminant on type error in match arm pattern) - #57538 (librustc_mir: Fix ICE with slice patterns) Failed merges: - #57381 (Tweak output of type mismatch between "then" and `else` `if` arms) r? @ghost
2019-01-11Make more passes incrementalJohn Kåre Alsaker-1/+63
2019-01-09Clean up and fix a bug in query plumbingJohn Kåre Alsaker-20/+21
2019-01-08Move diagnostics out from QueryJob and optimize for the case with no diagnosticsJohn Kåre Alsaker-42/+54
2019-01-08Auto merge of #57114 - Zoxc:query-perf11, r=michaelwoeristerbors-1/+1
Clean up and optimize OpenTask / read_index r? @michaelwoerister
2019-01-07Rename some functionsJohn Kåre Alsaker-2/+2
2019-01-07Fix and optimize query profilingJohn Kåre Alsaker-22/+26
2019-01-05Rollup merge of #57295 - d-e-s-o:topic/be-be, r=zackmdaviskennytm-1/+1
Fix 'be be' constructs I noticed a duplicated "be" somewhere in the code. A search for it manifested a couple more locations with the same problem. This change removes one of the "be"s.
2019-01-05Auto merge of #56837 - arielb1:nonprincipal-trait-objects, r=nikomatsakisbors-0/+3
Add support for trait-objects without a principal The hard-error version of #56481 - should be merged after we do something about the `traitobject` crate. Fixes #33140. Fixes #57057. r? @nikomatsakis
2019-01-04Auto merge of #56723 - oli-obk:lazy_const, r=nikomatsakisbors-1/+1
Don't emit `Unevaluated` from `const_eval` cc @eddyb @RalfJung
2019-01-04implement a hack to make traitobject 0.1.0 compileAriel Ben-Yehuda-0/+3
2019-01-02Fix 'be be' constructsDaniel Mueller-1/+1
I noticed a duplicated "be" somewhere in the code. A search for it manifested a couple more locations with the same problem. This change removes one of the "be"s.
2019-01-02rename `type_moves_by_default` to `type_is_copy_modulo_regions`Niko Matsakis-1/+1
2019-01-01`<&'tcx ty::Const as Deref>::deref`Oliver Scherer-1/+1