Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sprinkle some #[inline] in rustc_data_structures::tagged_ptr #110814

Merged
merged 1 commit into from
Apr 27, 2023

Conversation

WaffleLapkin
Copy link
Member

This is based on nm --demangle (rustc +a --print sysroot)/lib/librustc_driver-*.so | rg CopyTaggedPtr which shows many methods that should probably be inlined. May fix the regression in #110795.

r? @Nilstrieb

@rustbot rustbot added 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 Apr 25, 2023
@Noratrieb
Copy link
Member

did you do a local build with at least thin LTO to see whether they are left now?

@compiler-errors
Copy link
Member

if it fixes a perf regression we should probably perf test this lol

@bors try @rust-timer queue

@rust-timer

This comment has been minimized.

@rustbot rustbot added the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 25, 2023
@bors
Copy link
Contributor

bors commented Apr 25, 2023

⌛ Trying commit 021a12c with merge e1f03ce162d86cda98cd9608b46d1cd0ec69e83c...

@bors
Copy link
Contributor

bors commented Apr 25, 2023

☀️ Try build successful - checks-actions
Build commit: e1f03ce162d86cda98cd9608b46d1cd0ec69e83c (e1f03ce162d86cda98cd9608b46d1cd0ec69e83c)

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e1f03ce162d86cda98cd9608b46d1cd0ec69e83c): comparison URL.

Overall result: no relevant changes - no action needed

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. While you can manually mark this PR as fit for rollup, we strongly recommend not doing so since this PR may lead to changes in compiler perf.

@bors rollup=never
@rustbot label: -S-waiting-on-perf -perf-regression

Instruction count

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

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

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

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.3% [-2.3%, -2.3%] 1
Improvements ✅
(secondary)
-2.3% [-2.4%, -2.2%] 2
All ❌✅ (primary) -2.3% [-2.3%, -2.3%] 1

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Apr 26, 2023
@WaffleLapkin
Copy link
Member Author

@compiler-errors it doesn't fix an existing regression, but can (potentially) prevent it. I'm experimenting in #110795 with adding more uses of tagged pointers and that seems to regress perf, those #[inline]s might fix that. I choose a bit of a poor wording in the PR description.

@WaffleLapkin
Copy link
Member Author

@Nilstrieb just checked, with this included in the config.toml:

[rust]
thin-lto-import-instr-limit = 100
lto = "thin"

The command nm --demangle (rustc +a --print sysroot)/lib/librustc_driver-*.so | rg CopyTaggedPtr founds nothing (where as before this PR it found quite a few copies of CopyTaggedPtr's function).

@Noratrieb
Copy link
Member

Noratrieb commented Apr 26, 2023

well, I'm not sure whether this is worth it as you haven't benchmarked it with your other PR
on the other hand, this doesn't really hurt even if it turns out to be unnecessary
@bors r+ rollup

@bors
Copy link
Contributor

bors commented Apr 26, 2023

📌 Commit 021a12c has been approved by Nilstrieb

It is now in the queue for this repository.

@bors bors 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 Apr 26, 2023
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 26, 2023
…ilstrieb

Sprinkle some `#[inline]` in `rustc_data_structures::tagged_ptr`

This is based on `nm --demangle (rustc +a --print sysroot)/lib/librustc_driver-*.so | rg CopyTaggedPtr` which shows many methods that should probably be inlined. May fix the regression in rust-lang#110795.

r? `@Nilstrieb`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 27, 2023
…ilstrieb

Sprinkle some `#[inline]` in `rustc_data_structures::tagged_ptr`

This is based on `nm --demangle (rustc +a --print sysroot)/lib/librustc_driver-*.so | rg CopyTaggedPtr` which shows many methods that should probably be inlined. May fix the regression in rust-lang#110795.

r? ``@Nilstrieb``
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 27, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#110426 (docs(style): add more let-else examples)
 - rust-lang#110804 (Remove repeated definite articles)
 - rust-lang#110814 (Sprinkle some `#[inline]` in `rustc_data_structures::tagged_ptr`)
 - rust-lang#110816 (Migrate `rustc_passes` to translatable diagnostics)
 - rust-lang#110864 (`IntoFuture::into_future` is no longer unstable)
 - rust-lang#110866 (Make `method-not-found-generic-arg-elision.rs` error message not path dependent)
 - rust-lang#110872 (Nicer ICE for rust-lang#67981)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit b1ff6e3 into rust-lang:master Apr 27, 2023
@rustbot rustbot added this to the 1.71.0 milestone Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

6 participants