diff --git a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td --- a/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td +++ b/mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td @@ -983,26 +983,6 @@ return detail::canOpOperandsBeDroppedImpl($_op, droppedOperands); }] >, - InterfaceMethod< - /*desc=*/[{ - Return the range of position in the result of the affine map - computed by getLoopsToShapesMap() which correspond to the - AffineExprs used to access the outputs of the operation. - }], - /*retTy=*/"std::pair", - /*methodName=*/"getResultsPositionInLoopsToShapeMap", - /*args=*/(ins), - /*methodBody=*/"", - /*defaultImplementation=*/[{ - int64_t inputRankSum = 0; - int64_t outputRankSum = 0; - for(OpOperand *input : getInputOperands()) - inputRankSum += getRank(input); - for(OpOperand *output : getOutputOperands()) - outputRankSum += getRank(output); - return {inputRankSum, inputRankSum + outputRankSum}; - }] - >, InterfaceMethod< /*desc=*/[{ Like `getShape`, but only returns statically-known information, without diff --git a/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp b/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp --- a/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp +++ b/mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp @@ -575,7 +575,13 @@ // Find the position in the above map that represents the shape of the // result:dim being inferred. - auto resultShapesSubMapPos = getResultsPositionInLoopsToShapeMap(); + int64_t inputRankSum = 0; + int64_t outputRankSum = 0; + for (OpOperand *input : getInputOperands()) inputRankSum += getRank(input); + for (OpOperand *output : getOutputOperands()) + outputRankSum += getRank(output); + std::pair resultShapesSubMapPos( + inputRankSum, inputRankSum + outputRankSum); /// From loopsToShapesMap extract the submap that represents the shape of the /// (resultIdx, dim) needed.