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

[packing] Packing Attempt #2 #238

Merged
merged 46 commits into from
Apr 19, 2024
Merged

[packing] Packing Attempt #2 #238

merged 46 commits into from
Apr 19, 2024

Conversation

btwj
Copy link
Contributor

@btwj btwj commented Apr 18, 2024

Mostly the same as the old implementation, with:

  • No use of SsaBlockSplit for the case where a bool is viewed as an int. SsaBlockSplit breaks for constant conditions when used to rewrite SSA. I can't quite figure out how to modify SsaBlockSplit to handle the full generality of an arbitrary number of cases, so I just didn't use it in this case. All other instances of SsaBlockSplit are not constants, which is why this problem never arose. Regardless, we'll probably want a custom BoolViewI operator here.
  • I added an optimization to remove some classes of type subsumption. Basically, it looks if a scalar is only used to represent a certain type and is never packed. If it is, then it uses that type in the representation instead of weaking to a u32[B32] or u64[B64] etc.
  • Refactoring to package the solution up as a VariantSolution (which will have an associated score function to be implemented). For now, it still just outputs the first solution it finds.
  • Prettier printing of variant norms and unboxing with the -print-packing flag:
image

@btwj btwj marked this pull request as ready for review April 18, 2024 16:11
@btwj btwj changed the title [packing] [WIP] Packing Attempt #2 [packing] Packing Attempt #2 Apr 18, 2024
Copy link
Owner

@titzer titzer left a comment

Choose a reason for hiding this comment

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

LGTM

@titzer titzer merged commit 16bc397 into titzer:master Apr 19, 2024
7 checks passed
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.

None yet

2 participants