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: Fix bug in extractor when having nested variables #3850

Merged
merged 1 commit into from
Feb 6, 2025

Conversation

math-fehr
Copy link
Collaborator

When having an attribute constraint variable T and a variable U that could infer the
variable T (for instance U = Vector<T>), the constraint U would not realize that it can infer T.

@math-fehr math-fehr added bug Something isn't working core xDSL core (ir, textual format, ...) labels Feb 5, 2025
@math-fehr math-fehr self-assigned this Feb 5, 2025
Copy link
Collaborator

@alexarice alexarice left a comment

Choose a reason for hiding this comment

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

Seems fine but do you have a use case for this? I didn't include this as couldn't think of an operation that would actually need it.

Copy link

codecov bot commented Feb 5, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.27%. Comparing base (2b2f51e) to head (b8da9e1).
Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3850   +/-   ##
=======================================
  Coverage   91.27%   91.27%           
=======================================
  Files         461      461           
  Lines       57656    57678   +22     
  Branches     5571     5571           
=======================================
+ Hits        52623    52645   +22     
  Misses       3609     3609           
  Partials     1424     1424           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@math-fehr
Copy link
Collaborator Author

math-fehr commented Feb 6, 2025

Seems fine but do you have a use case for this? I didn't include this as couldn't think of an operation that would actually need it.

Yep, I got this in downstream code:

@irdl_op_definition
class StoreOp(IRDLOperation):
    name = "smt.array.store"

    _DOMAIN: ClassVar = VarConstraint("_DOMAIN", AnyAttr())
    _RANGE: ClassVar = VarConstraint("_RANGE", AnyAttr())
    _ARRAY: ClassVar = VarConstraint("_ARRAY", ArrayType.constr(_DOMAIN, _RANGE))

    array: Operand = operand_def(_ARRAY)
    index: Operand = operand_def(_DOMAIN)
    value: Operand = operand_def(_RANGE)

    res: OpResult = result_def(_ARRAY)

@math-fehr math-fehr merged commit f1e8d25 into main Feb 6, 2025
16 checks passed
@math-fehr math-fehr deleted the fehr/extractor-bug branch February 6, 2025 18:10
oluwatimilehin pushed a commit to oluwatimilehin/xdsl that referenced this pull request Feb 13, 2025
…3850)

When having an attribute constraint variable `T` and a variable `U` that
could infer the
variable `T` (for instance `U = Vector<T>`), the constraint `U` would
not realize that it can infer `T`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working core xDSL core (ir, textual format, ...)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants