This is an archive of the discontinued LLVM Phabricator instance.

[mlir][transform] TrackingListener: Support ops without results
Changes PlannedPublic

Authored by springerm on Jun 8 2023, 5:59 AM.



When a tracked op is replaced with another op, the internal transform dialect mapping state should be updated. Until now, this was not the case when an op with 0 results was replaced because there was no RewriterBase::Listener callback that provides the replacement op (only the replacement values).

This revision adds a new notifyOperationReplaced(Operation *op, Operation *replacement) notification to the listener infrastructure. The existing notifyOperationReplaced(Operation *, ValueRange) notification is not very useful when replacing an op with 0 results, because it provides no additional information over the notifyOperationRemoved notification (which is triggered afterwards). No changes for existing users ofthe listener API: the behavior of the existing notifyOperationReplaced does not change.

The new notification is utilized in the transform dialect to support payload op replacements of ops with 0 results.

Depends On: D152427

Diff Detail