[Mlir-commits] [mlir] [MLIR][SCF] Add an API to fuse consumer to a producer within scf loop (PR #88712)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Apr 19 00:09:22 PDT 2024
================
@@ -1100,6 +1101,451 @@ mlir::scf::tileConsumerAndFuseProducersUsingSCF(
replacements};
}
+//===----------------------------------------------------------------------===//
+// tileAndFuseConsumerUsingSCF implementation.
+//===----------------------------------------------------------------------===//
+
+/// We traverse through the use-def chain of the tensor.insert_slice op through
+/// the containing scf.for to fetch the first untiled consumer. We also return
+/// the operand number of the consumer and the result number of the scf.for
+/// being consumed.
+static Operation *
+getUntiledConsumerFromSliceDestSCFFor(tensor::InsertSliceOp candidateSliceOp,
----------------
MaheshRavishankar wrote:
You can make this much simpler by returning the `OpOperand *` in the consumer you find.
`opOperand->getOperandNumber()` will give you the operand number in the consumer. `opOperand->getOwner()` gives the consumer. `cast<OpResult>(opOperand->get()).getResultNumber()` gets the result number.
https://github.com/llvm/llvm-project/pull/88712
More information about the Mlir-commits
mailing list