Rejig rustc_with_all_queries!#153161
Conversation
|
|
|
@Zalathar: I find it hard to predict where our opinions will align on cleanups, but I figure I'll just keep throwing stuff against the wall to see what sticks. A couple of things I'm uncertain about this one:
I'm interested to hear what you think, thanks. |
|
At first this didn't jump out to me as a big improvement, but after pondering it some more I think it's probably a good direction. The part I really like is being able to get rid of Having to explicitly ignore I don't have great suggestions for what to call the non-query dep kinds. Some possibilities that come to mind are |
This comment has been minimized.
This comment has been minimized.
536063f to
a295046
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
a295046 to
92684c9
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. |
|
Comments addressed, should be ready for re-review. |
|
Thanks, r=me after resolving and/or rejecting each of the nits. |
`rustc_with_all_queries` currently provides information about all queries. Also, a caller can provide an ad hoc list of extra non-queries. This is used by `define_queries` for non-query dep kinds: `Null`, `Red`, etc. This is pretty hacky. This commit changes `rustc_with_all_queries` so that the non-queries information is available to all callers. (Some callers ignore the non-query information.) This is done by adding `non_query` entries to the primary list of queries in `rustc_queries!`.
Currently `define_dep_nodes` produces a macro `make_dep_kind_array` that encodes the names of non-queries followed by queries. This macro is used by `make_dep_kind_vtables` to make the full array of vtables, by referring to vtable constructor functions that are put into `mod _dep_kind_vtable_ctors`. Pretty weird! This commit takes advantage of the previous commit's changes to `rustc_with_all_queries`, which makes both query and non-query information available. A new call to `rustc_with_all_queries` is used to construct the vtable array. (This moves some dep_kind_vtable code from `plumbing.rs` to `dep_kind_vtables.rs`, which is good.) It's straightforward now with iterator chaining, and `mod _dep_kind_vtable_ctors` is no longer needed.
92684c9 to
40b2274
Compare
|
I addressed all the nits. Let's do a perf run to be safe. @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.
…try> Rejig `rustc_with_all_queries!`
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (dc13f8f): comparison URL. Overall result: no relevant changes - 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 countThis benchmark run did not return any relevant results for this metric. Max RSS (memory usage)Results (primary -0.1%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 480.149s -> 477.903s (-0.47%) |
|
No perf effects. @bors r=Zalathar rollup=maybe |
…ueries, r=Zalathar Rejig `rustc_with_all_queries!` There are three things relating to `rustc_with_all_queries!` that have been bugging me. - `rustc_with_all_queries!`'s ability to receive `extra_fake_queries` lines like `[] fn Null(()) -> (),` where the only real thing is the `Null`, and everything is just pretending to be a normal query, ugh. - `make_dep_kind_array!`: a macro produced by one macro (`define_dep_nodes!`) and used by another macro (`define_queries!`) in another crate, ugh. - The `_dep_kind_vtable_ctors` module, which is a special module with no actual code that serves just a way of collecting vtable constructors from two different places so they can be referred to by `make_dep_kind_array!`, ugh. By making some adjustments to how `rustc_with_all_queries!` works, all three of these things are eliminated. r? @Zalathar
…ueries, r=Zalathar Rejig `rustc_with_all_queries!` There are three things relating to `rustc_with_all_queries!` that have been bugging me. - `rustc_with_all_queries!`'s ability to receive `extra_fake_queries` lines like `[] fn Null(()) -> (),` where the only real thing is the `Null`, and everything is just pretending to be a normal query, ugh. - `make_dep_kind_array!`: a macro produced by one macro (`define_dep_nodes!`) and used by another macro (`define_queries!`) in another crate, ugh. - The `_dep_kind_vtable_ctors` module, which is a special module with no actual code that serves just a way of collecting vtable constructors from two different places so they can be referred to by `make_dep_kind_array!`, ugh. By making some adjustments to how `rustc_with_all_queries!` works, all three of these things are eliminated. r? @Zalathar
…uwer Rollup of 5 pull requests Successful merges: - #151962 (Fix next-solver ICE on PointeeSized goals) - #153161 (Rejig `rustc_with_all_queries!`) - #152164 (Lint unused features) - #153191 ( don't emit `unused_results` lint for tuples of "trivial" types ) - #153273 (vec/mod.rs: add missing period in "ie." in docs)
…uwer Rollup of 5 pull requests Successful merges: - #151962 (Fix next-solver ICE on PointeeSized goals) - #153161 (Rejig `rustc_with_all_queries!`) - #152164 (Lint unused features) - #153191 ( don't emit `unused_results` lint for tuples of "trivial" types ) - #153273 (vec/mod.rs: add missing period in "ie." in docs)
…uwer Rollup of 5 pull requests Successful merges: - #151962 (Fix next-solver ICE on PointeeSized goals) - #153161 (Rejig `rustc_with_all_queries!`) - #152164 (Lint unused features) - #153191 ( don't emit `unused_results` lint for tuples of "trivial" types ) - #153273 (vec/mod.rs: add missing period in "ie." in docs)
…ueries, r=Zalathar Rejig `rustc_with_all_queries!` There are three things relating to `rustc_with_all_queries!` that have been bugging me. - `rustc_with_all_queries!`'s ability to receive `extra_fake_queries` lines like `[] fn Null(()) -> (),` where the only real thing is the `Null`, and everything is just pretending to be a normal query, ugh. - `make_dep_kind_array!`: a macro produced by one macro (`define_dep_nodes!`) and used by another macro (`define_queries!`) in another crate, ugh. - The `_dep_kind_vtable_ctors` module, which is a special module with no actual code that serves just a way of collecting vtable constructors from two different places so they can be referred to by `make_dep_kind_array!`, ugh. By making some adjustments to how `rustc_with_all_queries!` works, all three of these things are eliminated. r? @Zalathar
…uwer Rollup of 9 pull requests Successful merges: - #153153 (add tests for thumb interworking) - #149328 (Add `String<A>` type with custom allocator parameter) - #151780 (Updated slice tests to pass for big endian hosts for `multiple-option-or-permutations.rs`) - #151962 (Fix next-solver ICE on PointeeSized goals) - #153015 (core: make atomic primitives type aliases of `Atomic<T>`) - #153161 (Rejig `rustc_with_all_queries!`) - #153191 ( don't emit `unused_results` lint for tuples of "trivial" types ) - #153273 (vec/mod.rs: add missing period in "ie." in docs) - #153292 (tests: codegen-llvm: vec-calloc: do not require the uwtable attribute)
…ueries, r=Zalathar Rejig `rustc_with_all_queries!` There are three things relating to `rustc_with_all_queries!` that have been bugging me. - `rustc_with_all_queries!`'s ability to receive `extra_fake_queries` lines like `[] fn Null(()) -> (),` where the only real thing is the `Null`, and everything is just pretending to be a normal query, ugh. - `make_dep_kind_array!`: a macro produced by one macro (`define_dep_nodes!`) and used by another macro (`define_queries!`) in another crate, ugh. - The `_dep_kind_vtable_ctors` module, which is a special module with no actual code that serves just a way of collecting vtable constructors from two different places so they can be referred to by `make_dep_kind_array!`, ugh. By making some adjustments to how `rustc_with_all_queries!` works, all three of these things are eliminated. r? @Zalathar
…uwer Rollup of 11 pull requests Successful merges: - #153153 (add tests for thumb interworking) - #149328 (Add `String<A>` type with custom allocator parameter) - #151780 (Updated slice tests to pass for big endian hosts for `multiple-option-or-permutations.rs`) - #151962 (Fix next-solver ICE on PointeeSized goals) - #153015 (core: make atomic primitives type aliases of `Atomic<T>`) - #153161 (Rejig `rustc_with_all_queries!`) - #153191 ( don't emit `unused_results` lint for tuples of "trivial" types ) - #153273 (vec/mod.rs: add missing period in "ie." in docs) - #153292 (tests: codegen-llvm: vec-calloc: do not require the uwtable attribute) - #153293 (library: std: process: skip tests on Hermit) - #153301 (Do not ping kobzol on rustc-dev-guide changes)
…uwer Rollup of 10 pull requests Successful merges: - #153153 (add tests for thumb interworking) - #151780 (Updated slice tests to pass for big endian hosts for `multiple-option-or-permutations.rs`) - #151962 (Fix next-solver ICE on PointeeSized goals) - #153015 (core: make atomic primitives type aliases of `Atomic<T>`) - #153161 (Rejig `rustc_with_all_queries!`) - #153191 ( don't emit `unused_results` lint for tuples of "trivial" types ) - #153273 (vec/mod.rs: add missing period in "ie." in docs) - #153292 (tests: codegen-llvm: vec-calloc: do not require the uwtable attribute) - #153293 (library: std: process: skip tests on Hermit) - #153301 (Do not ping kobzol on rustc-dev-guide changes)
Rollup merge of #153161 - nnethercote:rejig-rustc_with_all_queries, r=Zalathar Rejig `rustc_with_all_queries!` There are three things relating to `rustc_with_all_queries!` that have been bugging me. - `rustc_with_all_queries!`'s ability to receive `extra_fake_queries` lines like `[] fn Null(()) -> (),` where the only real thing is the `Null`, and everything is just pretending to be a normal query, ugh. - `make_dep_kind_array!`: a macro produced by one macro (`define_dep_nodes!`) and used by another macro (`define_queries!`) in another crate, ugh. - The `_dep_kind_vtable_ctors` module, which is a special module with no actual code that serves just a way of collecting vtable constructors from two different places so they can be referred to by `make_dep_kind_array!`, ugh. By making some adjustments to how `rustc_with_all_queries!` works, all three of these things are eliminated. r? @Zalathar
|
@rust-timer build 2168ca5 |
This comment has been minimized.
This comment has been minimized.
|
Finished benchmarking commit (2168ca5): comparison URL. Overall result: ❌✅ regressions and 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)Results (primary -1.0%, secondary -2.7%)A less reliable metric. May be of interest, but not used to determine the overall result above.
CyclesResults (secondary 5.6%)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: 480.113s -> 477.631s (-0.52%) |
| //----------------------------------------------------------------------------- | ||
|
|
||
| /// We use this for most things when incr. comp. is turned off. | ||
| non_query Null |
There was a problem hiding this comment.
non_query seems quite odd to me. I'd probably prefer just dep_kind.
View all comments
There are three things relating to
rustc_with_all_queries!that have been bugging me.rustc_with_all_queries!'s ability to receiveextra_fake_querieslines like[] fn Null(()) -> (),where the only real thing is theNull, and everything is just pretending to be a normal query, ugh.make_dep_kind_array!: a macro produced by one macro (define_dep_nodes!) and used by another macro (define_queries!) in another crate, ugh._dep_kind_vtable_ctorsmodule, which is a special module with no actual code that serves just a way of collecting vtable constructors from two different places so they can be referred to bymake_dep_kind_array!, ugh.By making some adjustments to how
rustc_with_all_queries!works, all three of these things are eliminated.r? @Zalathar