[Mlir-commits] [mlir] [mlir][Transforms] Add a utility method to move value definitions. (PR #130874)
Ian Wood
llvmlistbot at llvm.org
Tue Mar 11 20:27:11 PDT 2025
================
@@ -1115,3 +1115,72 @@ LogicalResult mlir::moveOperationDependencies(RewriterBase &rewriter,
DominanceInfo dominance(op);
return moveOperationDependencies(rewriter, op, insertionPoint, dominance);
}
+
+LogicalResult mlir::moveValueDefinitions(RewriterBase &rewriter,
+ ValueRange values,
+ Operation *insertionPoint,
+ DominanceInfo &dominance) {
+ // Remove the values that already dominate the insertion point.
+ SmallVector<Value> prunedValues;
+ for (auto value : values) {
----------------
IanWood1 wrote:
In my opinion, it would be more readable if this was split this into two for loops: a loop that filters `values` and one that checks for failure conditions
https://github.com/llvm/llvm-project/pull/130874
More information about the Mlir-commits
mailing list