[llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)
Artem Belevich via llvm-commits
llvm-commits at lists.llvm.org
Mon Dec 9 12:35:34 PST 2024
================
@@ -311,11 +311,16 @@ std::optional<unsigned> getMaxNReg(const Function &F) {
}
bool isKernelFunction(const Function &F) {
+ if (F.getCallingConv() == CallingConv::PTX_Kernel)
+ return true;
+
+ if (F.hasFnAttribute("nvvm.kernel"))
+ return true;
+
if (const auto X = findOneNVVMAnnotation(&F, "kernel"))
return (*X == 1);
- // There is no NVVM metadata, check the calling convention
----------------
Artem-B wrote:
Is there a reason we're ignoring calling convention as an indication of the function being a kernel?
I think standalone compilation may be relying on that. @jhuber6 -- is this needed for your use case?
https://github.com/llvm/llvm-project/pull/119261
More information about the llvm-commits
mailing list