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

Do not emit alloca for ZST locals with multiple assignments #86166

Merged
merged 1 commit into from
Jun 21, 2021

Conversation

tmiasko
Copy link
Contributor

@tmiasko tmiasko commented Jun 9, 2021

This extends 35566bf to additionally stop emitting unnecessary allocas for zero sized locals that are assigned multiple times.

When rebuilding the standard library with -Zbuild-std this reduces the number of locals that require an allocation from 62315 to 61767.

@rust-highfive
Copy link
Collaborator

r? @petrochenkov

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 9, 2021
@tmiasko
Copy link
Contributor Author

tmiasko commented Jun 9, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

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

bors commented Jun 9, 2021

⌛ Trying commit e8b2d46ac74d3e072631d607a868935393b47e66 with merge 004afd4df22776fea09704d480c8e7b8b1c10a1e...

@bors
Copy link
Contributor

bors commented Jun 9, 2021

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

@rust-timer
Copy link
Collaborator

Queued 004afd4df22776fea09704d480c8e7b8b1c10a1e with parent c4b5406, future comparison URL.

@petrochenkov
Copy link
Contributor

r? @nagisa

@rust-highfive rust-highfive assigned nagisa and unassigned petrochenkov Jun 9, 2021
@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (004afd4df22776fea09704d480c8e7b8b1c10a1e): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 9, 2021
When rebuilding the standard library with `-Zbuild-std` this reduces the
number of locals that require an allocation from 62315 to 61767.
@tmiasko tmiasko force-pushed the no-alloca-for-zsts branch from e8b2d46 to 40c9aae Compare June 10, 2021 13:18
@tmiasko
Copy link
Contributor Author

tmiasko commented Jun 10, 2021

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion.

@rustbot label: +S-waiting-on-perf

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

bors commented Jun 10, 2021

⌛ Trying commit 40c9aae with merge 6f83711458d087a929d9bedb62c37342e448eb97...

@bors
Copy link
Contributor

bors commented Jun 10, 2021

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

@rust-timer
Copy link
Collaborator

Queued 6f83711458d087a929d9bedb62c37342e448eb97 with parent 0279cb1, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit (6f83711458d087a929d9bedb62c37342e448eb97): comparison url.

Benchmarking this pull request likely means that it is perf-sensitive, so we're automatically marking it as not fit for rolling up. Please note that if the perf results are neutral, you should likely undo the rollup=never given below by specifying rollup- to bors.

Importantly, though, if the results of this run are non-neutral do not roll this PR up -- it will mask other regressions or improvements in the roll up.

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

@rustbot rustbot removed the S-waiting-on-perf Status: Waiting on a perf run to be completed. label Jun 10, 2021
@nagisa
Copy link
Member

nagisa commented Jun 20, 2021

This seems pretty low value to me. We already don't emit any load/store operations on the ZST allocas (AFAIR), and so these allocas are trivially removable by LLVM. The perf data seems similarly mixed.

But I do find the new code nicer to read, so

@bors r+

@bors
Copy link
Contributor

bors commented Jun 20, 2021

📌 Commit 40c9aae has been approved by nagisa

@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 Jun 20, 2021
@bors
Copy link
Contributor

bors commented Jun 21, 2021

⌛ Testing commit 40c9aae with merge 3824017...

@bors
Copy link
Contributor

bors commented Jun 21, 2021

☀️ Test successful - checks-actions
Approved by: nagisa
Pushing 3824017 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jun 21, 2021
@bors bors merged commit 3824017 into rust-lang:master Jun 21, 2021
@rustbot rustbot added this to the 1.55.0 milestone Jun 21, 2021
@tmiasko tmiasko deleted the no-alloca-for-zsts branch June 22, 2021 17:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants