[mlir] support translation of multidimensional vectors to LLVM IR
authorAlex Zinenko <zinenko@google.com>
Thu, 16 Jan 2020 15:21:14 +0000 (16:21 +0100)
committerAlex Zinenko <zinenko@google.com>
Thu, 16 Jan 2020 23:05:37 +0000 (00:05 +0100)
commita4a42160c4463eac74c5d0cfa9a88c4971d8a23e
treeb353d081babc895ecc13f83f80e21dc07ba75832
parent73f371c31d2774b3e4d51e4e276737d54922aa18
[mlir] support translation of multidimensional vectors to LLVM IR

Summary:
MLIR unlike LLVM IR supports multidimensional vector types. Such types are
lowered to nested LLVM IR arrays wrapping an LLVM IR vector for the innermost
dimension of the MLIR vector. MLIR supports constants of such types using
ElementsAttr for values. Introduce support for converting ElementsAttr into
LLVM IR Constant Aggregates recursively. This enables translation of
multidimensional vector constants from MLIR to LLVM IR.

Differential Revision: https://reviews.llvm.org/D72846
mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
mlir/test/Target/llvmir-invalid.mlir
mlir/test/Target/llvmir.mlir