[Mlir-commits] [mlir] MLIR->LLVMIR: Support creating constant arrays (and structs) from arbitary ArrayAttr for constants (PR #94143)

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Mon Jun 3 00:47:17 PDT 2024


ftynse wrote:

I am not convinced we want to use unconstrained `ArrayAttr` for this. It's a misnomer for a tuple-of-attributes. It is (1) a wrong modeling for LLVM arrays, which are homogeneous unlike ArrayAttr that may contain different types, (2) expensive to manipulate because of indirection / immutability. We the desired outcome is supporting the creation of array-of-constants, we should focus specifically on that. This is likely better modeled as a custom attribute, a custom operation (we can construct constants from a region and specifically don't want to copy LLVM's partial replication of IR inside Constant*), or a combination of both.

This is likely something that could benefit from an [RFC](https://mlir.llvm.org/getting_started/DeveloperGuide/#guidelines-on-contributing-a-new-dialect-or-important-components).


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


More information about the Mlir-commits mailing list