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

WIP: tablegen: add hasTypeInfo field to DialectType #41

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

nhaehnle
Copy link
Member

@nhaehnle nhaehnle commented Apr 6, 2023

TODO:

This allows users to hook into the (proposed) TargetExtTypeClass infrastructure to set the properties of dialect types.

Note: This is a single commit on top of #40, since I wanted to avoid the hassle of dealing with textual conflicts in the example and its tests.

[](const ::llvm::TargetExtType *type) {
return ::llvm::cast<XdVectorType>(type)->getTypeInfo();
});
context.registerTargetExtTypeClass(&classXdVectorType);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't we only register upon the first pass?

Currently we re-create a dialect every time a DialectContext is created for it (not sure whether that's necessary), so we'd register the same class multiple times.

Copy link
Member Author

Choose a reason for hiding this comment

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

The registration is per-LLVMContext, and we should really only be creating a DialectContext once per LLVMContext.

I suppose that this wasn't a strict rule previously, and now it becomes one, but I think it's a reasonable rule to have.

TODO:
- align with the required upstream changes

This allows users to hook into the (proposed) TargetExtTypeClass
infrastructure to set the properties of dialect types.

See: https://discourse.llvm.org/t/rfc-target-type-classes-for-extensibility-of-llvm-ir/69813
See: https://reviews.llvm.org/D147697
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants