[PATCH] D135374: [OpenMP][AMDGPU] Add 'uniform-work-group' attribute to OpenMP kernels

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 6 10:34:23 PDT 2022


arsenm added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:9424-9431
   const bool IsHIPKernel =
       M.getLangOpts().HIP && FD && FD->hasAttr<CUDAGlobalAttr>();
+  const bool IsOpenMPkernel =
+      M.getLangOpts().OpenMPIsDevice &&
+      (F->getCallingConv() == llvm::CallingConv::AMDGPU_KERNEL);
 
+  if (IsHIPKernel || IsOpenMPkernel)
----------------
jhuber6 wrote:
> arsenm wrote:
> > jhuber6 wrote:
> > > arsenm wrote:
> > > > Can we move this whole thing out of amdgpu code and into language code?
> > > Do you mean moving this into each language's respective code generation / sema? This seemed like the most straightforward place to put it as it's where we attach other target specific attributes.
> > But it's not actually a target specific attribute, it's a language property 
> Sure, I just figured this was the easier option since it already existed here for HIP. Which file do you suggest this go in? Should we just do this specifically in HIP / OpenMP codegen?
Putting it here is a fine first step, it's just always bothered me that it's here. I don't know clang enough to know where it belongs. OpenCL defined this in the first place and changed the default behavior in CL2.0


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135374/new/

https://reviews.llvm.org/D135374



More information about the cfe-commits mailing list