-
Notifications
You must be signed in to change notification settings - Fork 95
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
[CIR] Implement cir.int type and attribute #72
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this, good work Vinicius.
It would also probably be interesting if we add aliases as part of this, so we don't need to do all these changes again. I was thinking for instance !cir.int<s32>
could be just !s32
(or !si32
?), and so on a so forth.
I also believe we can make it more terse without losing meaning, like:
!cir.int<s, 32>
-> cir.int<s32>
!cir.int<u, 16>
-> cir.int<u16>
, ...
(For parsing that you could use llvm::StringSwitch
).
wdyt?
Regarding tests:
|
@bcardosolopes regarding this review ☝️ It would look good on the IR, but not so much on the code. Having a keyword switch for parsing arbitrary integer types seems a bit cumbersome and contradictory. Since the type aliases already fix the "looks" matter, I would rather leave this as-is so we get a bit of a cleaner code. Let me know what you think. |
15f3f04
to
b6f3be1
Compare
Good point, we don't need two "terse" representations!
Sounds good to leave as is and handle on the alias |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall looks great, pending the existence of one last mlir::IntegerAttr I've found. Two follow ups:
- Move this out from draft so I can approve.
- Mark conversations you've tackled as "resolved" (in general for other PRs too - since it removes some noise)
I already moved it out of Draft, but there are some remaining conflicts, feel free to rebase and merge when you fix them. |
Replaces the usage of the building integer types by a dialect-specific integer with arbitrary size and signedness. Since building integer attributes requires builtin integer types, a cir.int attribute was also created.
b6f3be1
to
74b23d2
Compare
Replaces the usage of the building integer types by a dialect-specific integer with arbitrary size and signedness. Since building integer attributes requires builtin integer types, a cir.int attribute was also created.