[Mlir-commits] [mlir] [MLIR][Interfaces] Change MemorySlotInterface to use OpBuilder (PR #91341)
Christian Ulmann
llvmlistbot at llvm.org
Wed May 8 05:16:02 PDT 2024
Dinistro 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.
That would be fantastic. We sadly did not have enough time to investigate into this, but I know that many parties would be happy about such an extension 😄
> 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.
I understand that this might be a bit odd, but I would assume that people who run a Mem2Reg function are aware that it will delete unnecessary allocas and rewire the IR accordingly.
https://github.com/llvm/llvm-project/pull/91341
More information about the Mlir-commits
mailing list