[clang] [llvm] [NVPTX] Add NVVMUpgradeAnnotations pass to cleanup legacy annotations (PR #119261)

Artem Belevich via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 10 11:21:35 PST 2024


================
@@ -5022,6 +5022,69 @@ bool llvm::UpgradeDebugInfo(Module &M) {
   return Modified;
 }
 
+bool static upgradeSingleNVVMAnnotation(GlobalValue *GV, StringRef K,
+                                        const Metadata *V) {
+  if (K == "kernel") {
+    assert(mdconst::extract<ConstantInt>(V)->getZExtValue() == 1);
----------------
Artem-B wrote:

Assert should not be used here as it's not an LLVM error. It's an input error and should be diagnosed (or accepted/ignored). Considering that the value is a flag, and not very useful one at that (I don't think `kernel 0` is ever actually used, it would be OK to accept a non-zero value as "it's a kernel" and zero as "not a kernel".

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


More information about the llvm-commits mailing list