-
Notifications
You must be signed in to change notification settings - Fork 80
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
core: Add support for nested inferrence in IRDL (#2005)
This PR allows us to infer the types of some operands and results from the types of other operands and results. It does so by adding three functions in `AttrConstraint`: * `get_resolved_variables`: This function returns the set of `ConstraintVar` that will be set during verification. * `can_infer`: Returns `True` if we can infer a unique attribute represented by the `AttrConstraint` from the assignment of `ConstraintVar`. * `infer`: Returns the only attribute that satisfy this constraint, given the constraint variables. We use these methods to get all `ConstraintVar` from the parsed operand/result types present in the syntax, then infer the constraints on the types that are not in the syntax. --------- Co-authored-by: Emilien Bauer <bauer.emilien@gmail.com> Co-authored-by: Sasha Lopoukhine <superlopuh@gmail.com>
- Loading branch information
1 parent
53ea859
commit efe08f9
Showing
4 changed files
with
343 additions
and
134 deletions.
There are no files selected for viewing
This file contains 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
Oops, something went wrong.