-
Notifications
You must be signed in to change notification settings - Fork 347
[OM] Add a string type #5277
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
[OM] Add a string type #5277
Conversation
def OMStringAttr : AttrDef<OMDialect, "OMString", [TypedAttrInterface]> { | ||
let summary = "An attribute that wraps a StringAttr with !om.string type"; |
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.
A tricky issue to wrap StringAttr
with OMStringAttr
is it makes hard to use common var_to_attribute/attribute_to_var
python utility as we have to convert python str
into OMStringAttr
.
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.
Hmm this is annoying. I think we can probably add support for the OM dialect attributes to those helpers.
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.
This looks good to me, thanks!
def OMStringAttr : AttrDef<OMDialect, "OMString", [TypedAttrInterface]> { | ||
let summary = "An attribute that wraps a StringAttr with !om.string type"; |
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.
Hmm this is annoying. I think we can probably add support for the OM dialect attributes to those helpers.
What do we need the new OMStringAttr for? Can we just use StringAttr? |
b5a388b
to
dd307a2
Compare
Yeah, good point. I didn't know that StringAttr could have a type. I changed to use TypedStrAttr, thanks! |
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.
Oh wow, I didn't realize there was a typed StringAttr now. How does the round trip test work? Does it parse a string attribute as a typed string attribute in this context?
Regardless, if all we need is the string type, that sounds good to me.
Yes, I think so. This is a dump in generic format.
|
This PR adds a string type to OM dialect.