Skip to content

Commit 98229f4

Browse files
committed
Comments
1 parent 4414706 commit 98229f4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

clang/lib/CodeGen/CGCUDANV.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,6 +1221,7 @@ void CGNVCUDARuntime::createOffloadingEntries() {
12211221
? static_cast<int32_t>(llvm::offloading::OffloadGlobalNormalized)
12221222
: 0);
12231223
if (I.Flags.getKind() == DeviceVarFlags::Variable) {
1224+
// TODO: Update the offloading entries struct to avoid this indirection.
12241225
if (I.Flags.isManaged()) {
12251226
assert(I.Var->getName().ends_with(".managed") &&
12261227
"HIP managed variables not transformed");
@@ -1234,7 +1235,9 @@ void CGNVCUDARuntime::createOffloadingEntries() {
12341235
auto *Struct = new llvm::GlobalVariable(
12351236
M, llvm::offloading::getManagedTy(M),
12361237
/*IsConstant=*/true, llvm::GlobalValue::PrivateLinkage, Initializer,
1237-
I.Var->getName());
1238+
I.Var->getName(), /*InsertBefore=*/nullptr,
1239+
llvm::GlobalVariable::NotThreadLocal,
1240+
CGM.getContext().getTargetAddressSpace(LangAS::Default));
12381241

12391242
llvm::offloading::emitOffloadingEntry(
12401243
M, Struct, getDeviceSideName(I.D), VarSize,

0 commit comments

Comments
 (0)