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

api: add printing and parsing of dynamic lists as in MLIR #2839

Merged
merged 2 commits into from
Jul 5, 2024

Conversation

superlopuh
Copy link
Member

This is used in a few places, notably in memref.subview custom syntax, which is the next PR

@superlopuh superlopuh added the API Related to changes regarding API of constructs label Jul 4, 2024
@superlopuh superlopuh self-assigned this Jul 4, 2024
Copy link

codecov bot commented Jul 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.87%. Comparing base (612c1b2) to head (8c15a86).
Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2839      +/-   ##
==========================================
+ Coverage   89.83%   89.87%   +0.04%     
==========================================
  Files         397      398       +1     
  Lines       49203    49590     +387     
  Branches     7551     7621      +70     
==========================================
+ Hits        44202    44570     +368     
- Misses       3807     3824      +17     
- Partials     1194     1196       +2     

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

@webmiche
Copy link
Collaborator

webmiche commented Jul 5, 2024

So, the weird thing about this is that MLIR is not fully consistent itself with how this works, AFAIK. In particular, the default "take the operand"-value is different among different dialects (GEP from the LLVM dialect uses INT_MIN, whereas memref uses -1 apparently).

Providing this functionality within the parser feels like we are preferring one version over the other. I guess, one could overwrite the DYNAMIC_INDEX variable, but that feels very forced. What do you think about adding this value as a keyword argument? The default can still be -1, I guess.

@superlopuh
Copy link
Member Author

That's exactly my plan, I'll add it as a parameter, and fix my implementation, turns out that memref actually uses -9223372036854775808, and I ported the wrong function.

@superlopuh
Copy link
Member Author

The PR on top of this one roundrips perfectly with MLIR, so I'm now pretty confident the helper functions have at least that functionality working.

@superlopuh superlopuh merged commit ea78c74 into main Jul 5, 2024
10 checks passed
@superlopuh superlopuh deleted the sasha/ir/dynamic-lists branch July 5, 2024 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Related to changes regarding API of constructs
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants