Allow setting attributes in build method generated by YAML-gen.
authorMaheshRavishankar <ravishankarm@google.com>
Tue, 17 Aug 2021 15:59:13 +0000 (08:59 -0700)
committerMaheshRavishankar <ravishankarm@google.com>
Tue, 17 Aug 2021 16:09:52 +0000 (09:09 -0700)
Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D108182

mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp

index 83447f4..b956030 100644 (file)
@@ -474,11 +474,13 @@ def {0} : LinalgStructuredBase_Op<"{1}", !listconcat([
       }]>,
       OpBuilder<
       (ins "TypeRange":$resultTensorTypes, "ValueRange":$inputs,
-            "ValueRange":$outputs),
+            "ValueRange":$outputs,
+            CArg<"ArrayRef<NamedAttribute>", "{{}">:$attributes),
       [{{
         $_state.addOperands(inputs);
         $_state.addOperands(outputs);
         $_state.addTypes(resultTensorTypes);
+        $_state.addAttributes(attributes);
         $_state.addAttribute(
           "operand_segment_sizes",
           $_builder.getI32VectorAttr({{