diff --git a/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td b/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td index bc11a02..9e3dffe 100644 --- a/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td +++ b/include/mlir-hlo/Dialect/mhlo/IR/lhlo_ops.td @@ -687,39 +687,35 @@ def FusionOp : LHLO_Op<"fusion", [SingleBlockImplicitTerminator<"TerminatorOp">] ]; let extraClassDeclaration = [{ - SmallVector getInputBuffers() { - SmallVector buffers; - this->region().walk([&](memref::TensorLoadOp load) { - if (load.memref().getParentRegion()->isProperAncestor(®ion())) - buffers.push_back(load.memref()); - }); + SmallVector getInputBuffers() { + SmallVector buffers; + for (auto load : region().front().getOps()) { + buffers.push_back(load.memref()); + } return buffers; } - SmallVector getOutputBuffers() { - SmallVector buffers; - this->region().walk([&](memref::TensorStoreOp store) { - if (store.memref().getParentRegion()->isProperAncestor(®ion())) - buffers.push_back(store.memref()); - }); + SmallVector getOutputBuffers() { + SmallVector buffers; + for (auto store : region().front().getOps()) { + buffers.push_back(store.memref()); + } return buffers; } - SmallVector getFusionParameters() { - SmallVector buffers; - this->region().walk([&](memref::TensorLoadOp load) { - if (load.memref().getParentRegion()->isProperAncestor(®ion())) - buffers.push_back(load); - }); + SmallVector getFusionParameters() { + SmallVector buffers; + for (auto load : region().front().getOps()) { + buffers.push_back(load); + } return buffers; } - SmallVector getFusionResults() { - SmallVector buffers; - this->region().walk([&](memref::TensorStoreOp store) { - if (store.memref().getParentRegion()->isProperAncestor(®ion())) - buffers.push_back(store.tensor()); - }); + SmallVector getFusionResults() { + SmallVector buffers; + for (auto store : region().front().getOps()) { + buffers.push_back(store.tensor()); + } return buffers; } }];