Summary:
This patch is mostly an NFC that renames the existing `-fopenmp-targets`
into `--offload-targets`. Doing this early to simplify a follow-up patch
that will hopefully allow this syntax to be used more generically over
the existing `--offload` syntax (which I think is mostly unmaintained
now.). Following in the well-trodden path of trying to pull language
specific offload options into generic ones, but right now this is still
just OpenMP specific.
- This reverts commit
0c6c4a9993.
- Add '-mcode-object-version=5' as to explicitly use code object
version 5 to match with 'FAIL' diagnostic.
- Add Requires directive to support lit test run on platforms
registered with x86_64 and amdgpu.
Summary:
Currently we have a subset of arguments that are handled specially to
keep them consistent between host and device compiles, however, this is
extremely hacky as it only works on a few predetermined options. This is
a holdover from the days before the linker wrapper shuttled all of its
arguments through `clang`. Now that we just use clang, all we need to do
is just use the `--device-compiler=` option to forward it there and let
the normal toolchain handle it.
For example,
```console
clang -fopenmp --offload-arch=gfx1030,sm_89 -Xarch_nvptx64 -O3 -foffload-lto
```
will forward the `-O3` to the LTO compilation only for the NVPTX
compilation.
These tests assume `-fopenmp=libomp` is the default, which it may not
be. We also need to invoke clang with `-no-canonical-prefixes` to ensure
we get the argv we expect, i.e. clang may be a symlink to a binary
elsewhere that has a different name.
Fixes tests added by 455cedc805e7a42c6cfbe26a4ddd9e623cca6066 and
646d352ab0d0a9cfafa3f2c9c415b5773834ad5b
Using 'compiler-rt' in 'LLVM_ENABLE_PROJECTS' causes the clang runtime
libraries to be build and installed with arch suffix names i.e
```'*-<arch>.a'``` and ```'*-<arch>.so'```.