[PATCH] D55067: [HIP] Fix offset of kernel argument for AMDGPU target

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Nov 29 13:16:11 PST 2018


yaxunl added a comment.

In D55067#1313364 <https://reviews.llvm.org/D55067#1313364>, @arsenm wrote:

> In D55067#1313264 <https://reviews.llvm.org/D55067#1313264>, @yaxunl wrote:
>
> > In D55067#1313213 <https://reviews.llvm.org/D55067#1313213>, @rjmccall wrote:
> >
> > > This seems backwards.  Clang knows what the actual ABI alignment of the C type is, and it doesn't have to match the alignment of the IR type that IRGen produces.  It's the actual C ABI alignment that's supposed to affect the calling convention, so there needs to be some way to specify the C ABI alignment on the parameter in IR.  That may mean using `byval`, which can be given an explicit alignment.
> >
> >
> > AMDGPU backend does not support passing struct type kernel argument by pointer with byval attribute.
> >
> > @arsenm Do you think it is feasible to use pointer with byval attribute to pass the struct type kernel argument? Thanks.
>
>
> byval really doesn't make any sense for kernels. The address space wouldn't even match correctly, since byval is for stack passed arguments


How about clang emits kernel argument alignment metadata for C ABI and backend follows that?


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

https://reviews.llvm.org/D55067





More information about the cfe-commits mailing list