diff --git a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp --- a/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp +++ b/mlir/lib/Dialect/Linalg/Transforms/ComprehensiveBufferize.cpp @@ -124,7 +124,7 @@ opOperand.getOperandNumber() - linalgOp.getNumInputs(); int64_t numOutputBuffers = 0; for (unsigned idx = 0; idx < outputOperandIndex; ++idx) - if (!linalgOp.getOutputShapedType(idx).isa()) + if (!linalgOp.getOutputOperand(idx)->get().getType().isa()) ++numOutputBuffers; return linalgOp->getResult(outputOperandIndex - numOutputBuffers); } @@ -414,9 +414,9 @@ SmallVector loopRanges; // Linalg invariant: output tensors and result match 1-1. - assert(op.getNumOutputTensors() == op->getNumResults()); - for (auto &opOperand : op.getOutputOpOperands()) { - Value output = opOperand.get(); + assert(op.getOutputTensorOperands().size() == op->getNumResults()); + for (OpOperand *opOperand : op.getOutputOperands()) { + Value output = opOperand->get(); if (output.getType().isa()) { resultBuffers.push_back(output); continue; @@ -425,7 +425,7 @@ // If output tensor is marked inPlace, just use the buffer. // The following uses internal knowledge of the position of tied operand / // results. - OpResult tiedResult = getMatchingOpResult(op, opOperand); + OpResult tiedResult = getMatchingOpResult(op, *opOperand); if (getInPlace(tiedResult) == InPlaceSpec::True) { Value v = lookup(bvm, output); if (!v) @@ -440,7 +440,7 @@ resultBuffers.push_back(alloc); // Additionally, if the output buffer is used, clone its value for now. - if (op.payloadUsesValueFromOpOperand(&opOperand)) { + if (op.payloadUsesValueFromOperand(opOperand)) { Value v = lookup(bvm, output); if (!v) return failure(); @@ -486,8 +486,8 @@ Location loc = op.getLoc(); SmallVector newInputBuffers; newInputBuffers.reserve(op.getNumInputs()); - for (Value in : op.getInputs()) { - Value v = lookup(bvm, in); + for (OpOperand *opOperand : op.getInputOperands()) { + Value v = lookup(bvm, opOperand->get()); if (!v) return failure(); newInputBuffers.push_back(v);