[llvm] [KernelInfo] Implement new LLVM IR pass for GPU code analysis (PR #102944)

Joel E. Denny via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 27 16:47:36 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");
----------------
jdenny-ornl wrote:

Thanks for letting me know.  Now that your PR #122320 has landed, I've updated this PR to use it.

I see that `llvm::omp::getDeviceKernels` checks for the kernel calling convention but also still kernel in nvvm.annotations.  Should KernelInfo check for the latter as well?  My update only checks for the former.

https://github.com/llvm/llvm-project/pull/102944


More information about the llvm-commits mailing list