[Mlir-commits] [mlir] [MLIR] Add single definition multiple regions for mem2reg (PR #89107)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Thu Apr 18 08:27:24 PDT 2024


fanfuqiang wrote:

> Thanks for your contribution. As you correctly observed, Mem2Reg does currently not support structured control flow, due to a lack of proper dominance analysis for CFGs with regions + interfaces to extend region holding operations with new values that need to flow into all successor regions. The latter would be required to promote values properly and let their results flow through registers (SSA values) instead of memory.
> 
> Unfortunately, this PR does only solve one specific special case, which is not something we strive for. If we want to support CFGs with regions, we need a principled approach that will require substantial extension to the existing algorithm.
> 
> May I ask what your use case for this specific special case is?

I am working on a project that transforms the C code into hybird MLIR dialects.
So i need promote the allocations to block argument as well as ssa construction.
But I am not sure if my scene is very unusual or not, so only add a simple case to support this construction.


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


More information about the Mlir-commits mailing list