Skip to content

Commit 6e06ec8

Browse files
Address code review comments
Signed-off-by: Sergey Semenov <[email protected]>
1 parent 7947ac3 commit 6e06ec8

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

clang/lib/CodeGen/CodeGenFunction.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,8 +540,10 @@ void CodeGenFunction::EmitOpenCLKernelMetadata(const FunctionDecl *FD,
540540
if (!FD->hasAttr<OpenCLKernelAttr>())
541541
return;
542542

543+
// TODO Module identifier is not reliable for this purpose since two modules
544+
// can have the same ID, needs improvement
543545
if (getLangOpts().SYCLIsDevice)
544-
Fn->addFnAttr("module-id", Fn->getParent()->getModuleIdentifier());
546+
Fn->addFnAttr("sycl-module-id", Fn->getParent()->getModuleIdentifier());
545547

546548
llvm::LLVMContext &Context = getLLVMContext();
547549

clang/test/CodeGenSYCL/module-id.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ int main() {
1111
}
1212
// CHECK: define spir_kernel void @{{.*}}kernel{{.*}}() #[[KERN_ATTR:[0-9]+]]
1313

14-
// CHECK: #[[KERN_ATTR]] = { {{.*}}"module-id"="{{.*}}module-id.cpp"{{.*}} }
14+
// CHECK: #[[KERN_ATTR]] = { {{.*}}"sycl-module-id"="{{.*}}module-id.cpp"{{.*}} }

0 commit comments

Comments
 (0)