Making `RewriterBase::replaceOp` non-virtual

tldr: I’d like to make RewriterBase::replaceOp non-virtual. Please report back on this thread if you are overriding this function in your code base.

With the recent dialect conversion improvements, both RewriterBase::replaceAllUsesWith and RewriterBase::eraseOp are now virtual functionz. Since replaceOp is effectively a combination of those two, it does not have to be virtual anymore. I believe, the reason why it was made virtual in past was for dialect conversion purposes. I’d like to turn replaceOp into a non-virtual function to simplify the API surface. (The fewer virtual functions, the better.)

Pull Request: [mlir][IR] Make `RewriterBase::replaceOp` non-virtual by matthias-springer · Pull Request #160529 · llvm/llvm-project · GitHub

I’d like to ask folks to try this PR on their code base and report back on this thread in case this would cause problems. (The PR is dependent on this commit. Please make sure that it has been integrated already when testing the above PR.)

3 Likes