Conversation
|
Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred to the CTFE machinery Some changes occurred to constck cc @fee1-dead |
|
|
edf3729 to
bde722a
Compare
|
@bors try @rust-timer queue |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
| if try_get_cached(tcx, &query.cache, &key).is_none() { | ||
| (query.execute_query_fn)(tcx, DUMMY_SP, key, QueryMode::Ensure { ensure_mode }); | ||
| match try_get_cached(tcx, &query.cache, &key) { | ||
| Some(_value) => {} |
There was a problem hiding this comment.
I suspect this is going to be reverted next time anyone runs clippy on the compiler.
There was a problem hiding this comment.
I tried clippy on a test program with the same structure and it didn't complain.
|
Finished benchmarking commit (61d1293): comparison URL. Overall result: ✅ improvements - no action neededBenchmarking this pull request means it may be perf-sensitive – we'll automatically label it not fit for rolling up. You can override this, but we strongly advise not to, due to possible changes in compiler perf. @bors rollup=never Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)This benchmark run did not return any relevant results for this metric. CyclesResults (secondary -1.9%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeResults (primary 0.1%, secondary 0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Bootstrap: 481.183s -> 478.51s (-0.56%) |
| let _: R = tcx.ensure_result().check_type_wf(()); | ||
|
|
||
| for &trait_def_id in tcx.all_local_trait_impls(()).keys() { | ||
| let _: R = tcx.ensure_ok().coherent_trait(trait_def_id); | ||
| let _: R = tcx.ensure_result().coherent_trait(trait_def_id); | ||
| } | ||
| // these queries are executed for side-effects (error reporting): | ||
| let _: R = tcx.ensure_ok().crate_inherent_impls_validity_check(()); | ||
| let _: R = tcx.ensure_ok().crate_inherent_impls_overlap_check(()); | ||
| let _: R = tcx.ensure_result().crate_inherent_impls_validity_check(()); | ||
| let _: R = tcx.ensure_result().crate_inherent_impls_overlap_check(()); |
There was a problem hiding this comment.
Future work: If we're calling ensure_result() and then immediately discarding the result, then maybe we should just be calling the plain ensure_ok() instead. That wasn't possible before this PR, but it becomes possible now.
(But I'm fine with not worrying about that for this PR.)
|
I don't love the |
`query_get_at`, `query_ensure`, and `query_ensure_error_guarantee` are very similar functions, but they all use different control flow styles which obscures the similarities. This commit rewrites them to all use a `match`.
Two places where `ensure_ok` can be used but currently isn't. (These queries are marked with `return_result_from_ensure_ok`, which means that `ensure_ok` returns `Result<(), ErrorGuaranteed>`.) This is potentially a perf win, because `ensure_ok` query calls can be faster.
bde722a to
799ad7a
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
I addressed the nit about the comment. Should be good to go now. |
|
I think there’s some stale text in the final commit message; it mentions r=me after fixing that. |
`ensure_ok` provides a special, more efficient way of calling a query when its return value isn't needed. But there is a complication: if the query is marked with the `return_result_from_ensure_ok` modifier, then it will return `Result<(), ErrorGuaranteed`. This is clunky and feels tacked on. It's annoying to have to add a modifier to a query to declare information present in its return type, and it's confusing that queries called via `ensure_ok` have different return types depending on the modifier. This commit: - Eliminates the `return_result_from_ensure_ok` modifier. The proc macro now looks at the return type and detects if it matches `Result<_, ErrorGuarantee>`. If so, it adds the modifier `returns_error_guaranteed`. (Aside: We need better terminology to distinguish modifiers written by the user in a `query` declaration (e.g. `cycle_delayed_bug`) from modifiers added by the proc macro (e.g. `cycle_error_handling`.)) - Introduces `ensure_result`, which replaces the use of `ensure_ok` for queries that return `Result<_, ErrorGuarantee>`. As a result, `ensure_ok` can now only be used for the "ignore the return value" case.
799ad7a to
d4503b0
Compare
Good catch. That was the name I originally used. I changed it because it was so long that it was causing line breaks. I have updated. @bors r=Zalathar |
This comment has been minimized.
This comment has been minimized.
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing c3d0140 (parent) -> c7b206b (this PR) Test differencesShow 172 test diffs172 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard c7b206bba4434ed928e9615f31082a9ef3f67c27 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (c7b206b): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
Max RSS (memory usage)Results (primary -0.0%, secondary -0.3%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (primary 2.9%, secondary 2.4%)A less reliable metric. May be of interest, but not used to determine the overall result above.
Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 481.476s -> 488.157s (1.39%) |
The interaction of
ensure_okand thereturn_result_from_ensure_okquery modifier is weird and hacky. This PR cleans it up. Details in the individual commits.r? @Zalathar