Skip to content

Clean up some code related to QueryVTable::execute_query_fn#153120

Merged
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
Zalathar:execute
Feb 26, 2026
Merged

Clean up some code related to QueryVTable::execute_query_fn#153120
rust-bors[bot] merged 3 commits intorust-lang:mainfrom
Zalathar:execute

Conversation

@Zalathar
Copy link
Member

This PR is an assortment of small cleanups to code that interacts with execute_query_fn in the query vtable.

I also experimented with trying to replace the macro-generated __rust_end_short_backtrace functions with a single shared generic function, but I couldn't manage to avoid breaking short backtraces, so I left a note behind to document my attempt.

r? nnethercote (or compiler)

All three of these functions were previously taking `cache` and
`execute_query_fn` as separate arguments, but after some other recent
simplifications we can just pass `&'tcx QueryVTable<'tcx, C>` instead.

This makes it easier to see where `execute_query_fn` is actually called.
@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Feb 26, 2026
@nnethercote
Copy link
Contributor

Looks fine, one nit. r=me after considering/addressing that.

This function is tricky to document, and there's more that could be said here,
but I don't want to take up too much vertical space, or add too much risk of
details becoming inaccurate over time.
@nnethercote
Copy link
Contributor

@bors r+ rollup

@rust-bors
Copy link
Contributor

rust-bors bot commented Feb 26, 2026

📌 Commit fb42537 has been approved by nnethercote

It is now in the queue for this repository.

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 26, 2026
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Feb 26, 2026
Clean up some code related to `QueryVTable::execute_query_fn`

This PR is an assortment of small cleanups to code that interacts with `execute_query_fn` in the query vtable.

I also experimented with trying to replace the macro-generated `__rust_end_short_backtrace` functions with a single shared generic function, but I couldn't manage to avoid breaking short backtraces, so I left a note behind to document my attempt.

r? nnethercote (or compiler)
rust-bors bot pushed a commit that referenced this pull request Feb 26, 2026
…uwer

Rollup of 7 pull requests

Successful merges:

 - #153079 (Revert "Move aarch64-apple dist builder to dynamic llvm linking")
 - #152651 (Avoid duplicate `requirement` diag args in `RegionOriginNote`)
 - #152978 (Port `#[rustc_autodiff]` to the attribute parser infrastructure)
 - #153091 (Migration of `LintDiagnostic` - part 4)
 - #153112 (Query key cleanups)
 - #153118 (mailmap: add redddy)
 - #153120 (Clean up some code related to `QueryVTable::execute_query_fn`)
@rust-bors rust-bors bot merged commit 3eafea8 into rust-lang:main Feb 26, 2026
11 checks passed
rust-timer added a commit that referenced this pull request Feb 26, 2026
Rollup merge of #153120 - Zalathar:execute, r=nnethercote

Clean up some code related to `QueryVTable::execute_query_fn`

This PR is an assortment of small cleanups to code that interacts with `execute_query_fn` in the query vtable.

I also experimented with trying to replace the macro-generated `__rust_end_short_backtrace` functions with a single shared generic function, but I couldn't manage to avoid breaking short backtraces, so I left a note behind to document my attempt.

r? nnethercote (or compiler)
@rustbot rustbot added this to the 1.95.0 milestone Feb 26, 2026
@JonathanBrouwer
Copy link
Contributor

@rust-timer build 122a72d

@rust-timer

This comment has been minimized.

@Zalathar Zalathar deleted the execute branch February 26, 2026 22:56
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (122a72d): comparison URL.

Overall result: ✅ improvements - no action needed

Benchmarking 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
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
1.1% [1.1%, 1.1%] 1
Improvements ✅
(primary)
-0.2% [-0.4%, -0.1%] 15
Improvements ✅
(secondary)
-0.4% [-0.9%, -0.2%] 16
All ❌✅ (primary) -0.2% [-0.4%, -0.1%] 15

Max RSS (memory usage)

Results (primary -9.8%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-9.8% [-9.8%, -9.8%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -9.8% [-9.8%, -9.8%] 1

Cycles

Results (secondary 3.0%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 480.132s -> 480.506s (0.08%)
Artifact size: 395.80 MiB -> 395.78 MiB (-0.01%)

@Zalathar
Copy link
Member Author

I'm surprised to see this have any perf effect. Maybe we're just perturbing LLVM's inlining heuristics?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants