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

[mir-opt] Implement pass to remove branches on uninhabited variants #65694

Merged
merged 1 commit into from
Nov 10, 2019

Conversation

wesleywiser
Copy link
Member

Based on discussion here, this is a pass to eliminate dead code that is caused by branching on an enum with uninhabited variants.

r? @oli-obk

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 22, 2019
@wesleywiser
Copy link
Member Author

@bors try
@rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Oct 22, 2019

⌛ Trying commit 9b6965531f0fa200447fa8dcc9e66175c60773fa with merge 04311b4b9a6e180150b8c541c645e47af3f124a0...

@bors
Copy link
Contributor

bors commented Oct 22, 2019

☀️ Try build successful - checks-azure
Build commit: 04311b4b9a6e180150b8c541c645e47af3f124a0 (04311b4b9a6e180150b8c541c645e47af3f124a0)

@rust-timer
Copy link
Collaborator

Queued 04311b4b9a6e180150b8c541c645e47af3f124a0 with parent 50ffa79, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit 04311b4b9a6e180150b8c541c645e47af3f124a0, comparison URL.

@wesleywiser
Copy link
Member Author

I think this is about what I was expecting to see. I doubt the benchmarked crates use many enums with uninhabited variants so there isn't much potential for speedup. However, we do see that the pass isn't expensive to run even when it doesn't apply.

I will apply @Centril's review feedback and force push.

@wesleywiser
Copy link
Member Author

Fixed & pushed changes

@bors
Copy link
Contributor

bors commented Oct 25, 2019

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

@wesleywiser wesleywiser force-pushed the uninhabited_enum_variants_pass branch 2 times, most recently from 61ed957 to 2c1c8a4 Compare October 30, 2019 00:36
@wesleywiser
Copy link
Member Author

@bors try @rust-timer queue

@rust-timer
Copy link
Collaborator

Awaiting bors try build completion

@bors
Copy link
Contributor

bors commented Oct 30, 2019

⌛ Trying commit 2c1c8a4 with merge f9d5de7...

bors added a commit that referenced this pull request Oct 30, 2019
…<try>

[mir-opt] Implement pass to remove branches on uninhabited variants

Based on discussion [here](#64890 (comment)), this is a pass to eliminate dead code that is caused by branching on an enum with uninhabited variants.

r? @oli-obk
@bors
Copy link
Contributor

bors commented Oct 30, 2019

☀️ Try build successful - checks-azure
Build commit: f9d5de7 (f9d5de79a3218d1730118818c5fae635dcf8e3a7)

@rust-timer
Copy link
Collaborator

Queued f9d5de7 with parent aa69777, future comparison URL.

@rust-timer
Copy link
Collaborator

Finished benchmarking try commit f9d5de7, comparison URL.

@joelpalmer
Copy link

Ping from Triage: any updates @wesleywiser @oli-obk?

@wesleywiser
Copy link
Member Author

@joelpalmer @oli-obk is on vacation this week so it will probably be next week before they can give a final review.

@oli-obk
Copy link
Contributor

oli-obk commented Nov 9, 2019

@bors r+

@bors
Copy link
Contributor

bors commented Nov 9, 2019

📌 Commit cbe2f60 has been approved by oli-obk

@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 Nov 9, 2019
@bors
Copy link
Contributor

bors commented Nov 9, 2019

⌛ Testing commit cbe2f60 with merge c296b2d...

bors added a commit that referenced this pull request Nov 9, 2019
…oli-obk

[mir-opt] Implement pass to remove branches on uninhabited variants

Based on discussion [here](#64890 (comment)), this is a pass to eliminate dead code that is caused by branching on an enum with uninhabited variants.

r? @oli-obk
@bors
Copy link
Contributor

bors commented Nov 10, 2019

☀️ Test successful - checks-azure
Approved by: oli-obk
Pushing c296b2d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Nov 10, 2019
@bors bors merged commit cbe2f60 into rust-lang:master Nov 10, 2019
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