[PATCH] D152388: [mlir] Fix mlir-linalg-ods-yaml-gen

Andrey Turetskiy via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 30 21:09:20 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGfe8e7e30f9a4: [mlir-linalg-ods-yaml-gen] Fix a bug in getDpsInitsPositionRange (authored by aturetsk).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D152388/new/

https://reviews.llvm.org/D152388

Files:
  mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
  mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp


Index: mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
===================================================================
--- mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
+++ mlir/tools/mlir-linalg-ods-gen/mlir-linalg-ods-yaml-gen.cpp
@@ -565,7 +565,7 @@
 
       std::pair<int64_t, int64_t> getDpsInitsPositionRange() {{
         int64_t getNumOperands = this->getNumOperands();
-        return {{getNumOperands - 1, getNumOperands};
+        return {{getNumOperands - getOutputs().size(), getNumOperands};
       }
 
       // Generic methods.
Index: mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
===================================================================
--- mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
+++ mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml
@@ -82,6 +82,10 @@
 #       ODS:    buildStructuredOp($_builder, $_state, resultTensorTypes,
 #  ODS-NEXT:      attributes, Test1Op::getRegionBuilder())
 
+#       ODS:    std::pair<int64_t, int64_t> getDpsInitsPositionRange() {
+#  ODS-NEXT:      int64_t getNumOperands = this->getNumOperands();
+#  ODS-NEXT:      return {getNumOperands - getOutputs().size(), getNumOperands};
+#  ODS-NEXT:    }
 
 # IMPL-LABEL:  void Test1Op::regionBuilder(ImplicitLocOpBuilder &b,
 #  IMPL-NEXT:    Block &block, ArrayRef<NamedAttribute> attrs)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152388.554898.patch
Type: text/x-patch
Size: 1370 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230831/08e86f8a/attachment.bin>


More information about the llvm-commits mailing list