-
Notifications
You must be signed in to change notification settings - Fork 79
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: (constraints) add IntAttrConstraint #3797
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3797 +/- ##
==========================================
+ Coverage 91.23% 91.25% +0.01%
==========================================
Files 461 461
Lines 57480 57557 +77
Branches 5547 5549 +2
==========================================
+ Hits 52443 52523 +80
+ Misses 3615 3609 -6
- Partials 1422 1425 +3 ☔ View full report in Codecov by Sentry. |
) | ||
def test_int_attr_extraction(program: str): | ||
@irdl_op_definition | ||
class IntAttrExtractOp(IRDLOperation): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mind pulling this and one below out and use a single definition? Fewer lines of code to eyeball over.
class IntAttrExtractOp(IRDLOperation): | ||
name = "test.int_attr_verify" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here, plus a name for the class and its name that match (here one uses 'extract' and the other uses 'verify'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very cool
Adds a constraint that applies an integer constraint to the value of an integer attribute.
See: https://github.com/xdslproject/inconspiquous/blob/70f923cfe577b7eb48ece03d6f9a597c296cb698/inconspiquous/dialects/gate.py#L237
and https://github.com/xdslproject/inconspiquous/blob/70f923cfe577b7eb48ece03d6f9a597c296cb698/inconspiquous/dialects/qssa.py#L78
for an example of using this.
I'm unsure if this is the best place for this to live, or if it should be upstreamed at all.