mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
[mlir][llvm] Add UnnamedAddr attribute to GlobalOp
This patch add the UnnamedAddr attribute for the GlobalOp in the LLVM dialect. The attribute is also handled to and from LLVM IR. This is meant to be used in a follow up patch to lower OpenACC/OpenMP ops to call to kmp and tgt runtime calls (D100678). Reviewed By: mehdi_amini Differential Revision: https://reviews.llvm.org/D100677
This commit is contained in:
@@ -407,6 +407,9 @@ LogicalResult ModuleTranslation::convertGlobals() {
|
||||
op.sym_name(),
|
||||
/*InsertBefore=*/nullptr, llvm::GlobalValue::NotThreadLocal, addrSpace);
|
||||
|
||||
if (op.unnamed_addr().hasValue())
|
||||
var->setUnnamedAddr(convertUnnamedAddrToLLVM(*op.unnamed_addr()));
|
||||
|
||||
globalsMapping.try_emplace(op, var);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user