Skip to content

Prefer not to early return from derived visitables #124263

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

Closed
wants to merge 1 commit into from

Conversation

eggyal
Copy link
Contributor

@eggyal eggyal commented Apr 22, 2024

LLVM is not able to tail-call optimise the final early return, as there instructions that follow it. Making that call the returned expression resolves this. (As identified in #117896 (comment)).

r? wg-compiler-performance

LLVM is not able to tail-call optimise the final early return, as there
instructions that follow it.  Making that call the returned expression
resolves this.
@rustbot
Copy link
Collaborator

rustbot commented Apr 22, 2024

Failed to set assignee to tgnottingham: invalid assignee

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@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 22, 2024
@eggyal
Copy link
Contributor Author

eggyal commented Apr 22, 2024

Hm. Maybe it's not correct to seek review from the wg.

Not sure who to request instead. r? types

@rustbot rustbot added the T-types Relevant to the types team, which will review and decide on the PR/issue. label Apr 22, 2024
@lqd
Copy link
Member

lqd commented Apr 22, 2024

@bors try @rust-timer queue

@bors
Copy link
Collaborator

bors commented Apr 22, 2024

⌛ Trying commit 1fa6e5b with merge 4c24faf...

bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 22, 2024
Prefer not to early return from derived visitables

LLVM is not able to tail-call optimise the final early return, as there instructions that follow it.  Making that call the returned expression resolves this. (As identified in rust-lang#117896 (comment)).

r? wg-compiler-performance
@bors
Copy link
Collaborator

bors commented Apr 22, 2024

☀️ Try build successful - checks-actions
Build commit: 4c24faf (4c24faf0a8c709baf83bca3e381b6d1463695e03)

@lqd
Copy link
Member

lqd commented Apr 22, 2024

@rust-timer build 4c24faf

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4c24faf): comparison URL.

Overall result: ❌ regressions - 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 is a highly reliable metric that was used to determine the overall result at the top of this comment.

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

Max RSS (memory usage)

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

Cycles

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

Binary size

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

Bootstrap: 670.936s -> 671.766s (0.12%)
Artifact size: 315.45 MiB -> 315.40 MiB (-0.02%)

@lcnr
Copy link
Contributor

lcnr commented Apr 23, 2024

the perf results seem slightly negative. Do you still want to merge this?

@eggyal
Copy link
Contributor Author

eggyal commented Apr 23, 2024

Let me investigate - had seen quite different results locally, albeit there were other variables at play too. I'll try to isolate them and figure it out!

@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 23, 2024
@eggyal eggyal closed this Jul 11, 2024
@eggyal eggyal deleted the tco-derived-visits branch July 11, 2024 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-types Relevant to the types 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