[MLIR] Primitive linkage lowering of FuncOp
authorWilliam S. Moses <gh@wsmoses.com>
Sun, 22 Aug 2021 20:44:17 +0000 (16:44 -0400)
committerWilliam S. Moses <gh@wsmoses.com>
Sat, 4 Sep 2021 00:41:39 +0000 (20:41 -0400)
commit21d43daf8f4ae2e701329d149e379d057e83d401
treef690fb6f4fe1c9d75bfaafd6a1c26392c4579e96
parent775ab780fd2a23cfc80ace571938ddd21d080173
[MLIR] Primitive linkage lowering of FuncOp

FuncOp always lowers to an LLVM external linkage presently. This makes it impossible to define functions in mlir which are local to the current module. Until MLIR FuncOps have a more formal linkage specification, this commit allows funcop's to have an optionally specified llvm.linkage attribute, whose value will be used as the linkage of the llvm funcop when lowered.

Differential Revision: https://reviews.llvm.org/D108524

Support LLVM linkage
mlir/lib/Conversion/StandardToLLVM/StandardToLLVM.cpp
mlir/test/Conversion/StandardToLLVM/convert-funcs.mlir