[Mlir-commits] [mlir] [mlir][bufferization]-Replace only one use in TensorEmptyElimination (PR #118958)

Matthias Springer llvmlistbot at llvm.org
Tue Dec 17 11:53:19 PST 2024


================
@@ -48,27 +48,20 @@ neededValuesDominateInsertionPoint(const DominanceInfo &domInfo,
   return true;
 }
 
-/// Return true if the given `insertionPoint` dominates all uses of
-/// `emptyTensorOp`.
-static bool insertionPointDominatesUses(const DominanceInfo &domInfo,
-                                        Operation *insertionPoint,
-                                        Operation *emptyTensorOp) {
-  return llvm::all_of(emptyTensorOp->getUsers(), [&](Operation *user) {
-    return domInfo.dominates(insertionPoint, user);
-  });
-}
-
-/// Find a valid insertion point for a replacement of `emptyTensorOp`, assuming
-/// that the replacement may use any value from `neededValues`.
+/// Find a valid insertion point for a replacement of `useToBeEliminated`,
+/// assuming that the replacement may use any value from `neededValues`.
 static Operation *
-findValidInsertionPoint(Operation *emptyTensorOp,
+findValidInsertionPoint(OpOperand *useToBeEliminated,
----------------
matthias-springer wrote:

>From a functional perspective, this is correct, but I think this would be easier to understand if you replace `OpOperand*` with `Operation *emptyTensorOp, Operation *user`.

https://github.com/llvm/llvm-project/pull/118958


More information about the Mlir-commits mailing list