Michael Woerister
7f01893900
Fix dependency tracking for debugger visualizers
2023-05-16 18:50:26 +02:00
bors
b652d9a0fd
Auto merge of #108062 - Zoxc:spec-incr, r=cjgillot
...
Specialize query execution for incremental and non-incremental
This specializes query execution for incremental and non-incremental by passing in a separate `dyn QueryEngine` types, taking advantage of the virtual dispatch to avoid a branch. This ends up duplicating `try_execute_query`, hopefully the compile time cost of that is relatively low.
This is a performance improvement for the non-incremental path:
<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.8420s</td><td align="right">1.8331s</td><td align="right"> -0.48%</td></tr><tr><td>🟣 <b>hyper</b>:check</td><td align="right">0.2652s</td><td align="right">0.2631s</td><td align="right"> -0.78%</td></tr><tr><td>🟣 <b>regex</b>:check</td><td align="right">1.0161s</td><td align="right">1.0062s</td><td align="right"> -0.98%</td></tr><tr><td>🟣 <b>syn</b>:check</td><td align="right">1.6408s</td><td align="right">1.6197s</td><td align="right">💚 -1.28%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check</td><td align="right">6.3939s</td><td align="right">6.3558s</td><td align="right"> -0.60%</td></tr><tr><td>Total</td><td align="right">11.1580s</td><td align="right">11.0780s</td><td align="right"> -0.72%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9918s</td><td align="right"> -0.82%</td></tr></table>
The incremental path is more neutral:
<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:initial</td><td align="right">2.2210s</td><td align="right">2.2227s</td><td align="right"> 0.08%</td></tr><tr><td>🟣 <b>hyper</b>:check:initial</td><td align="right">0.3441s</td><td align="right">0.3443s</td><td align="right"> 0.05%</td></tr><tr><td>🟣 <b>regex</b>:check:initial</td><td align="right">1.2919s</td><td align="right">1.2877s</td><td align="right"> -0.33%</td></tr><tr><td>🟣 <b>syn</b>:check:initial</td><td align="right">2.0749s</td><td align="right">2.0721s</td><td align="right"> -0.14%</td></tr><tr><td>🟣 <b>syntex_syntax</b>:check:initial</td><td align="right">7.9266s</td><td align="right">7.9206s</td><td align="right"> -0.07%</td></tr><tr><td>Total</td><td align="right">13.8585s</td><td align="right">13.8474s</td><td align="right"> -0.08%</td></tr><tr><td>Summary</td><td align="right">1.0000s</td><td align="right">0.9992s</td><td align="right"> -0.08%</td></tr></table>
r? `@cjgillot`
2023-05-16 16:02:53 +00:00
John Kåre Alsaker
fff20a703d
Move expansion of query macros in rustc_middle to rustc_middle::query
2023-05-15 08:49:13 +02:00
John Kåre Alsaker
882a9684f9
Specialize query execution for incremental and non-incremental
2023-05-14 21:53:05 +02:00
John Kåre Alsaker
2fe28ae0a4
Use dynamic dispatch for queries
2023-04-30 09:48:47 +02:00
John Kåre Alsaker
66d85438ca
Remove QueryEngine trait
2023-04-26 07:46:13 +02:00
bors
3462f79e94
Auto merge of #108118 - oli-obk:lazy_typeck, r=cjgillot
...
Run various queries from other queries instead of explicitly in phases
These are just legacy leftovers from when rustc didn't have a query system. While there are more cleanups of this sort that can be done here, I want to land them in smaller steps.
This phased order of query invocations was already a lie, as any query that looks at types (e.g. the wf checks run before) can invoke e.g. const eval which invokes borrowck, which invokes typeck, ...
2023-04-23 13:34:31 +00:00
Oli Scherer
334423263a
Run check_match
and check_liveness
when MIR is built instead of having an explicit phase for them
2023-04-21 22:32:38 +00:00
Oli Scherer
5bb58a68de
Make check_match
and check_liveness
take a LocalDefId
2023-04-21 22:27:20 +00:00
Camille GILLOT
ed7e50e08b
Ensure mir_drops_elaborated_and_const_checked when requiring codegen.
2023-04-21 16:14:43 +00:00
Camille GILLOT
b275d2c30b
Remove WithOptconstParam.
2023-04-20 17:48:32 +00:00
blyxyas
2c976765b8
Migrate sess.opts.tests
uses to sess.is_test_crate()
2023-04-09 21:37:31 +02:00
Camille GILLOT
fea7b59d12
Make check_match take a LocalDefId.
2023-04-03 15:59:21 +00:00
Matthias Krüger
2a39cf560f
Rollup merge of #109231 - Zoxc:fs-non-canon, r=eholk
...
Add `try_canonicalize` to `rustc_fs_util` and use it over `fs::canonicalize`
This adds `try_canonicalize` which tries to call `fs::canonicalize`, but falls back to `std::path::absolute` if it fails. Existing `canonicalize` calls are replaced with it. `fs::canonicalize` is not guaranteed to work on Windows.
2023-03-23 19:55:45 +01:00
Vadim Petrochenkov
aca1b1e0b3
rustc_interface: Add a new query pre_configure
...
It partially expands crate attributes before the main expansion pass (without modifying the crate), and the produced preliminary crate attribute list is used for querying a few attributes that are required very early.
Crate-level cfg attributes are then expanded normally during the main expansion pass, like attributes on any other nodes.
2023-03-23 14:22:48 +04:00
Vadim Petrochenkov
6cc33b7691
expand: Pass ast::Crate
by reference to AST transforming passes
...
Also some more attributes are passed by reference.
2023-03-23 14:20:55 +04:00
John Kåre Alsaker
4f7cd3d459
Add try_canonicalize
to rustc_fs_util
and use it over fs::canonicalize
2023-03-16 21:50:23 +01:00
Vadim Petrochenkov
98cce81917
metadata: Remove some more untracked CStore
methods
2023-03-13 17:31:55 +04:00
Camille GILLOT
c90fc105cb
Querify early_lint_checks.
2023-03-06 11:26:29 +00:00
Camille GILLOT
b7e2b049f3
Querify registered_tools.
2023-03-06 10:56:23 +00:00
Oli Scherer
5965948ba1
Remove a back compat warning
2023-02-22 19:39:03 +00:00
Oli Scherer
1ab14ea7c2
Remove some unnecessary tcx-passing
2023-02-20 15:28:59 +00:00
Oli Scherer
acbcfaaf7b
Stop passing in values that one can also get from the tcx lazily
2023-02-20 15:28:59 +00:00
Oli Scherer
c3522d0637
Move the resolver into a query
2023-02-20 15:28:59 +00:00
Oli Scherer
37e2f4f487
Make configure_and_expand
"infalllible" by just aborting the compilation if it fails instead of bubbling out an error
2023-02-20 15:28:59 +00:00
Oli Scherer
63c8d00090
Use tcx queries instead of passing the values to configure_and_expand
.
2023-02-20 15:28:59 +00:00
Oli Scherer
ade3dceb38
Make untracked.cstore lockable so that resolution can still write to it when using TyCtxt
2023-02-20 15:28:58 +00:00
Oli Scherer
21f4c0723e
Remove BoxedResolver
2023-02-14 10:01:30 +00:00
Oli Scherer
43a5cc383d
Separate the lifetime of the session and the arena in the resolver
2023-02-14 10:01:25 +00:00
Vadim Petrochenkov
fd73d01c98
rustc_resolve: Remove Resolver::clone_output
...
And remove `Clone` impls and `Lrc`s that are no longer necessary
2023-02-13 00:10:15 +04:00
Nicholas Nethercote
243944c653
Remove QueryContext
.
...
There is a type `QueryCtxt`, which impls the trait `QueryContext`.
Confusingly, there is another type `QueryContext`. The latter is (like
`TyCtxt`) just a pointer to a `GlobalContext`. It's not used much, e.g.
its `impl` block has a single method.
This commit removes `QueryContext`, replacing its use with direct
`GlobalCtxt` use.
2023-02-09 16:14:51 +11:00
Nicholas Nethercote
f7b3e39502
Simplify tls::enter_context
.
2023-02-09 15:25:45 +11:00
est31
b4a20abc48
rustc_interface: remove huge error imports
2023-02-05 03:48:08 +01:00
Camille GILLOT
60e04d1e8c
Compute generator saved locals on MIR.
2023-01-27 20:10:06 +00:00
Oli Scherer
bcc8b05d5c
Make output_filenames
a real query
2023-01-23 10:35:21 +00:00
Oli Scherer
abee6137f7
Remove another unneeded use of the resolver
2023-01-23 10:18:45 +00:00
bors
56ee85274e
Auto merge of #106090 - WaffleLapkin:dereffffffffff, r=Nilstrieb
...
Remove some `ref` patterns from the compiler
Previous PR: https://github.com/rust-lang/rust/pull/105368
r? `@Nilstrieb`
2023-01-20 04:52:28 +00:00
Maybe Waffle
360e978437
Don't call closures immediately, use try{}
blocks
2023-01-17 07:48:19 +00:00
Oli Scherer
9f5cd03153
Move compiler input and ouput paths into session
2023-01-16 14:46:44 +00:00
Oli Scherer
42f75f1e46
Group some commonly passed together values into a struct
2023-01-16 14:46:40 +00:00
Oli Scherer
f5c601492e
Remove redundant input_path
field from Config
2023-01-16 08:03:06 +00:00
Oli Scherer
6b1a789fb6
remove some arguments that can also be fed at the caller side
2023-01-16 08:03:06 +00:00
Matthias Krüger
e4d0104754
Rollup merge of #106678 - Veykril:proc-macro-panic-abort, r=eholk
...
Warn when using panic-strategy abort for proc-macro crates
See https://github.com/rust-lang/rust/issues/82320 , this simply warns for now as that seems like the best step that can be immediately taken (opposed to straight up rejecting or ignoring)
2023-01-13 19:16:43 +01:00
Lukas Wirth
549ece7033
Warn when using panic-strategy abort for proc-macro crates
2023-01-13 10:13:49 +01:00
Oli Scherer
d36db0d2a0
Feed the features_query
instead of grabbing it from the session lazily
2023-01-12 17:14:17 +00:00
Oli Scherer
fbe2d5aad2
Remove output_filenames
field from TyCtxt and feed the query instead
2023-01-12 17:14:17 +00:00
Oli Scherer
33b6a7790e
Remove untracked_crate
field and instead pass it along with the resolver.
2023-01-12 17:14:17 +00:00
Oli Scherer
194b4a2adb
Feed crate_name
query
2023-01-12 17:14:17 +00:00
Oli Scherer
408ae0fcb9
Feed resolutions
query instead of it being a thin wrapper around an untracked field
2023-01-12 17:14:17 +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