[Mlir-commits] [mlir] [mlir] Fix liveness analysis (PR #88848)

Mehdi Amini llvmlistbot at llvm.org
Fri Apr 19 17:54:12 PDT 2024


================
@@ -67,11 +67,18 @@ struct BlockInfoBuilder {
     // Mark all nested operation results as defined, and nested operation
     // operands as used. All defined value will be removed from the used set
     // at the end.
-    block->walk([&](Operation *op) {
-      for (Value result : op->getResults())
-        defValues.insert(result);
-      for (Value operand : op->getOperands())
-        useValues.insert(operand);
+    block->walk([&](Block *nestedBlock) {
+      if (block != nestedBlock) {
+        for (BlockArgument arg : nestedBlock->getArguments()) {
+          defValues.insert(arg);
+        }
+      }
+      for (Operation &op : *nestedBlock) {
----------------
joker-eph wrote:

What about visiting the child blocks for each operation instead of the parent block?

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


More information about the Mlir-commits mailing list