[PATCH] D99350: [OPENMP]Fix PR49649: The introduction of $ref globals is not always valid.

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 28 04:49:58 PDT 2021


ABataev added a comment.

In D99350#2721724 <https://reviews.llvm.org/D99350#2721724>, @jdoerfert wrote:

> The cast was never the problem but the fact that the `$ref` lives in the global address space while the global value might be in the shared one.
> D101030 <https://reviews.llvm.org/D101030> gives a way out here by not creating `$ref` variables if there is no host version of a global. This makes sense because we don't need to copy to the global ever.
> So, users can have static globals in shared memory by ensuring they are not host accessible. We probably should emit an error if they try to do global in shared memory
> that has a host version.
>
> Long story short, this cast won't help.

I checked that this cast helps to fix a problem with ptxas with shared/global memory refs. I'm not saying that this is the best solution, but better to have a fix while the final solution is not landed. Plus. maybe, it will fix some other potential issues until the `$ref`s will go away. Maybe need a new attribute to avoid early optimization of the internal vars.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D99350



More information about the cfe-commits mailing list