================
@@ -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);
+ cast<Function>(GV)->addFnAttr("nvvm.kernel");
----------------
AlexMaclean wrote:
Some annotations (such as "texture") are applied to global variables, not
functions. I cannot unconditionally cast to a Function until confirming the
annotation kind.
https://github.com/llvm/llvm-project/pull/119261
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits