diff --git a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/Transforms.cpp @@ -197,13 +197,11 @@ linalg::LinalgOp paddedOp = opToPad.clone(rewriter, loc, resultTensorTypes, newOperands); - // Recover the subtensor out of the new static results. This keeps the - // original linalg op around because it uses the dims of the original results. - // This later folds away. + // Recover the subtensor out of the new static results. SmallVector paddedSubviewResults; paddedSubviewResults.reserve(opToPad->getNumResults()); SetVector newUsersOfOpToPad; - for (auto it : llvm::zip(opToPad->getResults(), paddedOp->getResults())) { + for (auto it : llvm::zip(opToPad.getOutputs(), paddedOp->getResults())) { auto rank = std::get<0>(it).getType().cast().getRank(); SmallVector offsets(rank, rewriter.getIndexAttr(0)); auto sizes = llvm::to_vector<4>(llvm::map_range(