[mlir] Fix translation of splat constants to LLVM IR
authorAlex Zinenko <zinenko@google.com>
Tue, 14 Jan 2020 10:30:25 +0000 (11:30 +0100)
committerAlex Zinenko <zinenko@google.com>
Tue, 14 Jan 2020 11:37:47 +0000 (12:37 +0100)
commitd6ea8ff0d74bfe5cd181ccfe91c2c300c5f7a35d
tree71b416c166b40ccea467300cf6075fcada5c0ccd
parent3d6c492d7a9830a1a39b85dfa215743581d52715
[mlir] Fix translation of splat constants to LLVM IR

Summary:
When converting splat constants for nested sequential LLVM IR types wrapped in
MLIR, the constant conversion was erroneously assuming it was always possible
to recursively construct a constant of a sequential type given only one value.
Instead, wait until all sequential types are unpacked recursively before
constructing a scalar constant and wrapping it into the surrounding sequential
type.

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits

Tags: #llvm

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