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

core: Meditate on the attribute names situation. #2719

Open
PapyChacal opened this issue Jun 13, 2024 · 1 comment
Open

core: Meditate on the attribute names situation. #2719

PapyChacal opened this issue Jun 13, 2024 · 1 comment
Assignees
Labels
core xDSL core (ir, textual format, ...)

Comments

@PapyChacal
Copy link
Collaborator

As brought up in:

  • core: Implement MemrefLayoutAttr base class and use in parser. #2718
    We currently annotate the base Attribute class with a name ClassVar. I.e., it is expected that any subclass defines a name - including further attribute base classes, used as interfaces for example.
    The only practical issue with this I've observed is in IRDL verifiers, that actually uses this transparently. Then, using such a base class errors if it has no name.
    More on the principles side of things, I feel they should all define a name if we so say in the base class indeed. So we could:
  • Not expect all of them to have a name anymore, but only at the irdl_attr_definition stage
  • Or just enforce indeed that they all have names.
@PapyChacal PapyChacal added the core xDSL core (ir, textual format, ...) label Jun 13, 2024
@PapyChacal PapyChacal self-assigned this Jun 13, 2024
@superlopuh
Copy link
Member

My take on this is that we don't want inheritance in IRDL, if we can avoid it, so the approach in #2718, with an override of a class variable, is not ideal. This is separate to our Python implementation, where inheritance seems like the most ergonomic approach. What I'm trying to say is that it would be great to use this task to track a discussion of how to define abstract attributes and use them in constraints, and also how to map these to PyRDL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core xDSL core (ir, textual format, ...)
Projects
None yet
Development

No branches or pull requests

2 participants