[Mlir-commits] [mlir] [MLIR][Interfaces] Change MemorySlotInterface to use OpBuilder (PR #91341)

Matthias Springer llvmlistbot at llvm.org
Wed May 8 05:06:04 PDT 2024


matthias-springer wrote:

I see. We are missing a `RewriterBase::addBlockArgument` function. And the general convention is "when we have a rewriter, all modifications must be done through the rewriter", so creating a new block was the only way to adhere to that convention. I can add `RewriterBase::addBlockArgument`, so that we have it in the future. 

There is one downside of switching everything to `OpBuilder`: if a function takes an `OpBuilder` (as opposed to a rewriter), it "looks" like the function merely adds new IR, but does not modify/erase existing IR. (But you are actually erasing ops.) I didn't look at the code in detail, maybe it is obvious from the documentation that IR may get modified/erased.


https://github.com/llvm/llvm-project/pull/91341


More information about the Mlir-commits mailing list