| Age | Commit message (Collapse) | Author | Lines |
|
This was already only enabled in debug_assertions builds. Generally, it seems
like most use cases that would use this could also use the -Zself-profile flag
which also tracks cache hits (in all builds), and so the extra cfg's and such
are not really necessary.
This is largely just a small cleanup though, which primarily is intended to make
other changes easier by avoiding the need to deal with this field.
|
|
Keys can be reconstructed from fingerprints that are not DefPathHash, but then
we cannot extract a DefId from them.
|
|
|
|
Refactor query forcing
The control flow in those functions was very complex, with several layers of continuations.
I tried to simplify the implementation, while keeping essentially the same logic.
Now, all code paths go through `try_execute_query` for the actual query execution.
Communication with the `dep_graph` and the live caches are the only difference between query getting/ensuring/forcing.
|
|
Previously, `QueryJobInfo` was composed of two parts: a `QueryInfo` and
a `QueryJob`. However, both `QueryInfo` and `QueryJob` have a `span`
field, which seem to be the same. So, the `span` was recorded twice.
Now, `QueryJobInfo` is composed of a `QueryStackFrame` (the other field
of `QueryInfo`) and a `QueryJob`. So, now, the `span` is only recorded
once.
|
|
|
|
|
|
|
|
Remove with_eval_always_task.
|
|
|
|
|
|
|
|
|
|
|
|
try_execute_query is now able to centralize the path for query
get/ensure/force.
try_execute_query now takes the dep_node as a parameter, so it can
accommodate `force`. This dep_node is an Option to avoid computing it in
the `get` fast path.
try_execute_query now returns both the result and the dep_node_index to
allow the caller to handle the dep graph.
The caller is responsible for marking the dependency.
|
|
|
|
`with_taks_impl` is only called from `with_eval_always_task` and
`with_task` . The former is only used in query invocation, while the
latter is also used to start the `tcx` and to trigger codegen.
This move should not change significantly the number of calls to this
assertion.
|
|
|
|
|
|
|
|
|
|
When an incremental fingerprint mismatch occurs, we debug-print
our `DepNode` and query result. Unfortunately, the debug printing
process may cause us to run additional queries, which can result
in a re-entrant fingerprint mismatch error.
To avoid a double panic, this commit adds a thread-local variable
to detect re-entrant calls.
|
|
more clippy::complexity fixes
(also a couple of clippy::perf fixes)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Streamline try_start code
This shifts some branches around and avoids interleaving parallel and
non-parallel versions of the function too much.
|
|
This shifts some branches around and avoids interleaving parallel and
non-parallel versions of the function too much.
|
|
|
|
This means that we're no longer generating the iteration/locking code for each
invocation site of iter_results, rather just once per query.
This is a 15% win in instruction counts when compiling the rustc_query_impl crate.
|
|
|
|
|
|
|
|
|
|
Turn `-Z incremental-verify-ich` on by default
Issue #82920 showed that the kind of bugs caught by this flag have
soundness implications.
|
|
Issue #82920 showed that the kind of bugs caught by this flag have
soundness implications.
This causes performance regressions of up to 15.2% during incremental
compilation, but this is necessary to catch miscompilations caused by
bugs in query implementations.
|
|
Minor cleanup to reduce a small amount of complexity and code bloat.
Reduces the number of mono items in rustc_query_impl by 15%.
|
|
|
|
|
|
The call to `ty::print::with_forced_impl_filename_line`
is done when constructing the description,
at the construction of the QueryStackFrame.
|
|
Rename it to QueryStackFrame and document a bit.
|
|
|
|
|
|
|