[all-commits] [llvm/llvm-project] 359e4a: [Clang] Parse toolchain-specific offloading argume...

Joseph Huber via All-commits all-commits at lists.llvm.org
Mon Jul 11 12:38:12 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 359e4a8247316c2f0c21072919836fd9fd4cf0f1
      https://github.com/llvm/llvm-project/commit/359e4a8247316c2f0c21072919836fd9fd4cf0f1
  Author: Joseph Huber <jhuber6 at vols.utk.edu>
  Date:   2022-07-11 (Mon, 11 Jul 2022)

  Changed paths:
    M clang/lib/Driver/Driver.cpp

  Log Message:
  -----------
  [Clang] Parse toolchain-specific offloading arguments directly

OpenMP supports multiple offloading toolchains and architectures. In
order to support this we originally used `getArgsForToolchain` to get
the arguments only intended for each toolchain. This allowed users to
manually specify if an `--offload-arch=` argument was intended for which
toolchain using `-Xopenmp-target=` or other methods. For example,

```
clang input.c -fopenmp -fopenmp-targets=nvptx64,amdgcn -Xopenmp-target=nvptx64 --offload-arch=sm_70 -Xopenmp-target=amdgcn --offload-arch=gfx908
```

However, this was causing problems with the AMDGPU toolchain. This is
because the AMDGPU toolchain for OpenMP uses an `amdgpu` arch to determine the
architecture. If this tool is not availible the compiler will exit with an error
even when manually specifying the architecture. This patch pulls out the logic in
`getArgsForToolchain` and specializes it for extracting `--offload-arch`
arguments to avoid this.

Reviewed By: JonChesterfield, yaxunl

Differential Revision: https://reviews.llvm.org/D129435




More information about the All-commits mailing list