[mlir] LLVM import: handle function-typed constants
authorAlex Zinenko <zinenko@google.com>
Wed, 15 Jan 2020 13:56:25 +0000 (14:56 +0100)
committerAlex Zinenko <zinenko@google.com>
Wed, 15 Jan 2020 14:01:49 +0000 (15:01 +0100)
commitdc553ce646cdbab32d72d263d3f289952648b920
treeaca2c2f8b564554733ace147912a8f391e29ed74
parent936483fb7dd2c8c6b014516ff3b3cd13740e0518
[mlir] LLVM import: handle function-typed constants

The current implementation of the LLVM-to-MLIR translation could not handle
functions used as constant values in instructions. The handling is added
trivially as `llvm.mlir.constant` can define constants of function type using
SymbolRef attributes, which works even for functions that have not been
declared yet.
mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
mlir/test/Target/import.ll