Skip to content

Commit 8c38eda

Browse files
committed
[NVPTX] Use "const" cache w/ "device_global"
Signed-off-by: JackAKirk <[email protected]>
1 parent 48a75f4 commit 8c38eda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5758,6 +5758,10 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) {
57585758
auto *Scope = D->getAttr<SYCLScopeAttr>();
57595759
if (Scope && Scope->isWorkGroup())
57605760
return LangAS::sycl_local;
5761+
5762+
const RecordDecl *RD = D->getType()->getAsRecordDecl();
5763+
if (getTriple().isNVPTX() && RD && RD->hasAttr<SYCLDeviceGlobalAttr>() && D->getType().isConstQualified())
5764+
return LangAS::cuda_constant;
57615765
}
57625766

57635767
if (LangOpts.SYCLIsDevice &&

0 commit comments

Comments
 (0)