@@ -2437,9 +2437,9 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name,
2437
2437
// Don't create llvm.used if there is no need.
2438
2438
if (List.empty ())
2439
2439
return ;
2440
- // Get target type when templated global variables are used,
2441
- // to emit them correctly in the target (default) address space and avoid
2442
- // emitting them in a private address space .
2440
+ // For SYCL emit pointers in the default address space which is a superset of
2441
+ // other address spaces, so that casts from any other address spaces will be
2442
+ // valid .
2443
2443
llvm::PointerType *TargetType = CGM.Int8PtrTy ;
2444
2444
if (CGM.getLangOpts ().SYCLIsDevice )
2445
2445
TargetType = llvm::IntegerType::getInt8PtrTy (
@@ -2862,9 +2862,9 @@ void CodeGenModule::AddGlobalAnnotations(const ValueDecl *D,
2862
2862
Annotations.push_back (EmitAnnotateAttr (GV, I, D->getLocation ()));
2863
2863
}
2864
2864
2865
- // Add "sycl-unique-id" llvm IR attribute for global variables marked with
2866
- // SYCL device_global attribute, and return a unique string using
2867
- // __builtin_sycl_unique_stable_id .
2865
+ // Add "sycl-unique-id" llvm IR attribute that has a unique string generated
2866
+ // by __builtin_sycl_unique_stable_id for global variables marked with
2867
+ // SYCL device_global attribute .
2868
2868
static void addSYCLUniqueID (llvm::GlobalVariable *GV, const VarDecl *VD,
2869
2869
ASTContext &Context) {
2870
2870
auto builtinString = SYCLUniqueStableIdExpr::ComputeName (Context, VD);
0 commit comments