================ @@ -302,6 +299,19 @@ void NVPTXTargetCodeGenInfo::addNVVMMetadata( llvm::ConstantAsMetadata::get(GV), llvm::MDString::get(Ctx, Name), llvm::ConstantAsMetadata::get( llvm::ConstantInt::get(llvm::Type::getInt32Ty(Ctx), Operand))}; + // Append metadata to nvvm.annotations + MD->addOperand(llvm::MDNode::get(Ctx, MDVals)); +} + +void NVPTXTargetCodeGenInfo::addNVVMGridConstantMetadata( + llvm::GlobalValue *GV, const SmallVectorImpl<int> &GridConstantArgs) { + llvm::Module *M = GV->getParent(); + llvm::LLVMContext &Ctx = M->getContext(); + + // Get "nvvm.annotations" metadata node + llvm::NamedMDNode *MD = M->getOrInsertNamedMetadata("nvvm.annotations"); ---------------- Artem-B wrote:
> For this MR I want to lay down the framework SGTM. We don't have to it all at once. > Specifically for grid_constant can we just upgrade to the existing readonly > parameter attribute? That would be even better. No custom attributes *and* we can take advantage of local copy avoidance without explicit user annotations. Sounds like a win-win to me. I can't think of a reason not to do that. https://github.com/llvm/llvm-project/pull/119261 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits