summaryrefslogtreecommitdiffstats
path: root/mlir/lib/Conversion/StandardToLLVM
diff options
context:
space:
mode:
authorAlex Zinenko <zinenko@google.com>2019-12-03 00:26:13 -0800
committerA. Unique TensorFlower <gardener@tensorflow.org>2019-12-03 00:26:44 -0800
commitfdbb99cd6252b890b4deff7de0f67a6577c370b3 (patch)
treeaa97fac30d90826b8badea27be35b356da0a1862 /mlir/lib/Conversion/StandardToLLVM
parent16a9296bc8a662516a7a7d9b13a2c038a39bbb1e (diff)
downloadbcm5719-llvm-fdbb99cd6252b890b4deff7de0f67a6577c370b3.tar.gz
bcm5719-llvm-fdbb99cd6252b890b4deff7de0f67a6577c370b3.zip
Add linkage support to LLVMFuncOp
A recent commit introduced the Linkage attribute to the LLVM dialect and used it in the Global Op. Also use it in LLVMFuncOp. As per LLVM Language Reference, if the linkage attribute is omitted, the function is assumed to have external linkage. PiperOrigin-RevId: 283493299
Diffstat (limited to 'mlir/lib/Conversion/StandardToLLVM')
-rw-r--r--mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
index d226766a3fc..2db02db7f0c 100644
--- a/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
+++ b/mlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
@@ -443,9 +443,11 @@ struct FuncOpConversion : public LLVMLegalizationPattern<FuncOp> {
attributes.push_back(attr);
}
- // Create an LLVM funcion.
+ // Create an LLVM funcion, use external linkage by default until MLIR
+ // functions have linkage.
auto newFuncOp = rewriter.create<LLVM::LLVMFuncOp>(
- op->getLoc(), funcOp.getName(), llvmType, attributes);
+ op->getLoc(), funcOp.getName(), llvmType, LLVM::Linkage::External,
+ attributes);
rewriter.inlineRegionBefore(funcOp.getBody(), newFuncOp.getBody(),
newFuncOp.end());
OpenPOWER on IntegriCloud