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

Cleanup the way we test niche values #1544

Merged
merged 6 commits into from
Aug 18, 2022

Conversation

danielsn
Copy link
Contributor

@danielsn danielsn commented Aug 18, 2022

Description of changes:

The current code for testing niche values is complicated and hard to understand.
Rewrite it so it more closely follows the pattern in rustc.
This allows removal of the "Pointer" special case.
It also removes verbiage in the output goto that was making debugging more annoying.

Resolved issues:

Resolves #1540

Call-outs:

  • is_zero works on pointers. Remove the assert that prevented it from doing so.

Testing:

  • How is this change tested? Existing unit tests that cover niche optimization

  • Is this a refactor change? Kinda?

Checklist

  • Each commit message has a non-empty body, explaining why the change was made
  • Methods or procedures are documented
  • Regression or unit tests are included, or existing tests cover the modified code
  • My PR is restricted to a single feature or bugfix

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 and MIT licenses.

@danielsn danielsn requested a review from a team as a code owner August 18, 2022 14:46
Copy link
Contributor

@tedinski tedinski left a comment

Choose a reason for hiding this comment

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

lgtm, good links to ssa/cranelift!

@danielsn danielsn merged commit 8b1d18c into model-checking:main Aug 18, 2022
@danielsn danielsn deleted the niche-cleanup branch August 18, 2022 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup TagEncoding::Niche
3 participants