[mlir] LLVM import: handle constant data and array/vector aggregates
Summary: Implement the handling of llvm::ConstantDataSequential and llvm::ConstantAggregate for (nested) array and vector types when imporitng LLVM IR to MLIR. In all cases, the result is a DenseElementsAttr that can be used in either a `llvm.mlir.global` or a `llvm.mlir.constant`. Nested aggregates are unpacked recursively until an element or a constant data is found. Nested arrays with innermost scalar type are represented as DenseElementsAttr of tensor type. Nested arrays with innermost vector type are represented as DenseElementsAttr with (multidimensional) vector type. Constant aggregates of struct type are not yet supported as the LLVM dialect does not have a well-defined way of modeling struct-type constants. Differential Revision: https://reviews.llvm.org/D72834
Loading
Please sign in to comment