Skip to content

[CIR] Add back verification of LoopOpInterface #1641

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

fangyi-zhou
Copy link
Contributor

The verification used to require a runtime type query of ConditionOp which is not available outside the interface package; whereas the dialect package depends on the interface package, causing a circular dependency. This commit adds a singleton interface for ConditionOp to break off the circular dependency, and replaces the runtime type query using the newly added interface.

Tested locally with a build with shared library enabled and verified that the build succeeds.

The verification used to require a runtime type query of `ConditionOp`
which is not available outside the interface package; whereas the
dialect package depends on the interface package, causing a circular
dependency. This commit adds a singleton interface for `ConditionOp` to
break off the circular dependency, and replaces the runtime type query
using the newly added interface.

Tested locally with a build with shared library enabled and verified
that the build succeeds.
@@ -96,4 +96,11 @@ def LoopOpInterface : OpInterface<"LoopOpInterface", [
}];
}

def ConditionOpInterface : OpInterface<"ConditionOpInterface", []> {
Copy link
Member

@bcardosolopes bcardosolopes May 23, 2025

Choose a reason for hiding this comment

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

We should probably name this something more CIR specific: CIR_ConditionOpInterface? @xlauko any naming suggestions since you've been renaming a bunch?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes everything in tablegen needs to be prefixed with the CIR_ so it does not create name clashes for potential users or if core decides to add ConditionOpInterface. Unfortunately tablegen does not have namespace so this is the way.

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.

3 participants