[Mlir-commits] [mlir] 98eedd4 - [mlir][vector] Add a name prefix to tablegen for IteratorType in Vector dialect.
Oleg Shyshkov
llvmlistbot at llvm.org
Sat Oct 15 00:03:47 PDT 2022
Author: Oleg Shyshkov
Date: 2022-10-15T07:02:52Z
New Revision: 98eedd406aa0a9360a8ef3b8bbe85d3d30367fdc
URL: https://github.com/llvm/llvm-project/commit/98eedd406aa0a9360a8ef3b8bbe85d3d30367fdc
DIFF: https://github.com/llvm/llvm-project/commit/98eedd406aa0a9360a8ef3b8bbe85d3d30367fdc.diff
LOG: [mlir][vector] Add a name prefix to tablegen for IteratorType in Vector dialect.
Otherwise there is a risk of a name collision with IteratorType attributes in other dialect.
Differential Revision: https://reviews.llvm.org/D135980
Added:
Modified:
mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
Removed:
################################################################################
diff --git a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
index c6a8f8243ade..71ded86f8624 100644
--- a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
+++ b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td
@@ -64,20 +64,22 @@ def Vector_CombiningKindAttr : EnumAttr<Vector_Dialect, CombiningKind, "kind"> {
let assemblyFormat = "`<` $value `>`";
}
-def IteratorType : I32EnumAttr<"IteratorType", "Iterator type", [
+def Vector_IteratorType : I32EnumAttr<"IteratorType", "Iterator type", [
I32EnumAttrCase<"parallel", 0>,
I32EnumAttrCase<"reduction", 1>
- ]> {
+]> {
let genSpecializedAttr = 0;
let cppNamespace = "::mlir::vector";
}
-def IteratorTypeEnum : EnumAttr<Vector_Dialect, IteratorType, "iterator_type"> {
- let assemblyFormat = "`<` $value `>`";
+def Vector_IteratorTypeEnum
+ : EnumAttr<Vector_Dialect, Vector_IteratorType, "iterator_type"> {
+ let assemblyFormat = "`<` $value `>`";
}
-def IteratorTypeArrayAttr : TypedArrayAttrBase<IteratorTypeEnum,
- "Iterator type should be an enum.">;
+def Vector_IteratorTypeArrayAttr
+ : TypedArrayAttrBase<Vector_IteratorTypeEnum,
+ "Iterator type should be an enum.">;
// TODO: Add an attribute to specify a
diff erent algebra with operators other
// than the current set: {*, +}.
@@ -92,7 +94,7 @@ def Vector_ContractionOp :
Arguments<(ins AnyVector:$lhs, AnyVector:$rhs, AnyType:$acc,
Variadic<VectorOf<[I1]>>:$masks,
ArrayAttr:$indexing_maps,
- IteratorTypeArrayAttr:$iterator_types,
+ Vector_IteratorTypeArrayAttr:$iterator_types,
DefaultValuedAttr<Vector_CombiningKindAttr,
"CombiningKind::ADD">:$kind)>,
Results<(outs AnyType)> {
More information about the Mlir-commits
mailing list