Remove the IR modification callbacks from OperationFolder. Instead, an optional RewriterBase::Listener can be specified.
- processGeneratedConstants => notifyOperationCreated
- preReplaceAction => notifyOperationReplaced
This simplifies the GreedyPatternRewriterDriver because we no longer need special handling for IR modifications due to op folding.
A folded operation is now enqueued on the GreedyPatternRewriteDriver's worklist if it was modified in-place. (There may be new patterns that apply after folding.)
Also fixes a bug in TestOpInPlaceFold::fold. The folder could previously be applied over and over and did not return a "null" OpFoldResult if the IR was not modified. (This is similar to a pattern that returns success without modifying IR; it can trigger an infinite loop in the GreedyPatternRewriteDriver.)
Depends On: D143380