[PATCH] D150998: [OpenMP] Fix using the target ID when using the new driver

Joseph Huber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 7 08:36:55 PDT 2023


jhuber6 added a comment.

In D150998#4403401 <https://reviews.llvm.org/D150998#4403401>, @yaxunl wrote:

> In D150998#4403359 <https://reviews.llvm.org/D150998#4403359>, @jhuber6 wrote:
>
>> Can we use this approach for now and land this? It makes the "new driver" less broken than it currently is as it supports target ID compilation in the general term. Fixing the merging rules will be a rather large overhaul so I'd like this to work in the meantime.
>>
>> This patch allows `--offload-arch=gfx90a:xnack+` to work. It does not fix if the user links in a library that has `--offload-arch=gfx90a:xnack-` as well.
>
> can we add a test to make sure  `--offload-arch=gfx90a:xnack+`  and `--offload-arch=gfx90a:xnack-` work together? It is a very common use case for HIP.

With the current patch, they would both be linked together and it would probably set the `xnack` value to the last one that showed up in the link list. E.g.

  clang -xhip a.c --offload-arch=gfx90a:xnack+ --offload-new-driver -fgpu-rdc
  clang -xhip b.c --offload-arch=gfx90a:xnack- --offload-new-driver -fgpu-rdc
  clang --offload-link a.o b.o

Would result in a.o and b.o getting linked together with `xnack-` set as the backend attribute.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150998



More information about the cfe-commits mailing list