Update lhlo to use the new structured op interface.

Replace deprecated methods in lhlo_fuse_linalg.cc. The new structured op interface has been introduced in https://reviews.llvm.org/D103394.

PiperOrigin-RevId: 377875452
This commit is contained in:
Tobias Gysi 2021-06-07 03:10:05 -07:00 committed by TensorFlow MLIR Team
parent ade873a5e0
commit fc723380e6
1 changed files with 4 additions and 4 deletions

View File

@ -156,8 +156,8 @@ class LhloFuseLinalgPass
tile_sizes = SmallVector<int64_t, 2>(generic_op.getNumLoops(), 1);
}
auto op = cast<LinalgOp>(generic_op.getOperation());
for (const Value result : op.getOutputBuffers()) {
if (!result_buffers.count(result)) continue;
for (OpOperand* op_operand : op.getOutputBufferOperands()) {
if (!result_buffers.count(op_operand->get())) continue;
if (tileGenericOp(op, tile_sizes, &b)) {
generic_op.erase();
return;
@ -172,10 +172,10 @@ class LhloFuseLinalgPass
SmallVector<LinalgOp, 8> linalg_ops;
func.walk([&](LinalgOp op) { linalg_ops.push_back(op); });
for (LinalgOp op : llvm::reverse(linalg_ops)) {
for (OpOperand& inputOperand : op.getInputOpOperands()) {
for (OpOperand* inputOperand : op.getInputOperands()) {
linalg::Aliases aliases;
linalg::LinalgDependenceGraph graph(aliases, linalg_ops);
if (auto info = fuseProducerOfBuffer(b, inputOperand, graph)) {
if (auto info = fuseProducerOfBuffer(b, *inputOperand, graph)) {
auto originalOp = info->originalProducer.getOperation();
erase_set.insert(originalOp);
auto originalOpInLinalgOpsVector = std::find_if(