WIP: tablegen: add hasTypeInfo field to DialectType#41
Open
nhaehnle wants to merge 1 commit intoGPUOpen-Drivers:devfrom
Open
WIP: tablegen: add hasTypeInfo field to DialectType#41nhaehnle wants to merge 1 commit intoGPUOpen-Drivers:devfrom
nhaehnle wants to merge 1 commit intoGPUOpen-Drivers:devfrom
Conversation
jasilvanus
reviewed
Apr 6, 2023
| [](const ::llvm::TargetExtType *type) { | ||
| return ::llvm::cast<XdVectorType>(type)->getTypeInfo(); | ||
| }); | ||
| context.registerTargetExtTypeClass(&classXdVectorType); |
Contributor
There was a problem hiding this comment.
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.
Member
Author
There was a problem hiding this comment.
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.