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

Optimize const_prop mir-opt by accessing local_decls through ecx #96281

Merged
merged 2 commits into from
Apr 24, 2022

Conversation

SparrowLii
Copy link
Member

From the FIXME in the impl of ConstPropagator. Accessing local_decls and scource_scopes from ecx can reduce clone calls and save compile time.
Besides, according to #96213 , the FIXME about writing layouts to ecx in advance can also be removed.

@rustbot rustbot added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Apr 21, 2022
@rust-highfive
Copy link
Collaborator

r? @jackh726

(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 Apr 21, 2022
@SparrowLii SparrowLii changed the title access local_decls through ecx Optimize const_prop mir-opt by accessing local_decls through ecx Apr 21, 2022
@wesleywiser
Copy link
Member

@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 Apr 21, 2022
@bors
Copy link
Contributor

bors commented Apr 21, 2022

⌛ Trying commit 3d256b3 with merge b5da99ba9e80e1c12cd59707d9f2f96e3458b514...

@bors
Copy link
Contributor

bors commented Apr 21, 2022

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

@rust-timer
Copy link
Collaborator

Queued b5da99ba9e80e1c12cd59707d9f2f96e3458b514 with parent 3d3dafb, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b5da99ba9e80e1c12cd59707d9f2f96e3458b514): comparison url.

Summary:

  • Primary benchmarks: 😿 relevant regression found
  • Secondary benchmarks: 🎉 relevant improvement found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 1 0 0 1 1
mean2 2.9% N/A N/A -0.2% 2.9%
max 2.9% N/A N/A -0.2% 2.9%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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.

Next Steps: If you can justify the regressions found in this try perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please fix the regressions and do another perf run. If the next run shows neutral or positive results, the label will be automatically removed.

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

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Apr 21, 2022
@SparrowLii
Copy link
Member Author

SparrowLii commented Apr 22, 2022

It seems that the call of the methods would be less efficient, so I used references to avoid it.
@wesleywiser Could you help with another perf test?

@jackh726
Copy link
Member

@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 Apr 22, 2022
@bors
Copy link
Contributor

bors commented Apr 22, 2022

⌛ Trying commit db23e77 with merge 0c2aa98a8ac3a9726039cc8b380470095e51e1de...

@bors
Copy link
Contributor

bors commented Apr 22, 2022

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

@rust-timer
Copy link
Collaborator

Queued 0c2aa98a8ac3a9726039cc8b380470095e51e1de with parent 41ef767, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0c2aa98a8ac3a9726039cc8b380470095e51e1de): comparison url.

Summary:

  • Primary benchmarks: 🎉 relevant improvement found
  • Secondary benchmarks: no relevant changes found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 1 0 1
mean2 N/A N/A -0.5% N/A -0.5%
max N/A N/A -0.5% N/A -0.5%

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

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-review -S-waiting-on-perf -perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

@rustbot rustbot removed S-waiting-on-perf Status: Waiting on a perf run to be completed. perf-regression Performance regression. labels Apr 22, 2022
Copy link
Member

@wesleywiser wesleywiser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@wesleywiser
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 23, 2022

📌 Commit db23e77 has been approved by wesleywiser

@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 23, 2022
@wesleywiser
Copy link
Member

r? @wesleywiser

@bors
Copy link
Contributor

bors commented Apr 24, 2022

⌛ Testing commit db23e77 with merge b21759f...

@bors
Copy link
Contributor

bors commented Apr 24, 2022

☀️ Test successful - checks-actions
Approved by: wesleywiser
Pushing b21759f to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 24, 2022
@bors bors merged commit b21759f into rust-lang:master Apr 24, 2022
@rustbot rustbot added this to the 1.62.0 milestone Apr 24, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (b21759f): comparison url.

Summary:

  • Primary benchmarks: no relevant changes found
  • Secondary benchmarks: 🎉 relevant improvements found
Regressions 😿
(primary)
Regressions 😿
(secondary)
Improvements 🎉
(primary)
Improvements 🎉
(secondary)
All 😿 🎉
(primary)
count1 0 0 0 3 0
mean2 N/A N/A N/A -0.2% N/A
max N/A N/A N/A -0.2% N/A

If you disagree with this performance assessment, please file an issue in rust-lang/rustc-perf.

@rustbot label: -perf-regression

Footnotes

  1. number of relevant changes

  2. the arithmetic mean of the percent change

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. 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.

7 participants