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

Christian Ulmann llvmlistbot at llvm.org
Wed May 8 04:08:25 PDT 2024


Dinistro wrote:

> A rewriter is essentially a builder with extra API. So I am surprised that switching from RewriterBase to OpBuilder made any difference.

The problem is purely related to adding block arguments. `RewriterBase` forces us to create a new block and then inline the old block into this one. The `DominanceInfo` internally stores block pointers, which are turned into dangling pointers by such a change.

> What kind of functionality/API is missing?

A way of adding block arguments to an existing block without needing a workaround involving block creation and block inlining.

> How does this relate to dominance information? Either you modify the IR in such a way that dominance info is invalidated or not; whether you use a rewriter or a builder should not matter.

The rewriter's lack of a "block argument adding" API leads to the usage of APIs that modify the IR in a way that it destroys dominance information.

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


More information about the Mlir-commits mailing list