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

Always const-prop scalars and scalar pairs #113858

Merged
merged 5 commits into from
Jul 21, 2023

Conversation

cjgillot
Copy link
Contributor

@cjgillot cjgillot commented Jul 19, 2023

This removes some complexity from the pass.

The limitation to propagate ScalarPairs only for tuple comes from #67015, when ScalarPair constant were modeled using Rvalue::Aggregate. Nowadays, we use ConstValue::ByRef, which does not care about the underlying type.

The justification for not propagating in all cases was perf. This seems not to be a clear cut any more: #113858 (comment)

@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 Jul 19, 2023
@cjgillot
Copy link
Contributor Author

@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 Jul 19, 2023
@bors
Copy link
Contributor

bors commented Jul 19, 2023

⌛ Trying commit fd83c9db1654bafcf104714ac4e8adf37896f907 with merge f0d8ed27c11d0230590142e813909c7b9b3530ca...

@bors
Copy link
Contributor

bors commented Jul 19, 2023

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

1 similar comment
@bors
Copy link
Contributor

bors commented Jul 19, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (f0d8ed27c11d0230590142e813909c7b9b3530ca): comparison URL.

Overall result: ❌✅ regressions and improvements - 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.

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-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)
2.4% [1.1%, 3.6%] 2
Regressions ❌
(secondary)
0.6% [0.3%, 1.0%] 2
Improvements ✅
(primary)
-0.6% [-1.3%, -0.3%] 8
Improvements ✅
(secondary)
-0.6% [-0.9%, -0.3%] 5
All ❌✅ (primary) 0.0% [-1.3%, 3.6%] 10

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)
7.6% [7.6%, 7.6%] 1
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-5.0% [-12.3%, -2.0%] 4
Improvements ✅
(secondary)
-1.0% [-1.0%, -1.0%] 1
All ❌✅ (primary) -2.5% [-12.3%, 7.6%] 5

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)
1.8% [1.0%, 3.0%] 3
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.5% [-1.9%, -1.2%] 2
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) 0.5% [-1.9%, 3.0%] 5

Binary size

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.2% [0.0%, 0.6%] 18
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-2.7%, -0.0%] 59
Improvements ✅
(secondary)
-1.9% [-2.0%, -1.7%] 3
All ❌✅ (primary) -0.3% [-2.7%, 0.6%] 77

Bootstrap: 647.294s -> 648.53s (0.19%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels Jul 19, 2023
@cjgillot cjgillot marked this pull request as ready for review July 19, 2023 20:57
@rustbot
Copy link
Collaborator

rustbot commented Jul 19, 2023

Some changes occurred to MIR optimizations

cc @rust-lang/wg-mir-opt

@cjgillot
Copy link
Contributor Author

r? compiler

@oli-obk
Copy link
Contributor

oli-obk commented Jul 20, 2023

r? @oli-obk

@bors r+

@bors
Copy link
Contributor

bors commented Jul 20, 2023

📌 Commit fd83c9db1654bafcf104714ac4e8adf37896f907 has been approved by oli-obk

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 Jul 20, 2023
@bors
Copy link
Contributor

bors commented Jul 20, 2023

⌛ Testing commit fd83c9db1654bafcf104714ac4e8adf37896f907 with merge 412faf39e494910216abe24683848973b8f88593...

@bors
Copy link
Contributor

bors commented Jul 20, 2023

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 20, 2023
@rust-log-analyzer

This comment has been minimized.

@oli-obk
Copy link
Contributor

oli-obk commented Jul 20, 2023

@bors retry network

@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 Jul 20, 2023
@bors
Copy link
Contributor

bors commented Jul 20, 2023

☔ The latest upstream changes (presumably #113758) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors 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-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jul 20, 2023
@cjgillot
Copy link
Contributor Author

Rebased.
@bors r=oli-obk

@bors
Copy link
Contributor

bors commented Jul 20, 2023

📌 Commit 4a17740 has been approved by oli-obk

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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jul 20, 2023
@bors
Copy link
Contributor

bors commented Jul 20, 2023

⌛ Testing commit 4a17740 with merge e2a7ba2...

StorageLive(_3);
_3 = const 31_u32;
_4 = BitAnd(_2, move _3);
_3 = BitAnd(_2, const 31_u32);
Copy link
Member

Choose a reason for hiding this comment

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

Oh, thank you! I'd been confused why these kept sticking around.

(This'll help shrink slice::Iter::next, too, since today it still has _1 = 1; _3 = Offset(_2, _1); instead of Offset(_2, 1_usize).)

@bors
Copy link
Contributor

bors commented Jul 21, 2023

☀️ Test successful - checks-actions
Approved by: oli-obk
Pushing e2a7ba2 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 21, 2023
@bors bors merged commit e2a7ba2 into rust-lang:master Jul 21, 2023
@rustbot rustbot added this to the 1.73.0 milestone Jul 21, 2023
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (e2a7ba2): comparison URL.

Overall result: ❌✅ regressions and improvements - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

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.8% [0.3%, 3.3%] 42
Regressions ❌
(secondary)
0.7% [0.2%, 1.1%] 19
Improvements ✅
(primary)
-0.6% [-1.3%, -0.2%] 6
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.6% [-1.3%, 3.3%] 48

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)
4.0% [2.1%, 6.9%] 11
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-2.8% [-3.7%, -1.9%] 2
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 2.9% [-3.7%, 6.9%] 13

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)
1.9% [1.0%, 2.9%] 2
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-1.1% [-1.1%, -1.1%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.9% [-1.1%, 2.9%] 3

Binary size

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.2% [0.0%, 0.6%] 19
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
-0.4% [-2.3%, -0.0%] 54
Improvements ✅
(secondary)
-1.8% [-1.9%, -1.7%] 3
All ❌✅ (primary) -0.2% [-2.3%, 0.6%] 73

Bootstrap: 650.713s -> 651.863s (0.18%)

@cjgillot cjgillot deleted the const-prop-pairs branch July 21, 2023 07:39
@pnkfelix
Copy link
Member

Visiting for weekly perf triage.

  • we didn't anticipate such a high impact to the instruction-counts; the trial run said there were two primary regressions here, not 42.
    • exa-0.10.1 opt-full regressed by 3.34%
    • five various bitmaps-3.1.0 profiles/scenarios regressed by 1.01% to 1.21%
    • ripgrep-13.0.0 check-incr-unchanged regressed by 1.01%
    • bunch of others that regressed by a little less than 1%... seems not great.
  • not marking as triaged.

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. perf-regression Performance regression. 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.

9 participants