[Mlir-commits] [mlir] 786e70f - [mlir] Change `TypeOrValueSemanticsContainer` base from `TypeConstraint` to `Type` (#129433)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Mar 13 04:17:45 PDT 2025


Author: Ivan Butygin
Date: 2025-03-13T14:17:42+03:00
New Revision: 786e70ff104fdecaa246bbe98f7ff1e220455a58

URL: https://github.com/llvm/llvm-project/commit/786e70ff104fdecaa246bbe98f7ff1e220455a58
DIFF: https://github.com/llvm/llvm-project/commit/786e70ff104fdecaa246bbe98f7ff1e220455a58.diff

LOG: [mlir] Change `TypeOrValueSemanticsContainer` base from `TypeConstraint` to `Type` (#129433)

`Type` is derived from `TypeConstraint`. Using `Type` as base allows to
use `SignlessIntegerLike` and friends in `Variadic<>`.

Added: 
    

Modified: 
    mlir/include/mlir/IR/CommonTypeConstraints.td
    mlir/test/lib/Dialect/Test/TestOps.td

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/IR/CommonTypeConstraints.td b/mlir/include/mlir/IR/CommonTypeConstraints.td
index a18b32253d857..601517717978e 100644
--- a/mlir/include/mlir/IR/CommonTypeConstraints.td
+++ b/mlir/include/mlir/IR/CommonTypeConstraints.td
@@ -883,7 +883,7 @@ class NestedTupleOf<list<Type> allowedTypes> :
 // Type constraint for types that are "like" some type or set of types T, that is
 // they're either a T or a mapable container of Ts.
 class TypeOrValueSemanticsContainer<Type allowedType, string name>
-    : TypeConstraint<Or<[
+    : Type<Or<[
   allowedType.predicate,
   ValueSemanticsContainerOf<[allowedType]>.predicate]>,
   name>;

diff  --git a/mlir/test/lib/Dialect/Test/TestOps.td b/mlir/test/lib/Dialect/Test/TestOps.td
index cc0fe924acf75..b90afe61b8097 100644
--- a/mlir/test/lib/Dialect/Test/TestOps.td
+++ b/mlir/test/lib/Dialect/Test/TestOps.td
@@ -103,6 +103,10 @@ def TEST_TestType : DialectType<Test_Dialect,
     CPred<"::llvm::isa<::test::TestType>($_self)">, "test">,
     BuildableType<"$_builder.getType<::test::TestType>()">;
 
+def SignlessLikeVariadic : TEST_Op<"signless_like_variadic"> {
+  let arguments = (ins Variadic<SignlessIntegerLike>:$x);
+}
+
 //===----------------------------------------------------------------------===//
 // Test Symbols
 //===----------------------------------------------------------------------===//


        


More information about the Mlir-commits mailing list