Skip to content

Commit 2685c64

Browse files
Hardcode84frederik-h
authored andcommitted
[mlir] Change TypeOrValueSemanticsContainer base from TypeConstraint to Type (llvm#129433)
`Type` is derived from `TypeConstraint`. Using `Type` as base allows to use `SignlessIntegerLike` and friends in `Variadic<>`.
1 parent 6bf3a00 commit 2685c64

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

mlir/include/mlir/IR/CommonTypeConstraints.td

+1-1
Original file line numberDiff line numberDiff line change
@@ -883,7 +883,7 @@ class NestedTupleOf<list<Type> allowedTypes> :
883883
// Type constraint for types that are "like" some type or set of types T, that is
884884
// they're either a T or a mapable container of Ts.
885885
class TypeOrValueSemanticsContainer<Type allowedType, string name>
886-
: TypeConstraint<Or<[
886+
: Type<Or<[
887887
allowedType.predicate,
888888
ValueSemanticsContainerOf<[allowedType]>.predicate]>,
889889
name>;

mlir/test/lib/Dialect/Test/TestOps.td

+4
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,10 @@ def TEST_TestType : DialectType<Test_Dialect,
103103
CPred<"::llvm::isa<::test::TestType>($_self)">, "test">,
104104
BuildableType<"$_builder.getType<::test::TestType>()">;
105105

106+
def SignlessLikeVariadic : TEST_Op<"signless_like_variadic"> {
107+
let arguments = (ins Variadic<SignlessIntegerLike>:$x);
108+
}
109+
106110
//===----------------------------------------------------------------------===//
107111
// Test Symbols
108112
//===----------------------------------------------------------------------===//

0 commit comments

Comments
 (0)