[PATCH] D120566: [OpenCL][AMDGPU]: Do not allow a call to kernel

Matt Arsenault via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 25 13:48:42 PST 2022


arsenm added a comment.

In D120566#3346506 <https://reviews.llvm.org/D120566#3346506>, @rjmccall wrote:

> Is there something which stops you from taking the address of a kernel and then calling it?  If not, are there actually any uses of kernels in the module that shouldn't be rewritten as uses of the clone?

The actual amdgpu_kernel is uncallable and has a totally different ABI, and is invoked by external driver code. From the user's device code perspective, only the callable function version is meaningful.

> I feel like this would be a lot easier to just fix in your LLVM pass so that you rewrite any uses of a kernel to use a clone instead before you rewrite the kernel.

Then we can't ban calls to kernels (and would be pushing some kind of symbol naming conflict decision into the backend) and in principle would have to handle this actual call.

We also don't really want these to have similar/compatible signatures where you can just swap out the call target. For example I want to more drastically change the IR used for aggregates between the two cases.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D120566



More information about the cfe-commits mailing list