[Mlir-commits] [clang] [llvm] [mlir] [NVPTX] Convert scalar function nvvm.annotations to attributes (PR #125908)
Justin Holewinski
llvmlistbot at llvm.org
Mon Feb 10 08:27:47 PST 2025
================
@@ -375,11 +375,8 @@ void CodeGenModule::handleCUDALaunchBoundsAttr(llvm::Function *F,
if (MinBlocks > 0) {
if (MinBlocksVal)
*MinBlocksVal = MinBlocks.getExtValue();
- if (F) {
- // Create !{<func-ref>, metadata !"minctasm", i32 <val>} node
- NVPTXTargetCodeGenInfo::addNVVMMetadata(F, "minctasm",
- MinBlocks.getExtValue());
- }
+ if (F)
+ F->addFnAttr("nvvm.minctasm", llvm::utostr(MinBlocks.getExtValue()));
----------------
jholewinski wrote:
We should eventually create a list of strings for valid `nvvm.` function attributes and use them here instead of hard-coding strings. It would serve as a single-source-of-truth for the set of valid attributes. Not necessary for this PR, but something to consider for the future.
https://github.com/llvm/llvm-project/pull/125908
More information about the Mlir-commits
mailing list