[clang] clang/AMDGPU: Respect __launch_bounds__ attribute (PR #215615)
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Wed Aug 12 01:38:42 PDT 2026
================
@@ -347,8 +347,28 @@ void AMDGPUTargetCodeGenInfo::setFunctionDeclAttributes(
const bool IsHIPKernel = M.getLangOpts().HIP && FD->hasAttr<CUDAGlobalAttr>();
const auto *FlatWGS = FD->getAttr<AMDGPUFlatWorkGroupSizeAttr>();
+
+ // The CUDA __launch_bounds__ arguments are honored only if the equivalent
+ // native amdgpu_flat_work_group_size / amdgpu_waves_per_eu attribute was not
+ // also spelled out; those take precedence.
+ const auto *LaunchBounds = FD->getAttr<CUDALaunchBoundsAttr>();
----------------
arsenm wrote:
Though actually I object to this behavior. We really ought to to respect this on device functions, though that's a separate change
https://github.com/llvm/llvm-project/pull/215615
More information about the cfe-commits
mailing list