[llvm] [KernelInfo] Implement new LLVM IR pass for GPU code analysis (PR #102944)
Alex MacLean via llvm-commits
llvm-commits at lists.llvm.org
Tue Jan 7 14:34:33 PST 2025
================
@@ -322,6 +322,32 @@ void Module::eraseNamedMetadata(NamedMDNode *NMD) {
eraseNamedMDNode(NMD);
}
+SetVector<Function *> Module::getDeviceKernels() {
+ // TODO: Create a more cross-platform way of determining device kernels.
+ NamedMDNode *MD = getNamedMetadata("nvvm.annotations");
----------------
AlexMaclean wrote:
I'm working on deprecating this method of specifying a kernel in favor of the `ptx_kernel` calling convention (see https://github.com/llvm/llvm-project/pull/120806). I think it would be good to check the calling convention of all functions in the module and add them to the set if they have `ptx_kernel` or `amdgpu_kernel` (maybe others too?).
https://github.com/llvm/llvm-project/pull/102944
More information about the llvm-commits
mailing list