[PATCH] D138284: Fix incorrect cast in VisitSYCLUniqueStableNameExpr

Alexey Bader via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 18 06:58:43 PST 2022


bader added inline comments.


================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:1635
+      Context.getTargetInfo().getConstantAddressSpace().value_or(
+          LangAS::Default));
   llvm::Constant *GlobalConstStr = Builder.CreateGlobalStringPtr(
----------------
> This changes the code generation for spir64 to place the globals in addrspace(4). I believe is correct, but it would be good for someone who is familiar with the target to confirm.

Globals must reside in `sycl_global` namespace, which is `addrspace(1)` for spir* targets.
`addrspace(4)` represents "generic" address space, which is a placeholder for a specific address space. If we leave it `addrspace(4)` for global definition, the compiler won't be able to infer genuine address space.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D138284/new/

https://reviews.llvm.org/D138284



More information about the cfe-commits mailing list