-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Open
Labels
enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featuremlir:irdl
Description
Once variadic constraints are part of the type system with #158077, we would like to be able to express variadic constraints that do not imply the same types for all the elements of the variadic. The challenge for this purpose is that IRDL constraint variables collapse into a single type: once they are collapsed, they must match the same type or attribute.
To resolve this, we could add a notion of scoped constraints. Constraints defined inside of the scope would be resolved again for each range element. For example:
%0 = irdl.any
%range = irdl.range_scoped {
%0 = irdl.any
%result = irdl.parametrized @hashmap<%0, %1>
irdl.yield %0
}
This constraint matches a range of n @hashmap<Kn, Vn>
where all Kn
are the same type and Vn
can be any type.
Contact points: @Moxinilian @math-fehr
Metadata
Metadata
Assignees
Labels
enhancementImproving things as opposed to bug fixing, e.g. new or missing featureImproving things as opposed to bug fixing, e.g. new or missing featuremlir:irdl