[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2023-03-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D140663#4203604 , @tra wrote: > It appears that this patch may be causing a use-after free when we attempt to > generate kernel registration code. > The root cause is that the value we insert into `KernelHandles` by name is

[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2023-03-17 Thread Artem Belevich via Phabricator via cfe-commits
tra added a comment. It appears that this patch may be causing a use-after free when we attempt to generate kernel registration code. The root cause is that the value we insert into `KernelHandles` by name is later on replaced by a different instance of the global value with the same name.

[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2023-01-19 Thread Daniele Castagna via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG32c26e27b6fc: CUDA/HIP: Use kernel name to map to symbol (authored by dcastagna). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2023-01-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140663/new/ https://reviews.llvm.org/D140663

[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2023-01-19 Thread Daniele Castagna via Phabricator via cfe-commits
dcastagna updated this revision to Diff 490644. dcastagna added a comment. Add a check for device side kernel name Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140663/new/ https://reviews.llvm.org/D140663 Files: clang/lib/CodeGen/CGCUDANV.cpp

[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2023-01-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/CodeGenCUDA/incomplete-func-ptr-type.cu:22 +// CHECK: define internal void @__hip_register_globals(ptr %0) { +// CHECK:%1 = call i32 @__hipRegisterFunction(ptr %0, ptr @_Z4kern7TempValIjE, ptr @0, ptr @0, i32 -1, ptr

[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2023-01-19 Thread Daniele Castagna via Phabricator via cfe-commits
dcastagna updated this revision to Diff 490559. dcastagna added a comment. Address yaxunl comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D140663/new/ https://reviews.llvm.org/D140663 Files: clang/lib/CodeGen/CGCUDANV.cpp

[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2023-01-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/CodeGenCUDA/incomplete-func-ptr-type.cu:2 +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -x hip %s -o - \ +// RUN: | FileCheck %s + need to check `_Z19__device_stub__kern7TempValIjE` generates

[PATCH] D140663: CUDA/HIP: Use kernel name to map to symbol

2022-12-25 Thread Daniele Castagna via Phabricator via cfe-commits
dcastagna created this revision. Herald added subscribers: mattd, yaxunl. Herald added a project: All. dcastagna requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Currently CGCUDANV uses an llvm::Function as a key to map kernels to a symbol