[Mlir-commits] [mlir] [mlir] Fix liveness analysis (PR #88848)
Mehdi Amini
llvmlistbot at llvm.org
Thu Apr 18 15:58:44 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:
This makes it that we're traversing each block twice, seems unfortunate, any idea to do better?
https://github.com/llvm/llvm-project/pull/88848
More information about the Mlir-commits
mailing list