[mlir] relax transform dialect multi-handle restriction
authorAlex Zinenko <zinenko@google.com>
Fri, 30 Sep 2022 14:11:34 +0000 (14:11 +0000)
committerAlex Zinenko <zinenko@google.com>
Tue, 4 Oct 2022 11:57:49 +0000 (11:57 +0000)
commit3dfea727a4bb50bbc9fc1b5534bb067e34ee1fea
tree8c6283e71b12f9fa2813210b0f6e7f5da6e57fdf
parent89bb0cae46f85bdfb04075b24f75064864708e78
[mlir] relax transform dialect multi-handle restriction

Relax the restriction in the transform dialect interpreter utilities
that expected a payload IR op to be assocaited with at most one
transform IR handle value. This was useful during the initial
bootstrapping to avoid use-after-free error equivalents when a payload
IR op could be erased through one of the handles associated with it and
then accessed through another. It was, however, possible to erase an
ancestor of the payload IR operation in question. The expensive-checks
mode of interpretation is able to detect both cases and has proven
sufficiently robust in debugging use-after-free errors.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D134964
mlir/include/mlir/Dialect/Transform/IR/TransformDialect.td
mlir/include/mlir/Dialect/Transform/IR/TransformInterfaces.h
mlir/lib/Dialect/Transform/IR/TransformInterfaces.cpp
mlir/lib/Dialect/Transform/IR/TransformOps.cpp
mlir/test/Dialect/Transform/expensive-checks.mlir
mlir/test/Dialect/Transform/test-interpreter.mlir
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.cpp
mlir/test/lib/Dialect/Transform/TestTransformDialectExtension.td