[PATCH] D141620: clang/OpenCL: Make enqueued blocks inherit the parent attributes

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 13 05:53:09 PST 2023


arsenm added inline comments.


================
Comment at: clang/lib/CodeGen/TargetInfo.cpp:12488
+  // FIXME: The invoke isn't applying the right attributes either
+  llvm::AttrBuilder KernelAttrs(C, CGF.CurFn->getAttributes().getFnAttrs());
+  KernelAttrs.addAttribute("enqueued-block");
----------------
arsenm wrote:
> yaxunl wrote:
> > arsenm wrote:
> > > yaxunl wrote:
> > > > The kernel should inherit attributes from the parent function since the parent may have function attributes explicitly specified for itself only. The kernel should take the default function attributes.
> > > I was specifically try to get those, e.g. the attribute(target) example. Is there some way to specify attributes directly on a block?
> > > I was specifically try to get those, e.g. the attribute(target) example. Is there some way to specify attributes directly on a block?
> > 
> > I don't think so https://godbolt.org/z/Pahv46dh6
> It doesn't allow noinline or target, but does allow const so it seems to be specific attributes. I guess that means it should just use the defaults
Something is inconsistent. If I apply the target attribute to the caller, it allows me to call the target builtin in the block. If I don't, it doesn't allow me to use it in the caller but does in the block. There's a missing diagnostic at least


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

https://reviews.llvm.org/D141620



More information about the cfe-commits mailing list