[clang] clang/AMDGPU: Respect __launch_bounds__ attribute (PR #215615)
Arseniy Obolenskiy via cfe-commits
cfe-commits at lists.llvm.org
Tue Aug 11 23:30:04 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>();
----------------
aobolensk wrote:
Should that be limited to kernels only, not just any device side functions?
https://github.com/llvm/llvm-project/pull/215615
More information about the cfe-commits
mailing list