Skip to content

EXPERIMENT [MIR-OPT] Add a pass that replicates simple branches into predecessors #111574

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 2 commits into from

Conversation

scottmcm
Copy link
Member

This means fewer blocks, so is hopefully a net win.

Draft until #105808 can simplify the discriminant checks in here.

r? @ghost

@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 May 15, 2023
@rust-log-analyzer

This comment has been minimized.

@scottmcm scottmcm force-pushed the replicate-branches branch from ff8d4db to 1fe3270 Compare May 15, 2023 00:55
@rust-log-analyzer

This comment has been minimized.

This means fewer blocks, so is hopefully a net win.
@scottmcm scottmcm force-pushed the replicate-branches branch from 1fe3270 to 9fea3d8 Compare May 15, 2023 01:44
@scottmcm
Copy link
Member Author

Perf queue is currently empty, so out of curiosity for whether this is horrible,
@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 May 15, 2023
@bors
Copy link
Collaborator

bors commented May 15, 2023

⌛ Trying commit 9fea3d8 with merge 8f21ec12447a8995bb7bb565c500ee52c5f36110...

@bors
Copy link
Collaborator

bors commented May 15, 2023

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

@rust-timer

This comment has been minimized.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (8f21ec12447a8995bb7bb565c500ee52c5f36110): 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)
1.3% [0.8%, 1.9%] 4
Regressions ❌
(secondary)
2.3% [0.7%, 5.9%] 8
Improvements ✅
(primary)
-0.5% [-1.2%, -0.3%] 72
Improvements ✅
(secondary)
-0.5% [-1.1%, -0.2%] 44
All ❌✅ (primary) -0.4% [-1.2%, 1.9%] 76

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.1% [2.9%, 5.5%] 3
Regressions ❌
(secondary)
2.4% [2.4%, 2.4%] 1
Improvements ✅
(primary)
-2.5% [-2.5%, -2.5%] 1
Improvements ✅
(secondary)
-1.9% [-1.9%, -1.9%] 1
All ❌✅ (primary) 2.4% [-2.5%, 5.5%] 4

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.1% [1.0%, 1.2%] 3
Regressions ❌
(secondary)
1.8% [1.6%, 2.1%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.1% [1.0%, 1.2%] 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.9%] 76
Regressions ❌
(secondary)
0.5% [0.1%, 1.2%] 87
Improvements ✅
(primary)
-0.2% [-0.6%, -0.1%] 4
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 0.2% [-0.6%, 0.9%] 80

Bootstrap: 642.634s -> 641.068s (-0.24%)

@rustbot rustbot added perf-regression Performance regression. and removed S-waiting-on-perf Status: Waiting on a perf run to be completed. labels May 15, 2023
@cjgillot
Copy link
Contributor

What is the difference with the SeparateConstSwitch pass?

@scottmcm scottmcm closed this May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf-regression Performance regression. 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants