Skip to content

Cleanup the way we test niche values - #1544

Merged
danielsn merged 6 commits into
model-checking:mainfrom
danielsn:niche-cleanup
Aug 18, 2022
Merged

danielsn merged 6 commits into
model-checking:mainfrom
danielsn:niche-cleanup

Conversation

@danielsn

@danielsn danielsn commented Aug 18, 2022 •

Copy link
Copy Markdown
Contributor

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

@tedinski tedinski left a comment

Copy link
Copy Markdown
Contributor

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