From 98eedd406aa0a9360a8ef3b8bbe85d3d30367fdc Mon Sep 17 00:00:00 2001 From: Oleg Shyshkov Date: Sat, 15 Oct 2022 07:01:29 +0000 Subject: [PATCH] [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 --- mlir/include/mlir/Dialect/Vector/IR/VectorOps.td | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td b/mlir/include/mlir/Dialect/Vector/IR/VectorOps.td index c6a8f82..71ded86 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 { 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 { - let assemblyFormat = "`<` $value `>`"; +def Vector_IteratorTypeEnum + : EnumAttr { + let assemblyFormat = "`<` $value `>`"; } -def IteratorTypeArrayAttr : TypedArrayAttrBase; +def Vector_IteratorTypeArrayAttr + : TypedArrayAttrBase; // TODO: Add an attribute to specify a different algebra with operators other // than the current set: {*, +}. @@ -92,7 +94,7 @@ def Vector_ContractionOp : Arguments<(ins AnyVector:$lhs, AnyVector:$rhs, AnyType:$acc, Variadic>:$masks, ArrayAttr:$indexing_maps, - IteratorTypeArrayAttr:$iterator_types, + Vector_IteratorTypeArrayAttr:$iterator_types, DefaultValuedAttr:$kind)>, Results<(outs AnyType)> { -- 2.7.4