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

[HW] Add InnerSymAttr python bindings #5711

Merged
merged 3 commits into from
Jul 28, 2023
Merged

Conversation

youngar
Copy link
Member

@youngar youngar commented Jul 28, 2023

These binding are very shallow and only support the use case of a single InnerSymProperties with a fieldID of 0. Current use cases only require this limited functionality, and in the future we will probably be changing the underlying attributes, so it doesn't make sense to expose it all now.

These binding are very shallow and only support the use case of a single
InnerSymProperties with a fieldID of 0.  Current use cases only require this
limited functionality, and in the future we will probably be changing the
underlying attributes, so it doens't make sense to expose it all now.
@youngar youngar added HW Involving the `hw` dialect Python Python bindings labels Jul 28, 2023
lib/CAPI/Dialect/HW.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

Looks like standard Python bindings to me. Too bad we have to write this out by hand.


MlirAttribute hwInnerSymAttrGetSymName(MlirAttribute innerSymAttr) {
return wrap(
(Attribute)unwrap(innerSymAttr).cast<InnerSymAttr>().getSymName());
Copy link
Contributor

Choose a reason for hiding this comment

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

Is the cast to (Attribute) necessary?

Copy link
Member Author

@youngar youngar Jul 28, 2023

Choose a reason for hiding this comment

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

Admittedly I just copied this code from elsewhere, but it appears that wrap(StringAttr) returns an MlirIdentifier instead of an MlirAttribute (and it fails to compile).

DEFINE_C_API_METHODS(MlirIdentifier, mlir::StringAttr)

@youngar youngar merged commit de50525 into llvm:main Jul 28, 2023
5 checks passed
@youngar youngar deleted the python-innersymattr branch July 28, 2023 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
HW Involving the `hw` dialect Python Python bindings
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants