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

dialects: (csl) handle negative-valued task ID representation #3558

Merged
merged 2 commits into from
Dec 4, 2024

Conversation

superlopuh
Copy link
Member

i6 and friends are signless, meaning that they are bitpatterns that don't have an inherent value. When printing CSL, we currently take the raw data of the IntegerAttr, but it seems like that's not valid for task identifiers, which are positive. This PR changes the printer to always print the unsigned version of the number, and adds a test case to the CSL filecheck.

@superlopuh superlopuh added bug Something isn't working dialects Changes on the dialects labels Dec 2, 2024
@superlopuh superlopuh self-assigned this Dec 2, 2024
Copy link

codecov bot commented Dec 2, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 90.40%. Comparing base (92101f8) to head (f96897a).
Report is 10 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3558    +/-   ##
========================================
  Coverage   90.39%   90.40%            
========================================
  Files         466      467     +1     
  Lines       58722    58843   +121     
  Branches     5593     5603    +10     
========================================
+ Hits        53083    53196   +113     
- Misses       4204     4205     +1     
- Partials     1435     1442     +7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dk949
Copy link
Collaborator

dk949 commented Dec 3, 2024

I think this makes sense, even if it is really odd to see a negative task ID in the IR.

As a sidenote, it would've probably been better to have made this an i16 and dealt with the range in the verify

@superlopuh
Copy link
Member Author

There are probably a few things to do, and making it an unsigned integer is also an option, especially if you'll not do any more arithmetic with it once you pin it down. If you'd like, I can do that in this PR instead?

@superlopuh
Copy link
Member Author

I decided to try it out, happy to revert to previous version if you'd like to keep the IDs signless.

Copy link
Collaborator

@n-io n-io left a comment

Choose a reason for hiding this comment

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

Looks good, @dk949 ?

Copy link
Collaborator

@dk949 dk949 left a comment

Choose a reason for hiding this comment

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

I like this, it exactly expresses the constraints on these values in the types.

@superlopuh superlopuh merged commit 1ddade3 into main Dec 4, 2024
15 checks passed
@superlopuh superlopuh deleted the sasha/csl/fix-signless-printer branch December 4, 2024 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dialects Changes on the dialects
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants