[mlir] error out on unsupported attribute kinds in LLVM global translation
authorAlex Zinenko <zinenko@google.com>
Mon, 2 Mar 2020 14:18:41 +0000 (15:18 +0100)
committerAlex Zinenko <zinenko@google.com>
Tue, 3 Mar 2020 16:08:28 +0000 (17:08 +0100)
commitefa2d533773163fafa182bd66003cf4527d46a0f
tree1f2d48a6a613c0abfa44946f17a72f52adb60554
parent680a75e1e45b36ffeea95b5d0c0744d7f7e83be1
[mlir] error out on unsupported attribute kinds in LLVM global translation

Some attribute kinds are not supported as "value" attributes of
`llvm.mlir.constant` when translating to LLVM IR. We were correctly reporting
an error, but continuing the translation using an "undef" value instead,
leading to a surprising mix of error messages and output IR. Abort the
translation after the error is reported.

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