Camille GILLOT
382cc909d5
Make the check for cache opt-in.
2023-03-11 22:41:01 +00:00
Camille GILLOT
1ca103a168
Ensure value is on the on-disk cache before returning.
2023-03-11 22:41:01 +00:00
John Kåre Alsaker
62e4bcb168
Address comments
2023-03-09 08:00:40 +01:00
John Kåre Alsaker
60ed37c2e1
Move dep graph methods to DepGraphData to avoid branches and unwraps
2023-03-09 06:14:34 +01:00
John Kåre Alsaker
955549955f
Check that a query has not completed and is not executing before starting it
2023-03-08 07:33:38 +01:00
bors
e3dfeeaa45
Auto merge of #108167 - Zoxc:query-config-instance-slim, r=cjgillot
...
Make `rustc_query_system` take `QueryConfig` by instance.
This allows for easy switching between virtual tables and specialized instances for queries. It also has the benefit of less turbofish. `QueryStorage` has also been merged with `QueryCache`.
Split out from https://github.com/rust-lang/rust/pull/107937 .
r? `@cjgillot`
2023-03-07 18:55:36 +00:00
John Kåre Alsaker
10b08e3c9c
Fix a race in the query system
2023-02-28 07:47:58 +01:00
John Kåre Alsaker
3b26d71e04
Avoid implementing Debug for QueryConfig
2023-02-26 23:35:52 +01:00
John Kåre Alsaker
3fd7c4a17d
Make rustc_query_system take QueryConfig by instance.
2023-02-26 23:35:47 +01:00
John Kåre Alsaker
dd73080cc0
Don't inline try_execute_query
2023-02-25 06:11:02 +01:00
John Kåre Alsaker
ab5d3fbe7d
Add inlining attributes for query system functions
2023-02-25 06:11:02 +01:00
John Kåre Alsaker
a049550c45
Move ensure_sufficient_stack to try_execute_query callers
2023-02-25 06:11:01 +01:00
John Kåre Alsaker
5fa60a5d25
Reduce calls to current_query_job
2023-02-25 06:11:01 +01:00
Dylan DPC
440113ddf6
Rollup merge of #108169 - Zoxc:query-key-copy, r=cjgillot
...
Make query keys `Copy`
This regressed compiler performance locally, so I'm curious what perf will say about it.
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.7566s</td><td align="right">1.7657s</td><td align="right"> 0.52%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2572s</td><td align="right">0.2578s</td><td align="right"> 0.20%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">0.9863s</td><td align="right">0.9900s</td><td align="right"> 0.37%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6018s</td><td align="right">1.6073s</td><td align="right"> 0.34%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.2493s</td><td align="right">6.2920s</td><td align="right"> 0.68%</td></tr><tr><td>Total</td><td align="right">10.8512s</td><td align="right">10.9127s</td><td align="right"> 0.57%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">1.0042s</td><td align="right"> 0.42%</td></tr></table>
2023-02-24 12:02:41 +05:30
John Kåre Alsaker
056c5b3b57
Make query keys Copy
2023-02-21 22:15:46 +01:00
bors
f77f4d55bd
Auto merge of #107542 - compiler-errors:param-envs-with-inference-vars-are-cursed, r=jackh726
...
Don't call `with_reveal_all_normalized` in const-eval when `param_env` has inference vars in it
**what:** This slightly shifts the order of operations from an existing hack:
5b6ed253c4/compiler/rustc_middle/src/ty/consts/kind.rs (L225-L230)
in order to avoid calling a tcx query (`TyCtxt::reveal_opaque_types_in_bounds`, via `ParamEnv::with_reveal_all_normalized`) when a param-env has inference variables in it.
**why:** This allows us to enable fingerprinting of query keys/values outside of incr-comp in deubg mode, to make sure we catch other places where we're passing infer vars and other bad things into query keys. Currently that (bbf33836b9 ) crashes because we introduce inference vars into a param-env in the blanket-impl finder in rustdoc 😓
5b6ed253c4/src/librustdoc/clean/blanket_impl.rs (L43)
See the CI failure here: https://github.com/rust-lang/rust/actions/runs/4058194838/jobs/6984834619
2023-02-18 23:43:42 +00:00
Oli Scherer
b4182d240a
Don't allow evaluating queries that were fed in a previous compiler run
2023-02-17 16:16:01 +00:00
bors
b5c8c329a7
Auto merge of #108058 - Zoxc:query-ctxtx-byval, r=cjgillot
...
Pass `DepContext` and `QueryContext` by value when practical
This removes some indirections for a minor performance improvement.
<table><tr><td rowspan="2">Benchmark</td><td colspan="1"><b>Before</b></th><td colspan="2"><b>After</b></th></tr><tr><td align="right">Time</td><td align="right">Time</td><td align="right">%</th></tr><tr><td>🟣 <b>clap</b>:check</td><td align="right">1.8294s</td><td align="right">1.8255s</td><td align="right"> -0.21%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2667s</td><td align="right">0.2669s</td><td align="right"> 0.07%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0080s</td><td align="right">1.0063s</td><td align="right"> -0.17%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6335s</td><td align="right">1.6295s</td><td align="right"> -0.24%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3633s</td><td align="right">6.3344s</td><td align="right"> -0.45%</td></tr><tr><td>Total</td><td align="right">11.1009s</td><td align="right">11.0627s</td><td align="right"> -0.34%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9980s</td><td align="right"> -0.20%</td></tr></table>
2023-02-17 08:23:53 +00:00
John Kåre Alsaker
caf29b2727
Remove parallel compiler fix
2023-02-16 14:55:05 +01:00
John Kåre Alsaker
067bf2ac13
Move provider fields back to rustc_query_impl
2023-02-16 14:55:05 +01:00
John Kåre Alsaker
a51a20531d
Factor query arena allocation out from query caches
2023-02-16 14:54:53 +01:00
Matthias Krüger
e087f61075
don't clone types that are copy
2023-02-15 23:34:25 +01:00
John Kåre Alsaker
b3a4fe7d4e
Pass DepContext and QueryContext by value when practical
2023-02-14 17:21:18 +01:00
John Kåre Alsaker
80d265240b
Create a single value cache for the () query key
2023-02-11 23:38:01 +01:00
bors
9433ba6394
Auto merge of #107644 - Zoxc:query-cache-tweak, r=cjgillot
...
Remove QueryStorage::store_nocache
This method was added in https://github.com/rust-lang/rust/pull/70674 but it doesn't seem to serve any purpose.
2023-02-08 16:59:18 +00:00
John Kåre Alsaker
d459840633
Remove QueryStorage::store_nocache
2023-02-07 17:36:01 +01:00
John Kåre Alsaker
9539737008
Make an optimal cold path for query_cache_hit
2023-02-06 15:22:12 +01:00
John Kåre Alsaker
e60ccfc6a9
Don't inline query_cache_hit to reduce code size of the query hot path.
2023-02-06 13:52:17 +01:00
Camille GILLOT
635ff8e2a8
Support parallel compiler.
2023-02-04 15:56:50 +00:00
Camille GILLOT
128f2224af
Remove OnHit callback from query caches.
...
This is not useful now that query results are `Copy`.
2023-02-04 15:21:21 +00:00
Michael Goulet
bbf33836b9
Fingerprint even when incr comp is disabled in debug mode
2023-01-31 20:43:29 +00:00
Maybe Waffle
6a28fb42a8
Remove double spaces after dots in comments
2023-01-17 08:09:33 +00:00
nils
fd7a159710
Fix uninlined_format_args for some compiler crates
...
Convert all the crates that have had their diagnostic migration
completed (except save_analysis because that will be deleted soon and
apfloat because of the licensing problem).
2023-01-05 19:01:12 +01:00
Nilstrieb
9fe4efe115
Abolish QueryVTable in favour of more assoc items on QueryConfig
...
This may introduce additional mono _but_ may help const fold things
better and especially may help not constructing a `QueryVTable` anymore
which is cheap but not free.
2023-01-02 20:22:19 +01:00
Matthias Krüger
d23cb738d2
Rollup merge of #105975 - jeremystucki:rustc-remove-needless-lifetimes, r=eholk
...
rustc: Remove needless lifetimes
2022-12-24 00:31:41 +01:00
bors
c2ff8ad035
Auto merge of #105550 - gimbles:master, r=Nilstrieb
...
Use `DepKind` instead of `&'static str` in `QueryStackFrame`
`@rustbot` author
Fixes #105168
2022-12-23 16:57:21 +00:00
gimbles
f8b30084ac
Use DepKind instead of &str
2022-12-23 18:39:49 +05:30
Jeremy Stucki
3dde32ca97
rustc: Remove needless lifetimes
2022-12-20 22:10:40 +01:00
KaDiWa
9bc69925cb
compiler: remove unnecessary imports and qualified paths
2022-12-10 18:45:34 +01:00
Camille GILLOT
9f2c6b0b09
Sanity check computed value for feeable queries.
2022-11-29 18:42:23 +00:00
Camille GILLOT
ee7a9a8641
Expand hash check.
2022-11-29 18:41:55 +00:00
Camille GILLOT
ca42dd6716
Sanity check fingerprints in the dep-graph.
2022-11-29 18:39:03 +00:00
bors
341d8b8a2c
Auto merge of #103808 - cjgillot:vec-cache, r=TaKO8Ki
...
Use an IndexVec to cache queries with index-like key
Revival of an old idea. Let's see if it has more effect.
r? `@ghost`
2022-11-24 06:32:23 +00:00
Nilstrieb
6d26ea86da
Rename Ctxt and CTX to Tcx and Qcx
...
This makes it consistent and clear which context is used.
2022-11-06 13:25:06 +01:00
Nilstrieb
16558bd267
Rename tcx to qcx when it's a QueryContext
2022-11-06 13:25:06 +01:00
Nilstrieb
91971f293c
Improve tracing logging
2022-11-06 13:25:06 +01:00
Nilstrieb
3da576804a
Rename incremental_verify_ich_cold to incremental_verify_ich_failed
2022-11-06 13:10:35 +01:00
Nilstrieb
36be251a35
Merge QueryDescription into QueryConfig
...
`QueryDescription` has gone through a lot of refactoring and doesn't
make sense anymore.
2022-11-05 16:24:13 +01:00
Camille GILLOT
bc9a202a22
Use Key impl to select cache.
2022-11-01 17:07:55 +00:00
Camille GILLOT
15d2f62bd2
Use VecCache for LocalDefId.
2022-11-01 17:02:51 +00:00