From 836649e04040251644cdd94d4eb033091e1dc220 Mon Sep 17 00:00:00 2001 From: MaheshRavishankar Date: Tue, 17 Aug 2021 08:59:13 -0700 Subject: [PATCH] Allow setting attributes in build method generated by YAML-gen. Reviewed By: gysit Differential Revision: https://reviews.llvm.org/D108182 --- mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp index 83447f4..b956030 100644 --- a/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp +++ b/mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp @@ -474,11 +474,13 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([ }]>, OpBuilder< (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs, - "ValueRange":$outputs), + "ValueRange":$outputs, + CArg<"ArrayRef", "{{}">:$attributes), [{{ $_state.addOperands(inputs); $_state.addOperands(outputs); $_state.addTypes(resultTensorTypes); + $_state.addAttributes(attributes); $_state.addAttribute( "operand_segment_sizes", $_builder.getI32VectorAttr({{ -- 2.7.4