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