Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShraiysh Vaishay <Shraiysh.Vaishay@amd.com>2022-04-13 05:50:56 +0300
committerShraiysh Vaishay <Shraiysh.Vaishay@amd.com>2022-04-13 06:01:01 +0300
commitf0ba32d6667b2ea9a58c7dbd5f27984da9d335fc (patch)
tree002d5808beff16b501888550487400293f9bf229 /mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
parent36de2d639eca4cead62a6c6d288a501cee8bb6e7 (diff)
[mlir][LLVM-IR] Added support for global variable attributes
This patch adds thread_local to llvm.mlir.global and adds translation for dso_local and addr_space to and from LLVM IR. Reviewed By: Mogball Differential Revision: https://reviews.llvm.org/D123412
Diffstat (limited to 'mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp')
-rw-r--r--mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp b/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
index 2f866e10dd8a..bda695c35ddb 100644
--- a/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
+++ b/mlir/lib/Target/LLVMIR/ConvertFromLLVMIR.cpp
@@ -432,10 +432,11 @@ GlobalOp Importer::processGlobal(llvm::GlobalVariable *gv) {
alignment = align.value();
}
- GlobalOp op =
- b.create<GlobalOp>(UnknownLoc::get(context), type, gv->isConstant(),
- convertLinkageFromLLVM(gv->getLinkage()),
- gv->getName(), valueAttr, alignment);
+ GlobalOp op = b.create<GlobalOp>(
+ UnknownLoc::get(context), type, gv->isConstant(),
+ convertLinkageFromLLVM(gv->getLinkage()), gv->getName(), valueAttr,
+ alignment, /*addr_space=*/gv->getAddressSpace(),
+ /*dso_local=*/gv->isDSOLocal(), /*thread_local=*/gv->isThreadLocal());
if (gv->hasInitializer() && !valueAttr) {
Region &r = op.getInitializerRegion();