Skip to content

Commit 694bf67

Browse files
committed
Add sycl_global address space inference.
Try to avoid using slow generic address space where possible. Signed-off-by: JackAKirk <[email protected]>
1 parent dcb975d commit 694bf67

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5755,6 +5755,9 @@ LangAS CodeGenModule::GetGlobalVarAddressSpace(const VarDecl *D) {
57555755
}
57565756

57575757
if (LangOpts.SYCLIsDevice && D) {
5758+
if (D->hasAttr<SYCLGlobalVarAttr>())
5759+
return LangAS::sycl_global;
5760+
57585761
auto *Scope = D->getAttr<SYCLScopeAttr>();
57595762
if (Scope && Scope->isWorkGroup())
57605763
return LangAS::sycl_local;

0 commit comments

Comments
 (0)