diff options
author | Matthias Springer <me@m-sp.org> | 2024-04-02 10:53:57 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-02 10:53:57 +0900 |
commit | 38113a083283d2f30a677befaa5fb86dce731c8b (patch) | |
tree | ac8d5821e9110632d36b0195e7a5898078e8d0a3 /clang/lib/ExtractAPI/Serialization | |
parent | d7a43a00fe80007de5d7614576b180d3d21d541b (diff) | |
download | llvm-38113a083283d2f30a677befaa5fb86dce731c8b.zip llvm-38113a083283d2f30a677befaa5fb86dce731c8b.tar.gz llvm-38113a083283d2f30a677befaa5fb86dce731c8b.tar.bz2 |
[mlir][IR] Trigger `notifyOperationReplaced` on `replaceAllOpUsesWith` (#84721)
Before this change: `notifyOperationReplaced` was triggered when calling
`RewriteBase::replaceOp`.
After this change: `notifyOperationReplaced` is triggered when
`RewriterBase::replaceAllOpUsesWith` or `RewriterBase::replaceOp` is
called.
Until now, every `notifyOperationReplaced` was always sent together with
a `notifyOperationErased`, which made that `notifyOperationErased`
callback irrelevant. More importantly, when a user called
`RewriterBase::replaceAllOpUsesWith`+`RewriterBase::eraseOp` instead of
`RewriterBase::replaceOp`, no `notifyOperationReplaced` callback was
sent, even though the two notations are semantically equivalent. As an
example, this can be a problem when applying patterns with the transform
dialect because the `TrackingListener` will only see the
`notifyOperationErased` callback and the payload op is dropped from the
mappings.
Note: It is still possible to write semantically equivalent code that
does not trigger a `notifyOperationReplaced` (e.g., when op results are
replaced one-by-one), but this commit already improves the situation a
lot.
Diffstat (limited to 'clang/lib/ExtractAPI/Serialization')
0 files changed, 0 insertions, 0 deletions