diff --git a/mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml b/mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml --- a/mlir/test/mlir-linalg-ods-gen/test-linalg-ods-yaml-gen.yaml +++ b/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 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 attrs) 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 --- 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 @@ -565,7 +565,7 @@ std::pair getDpsInitsPositionRange() {{ int64_t getNumOperands = this->getNumOperands(); - return {{getNumOperands - 1, getNumOperands}; + return {{getNumOperands - getOutputs().size(), getNumOperands}; } // Generic methods.