-
Notifications
You must be signed in to change notification settings - Fork 13.6k
[mlir] Change TypeOrValueSemanticsContainer
base from TypeConstraint
to Type
#129433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…nt` to `Type` `Type` is derived from `TypeConstraint`. Using `Type` as base allows to use `SignlessIntegerLike` and friends in `Variadic<>`.
@llvm/pr-subscribers-mlir-core Author: Ivan Butygin (Hardcode84) Changes
Full diff: https://github.com/llvm/llvm-project/pull/129433.diff 2 Files Affected:
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 cdc1237ec8c5a..cc33a7bf53980 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
//===----------------------------------------------------------------------===//
|
@llvm/pr-subscribers-mlir-ods Author: Ivan Butygin (Hardcode84) Changes
Full diff: https://github.com/llvm/llvm-project/pull/129433.diff 2 Files Affected:
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 cdc1237ec8c5a..cc33a7bf53980 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
//===----------------------------------------------------------------------===//
|
@llvm/pr-subscribers-mlir Author: Ivan Butygin (Hardcode84) Changes
Full diff: https://github.com/llvm/llvm-project/pull/129433.diff 2 Files Affected:
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 cdc1237ec8c5a..cc33a7bf53980 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
//===----------------------------------------------------------------------===//
|
ping |
…nt` to `Type` (llvm#129433) `Type` is derived from `TypeConstraint`. Using `Type` as base allows to use `SignlessIntegerLike` and friends in `Variadic<>`.
Type
is derived fromTypeConstraint
. UsingType
as base allows to useSignlessIntegerLike
and friends inVariadic<>
.