[Mlir-commits] [mlir] [mlir][transform] Do not maintain mappings for dead handles (PR #73558)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Nov 27 11:57:52 PST 2023


================
@@ -994,13 +1033,18 @@ transform::TransformState::applyTransform(TransformOpInterface transform) {
 
   // Remove the mapping for the operand if it is consumed by the operation. This
   // allows us to catch use-after-free with assertions later on.
-  for (OpOperand *opOperand : consumedOperands) {
-    Value operand = opOperand->get();
+  for (OpOperand &opOperand : transform->getOpOperands()) {
+    Value operand = opOperand.get();
+    if (getAliveUse(operand, transform) != nullptr)
+      continue;
----------------
ftynse wrote:

This changes the behavior a bit. When a handle is consumed, but there is an (invalid) use of this handle later on, this will prevent the handle from being deleted. Before, it would be deleted, which would trigger an assertion on use, even without the expensive-checks tracking of handle consumption. Is this intentional?

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


More information about the Mlir-commits mailing list