[PATCH] D69826: [hip] Enable pointer argument lowering through coercing type.

Yaxun Liu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 5 10:19:57 PST 2019


yaxunl added a comment.

I am a little bit concerned that user may have such code:

  struct A { int *p; }
  __global__ kernel(A a) {
    int x;
    a.p = &x;
    f(a);
  }

@arsenm what happens if a private pointer is mis-used as a global pointer?

I am wondering if we should coerce byval struct kernel arg to global only if they are const, e.g.

  __global__ kernel(const A a);

I understand this may lose performance. Or should we introduce an option to let user disable coerce of non-const struct kernel arg to global.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D69826





More information about the cfe-commits mailing list