[Mlir-commits] [mlir] Extend `getBackwardSlice` to track values captured from above (PR #113478)

Mehdi Amini llvmlistbot at llvm.org
Tue Oct 29 05:46:26 PDT 2024


================
@@ -115,6 +116,19 @@ static void getBackwardSliceImpl(Operation *op,
     }
   }
 
+  // Visit values that are defined above.
+  if (!options.omitUsesFromAbove) {
+    visitUsedValuesDefinedAbove(op->getRegions(), [&](OpOperand *operand) {
+      if (Operation *definingOp = operand->get().getDefiningOp()) {
----------------
joker-eph wrote:

Should we check `backwardSlice->count(definingOp)` before calling `getBackwardSliceImpl()`?

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


More information about the Mlir-commits mailing list