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

rustc_codegen_ssa: Fix for codegen_get_discr #104535

Merged
merged 1 commit into from
Dec 4, 2022

Conversation

mikebenfield
Copy link
Contributor

When doing the optimized implementation of getting the discriminant, the arithmetic needs to be done in the tag type so wrapping behavior works correctly.

Fixes #104519

@rustbot
Copy link
Collaborator

rustbot commented Nov 17, 2022

r? @lcnr

(rustbot has picked a reviewer for you, use r? to override)

@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 Nov 17, 2022
@mikebenfield
Copy link
Contributor Author

If desired I can provide a more thorough explanation of what the problem was, either here in a PR comment, in the commit message, or in code comments.

@lcnr
Copy link
Contributor

lcnr commented Nov 17, 2022

r? compiler

@rustbot rustbot assigned jackh726 and unassigned lcnr Nov 17, 2022
@pnkfelix
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Nov 17, 2022

📌 Commit 901f8d81b84bdf5dadd41896ed8f663ab17cc039 has been approved by pnkfelix

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Nov 17, 2022

🌲 The tree is currently closed for pull requests below priority 1. This pull request will be tested once the tree is reopened.

@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 17, 2022
@mikebenfield
Copy link
Contributor Author

Alright, obviously I needed to update the codegen test too.

Interestingly I think it's likely moving the arithmetic before the cast may result in better code, as maybe this LLVM issue won't matter.

@rust-log-analyzer

This comment has been minimized.

@mikebenfield
Copy link
Contributor Author

I don't understand this failure. The test passes on my system, and in the error message here the "possible intended match" appears to be identical to the text it's supposed to match.

@mikebenfield
Copy link
Contributor Author

I realized the difference in the test; apparently the call is not always a tail call.

@rust-log-analyzer

This comment has been minimized.

When doing the optimized implementation of getting the discriminant, the
arithmetic needs to be done in the tag type so wrapping behavior works
correctly.

Fixes rust-lang#104519
@djkoloski
Copy link
Contributor

Is this ready to merge?

@klensy
Copy link
Contributor

klensy commented Nov 22, 2022

There was pushes after r+, so need to reapprove this.

@djkoloski
Copy link
Contributor

Seems like the labels are incorrect then, since this has S-waiting-on-bors

@bjorn3 bjorn3 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 Nov 22, 2022
@mikebenfield
Copy link
Contributor Author

This should be ready, yes.

@jackh726
Copy link
Member

jackh726 commented Dec 1, 2022

@bors r=pnkfelix

@bors
Copy link
Contributor

bors commented Dec 1, 2022

📌 Commit 31c0645 has been approved by pnkfelix

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 Dec 1, 2022
@bors
Copy link
Contributor

bors commented Dec 4, 2022

⌛ Testing commit 31c0645 with merge 53e4b9d...

@bors
Copy link
Contributor

bors commented Dec 4, 2022

☀️ Test successful - checks-actions
Approved by: pnkfelix
Pushing 53e4b9d to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 4, 2022
@bors bors merged commit 53e4b9d into rust-lang:master Dec 4, 2022
@rustbot rustbot added this to the 1.67.0 milestone Dec 4, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (53e4b9d): comparison URL.

Overall result: ❌ regressions - no action needed

@rustbot label: -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)
- - 0
Regressions ❌
(secondary)
0.4% [0.3%, 0.5%] 7
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

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)
- - 0
Regressions ❌
(secondary)
2.2% [2.2%, 2.2%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-1.8% [-1.8%, -1.8%] 1
All ❌✅ (primary) - - 0

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)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.5% [-2.9%, -2.0%] 2
All ❌✅ (primary) - - 0

Aaron1011 pushed a commit to Aaron1011/rust that referenced this pull request Jan 6, 2023
rustc_codegen_ssa: Fix for codegen_get_discr

When doing the optimized implementation of getting the discriminant, the arithmetic needs to be done in the tag type so wrapping behavior works correctly.

Fixes rust-lang#104519
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.

Possible codegen regression when matching against nested enums