forked from OSchip/llvm-project
TypedTuple: Add support for tuples with type constraints on the elements.
-- PiperOrigin-RevId: 243685631
This commit is contained in:
parent
8bb8351710
commit
6288503975
|
@ -352,6 +352,24 @@ def F64Tensor : TypedTensor<F64>;
|
|||
// there is not only a single elemental type.
|
||||
def Tuple : Type<IsTupleTypePred, "tuple">;
|
||||
|
||||
|
||||
// A Tuple that only holds elements of a certain type. This cannot inherit from
|
||||
// ContainerType because tuples do not always have a single element type that
|
||||
// could be retrieved with elementTypeCall.
|
||||
class TypedTuple<Type t> :
|
||||
Type<AllOf<[
|
||||
Tuple.predicate,
|
||||
Concat<
|
||||
[{
|
||||
llvm::all_of(
|
||||
$_self.cast<TupleType>().getTypes(),
|
||||
[](Type t) {
|
||||
return
|
||||
}],
|
||||
SubstLeaves<"$_self", "t", t.predicate>,
|
||||
"; })">
|
||||
]>, "tuple">;
|
||||
|
||||
// Memref type.
|
||||
|
||||
// Memrefs are blocks of data with fixed type and rank.
|
||||
|
|
Loading…
Reference in New Issue