8 Commits

Author SHA1 Message Date
Joseph Huber
6db02dc431
[Clang] Introduce --offload-targets for -fopenmp-targets (#146594)
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.
2025-07-04 16:20:53 -05:00
Amit Kumar Pandey
46f1bab793
Reapply "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP."… (#126671)
- 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.
2025-02-12 13:40:51 +05:30
Florian Mayer
0c6c4a9993
Revert "[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP." (#126628)
Reverts llvm/llvm-project#126186

This broke the sanitizer buildbot:
https://lab.llvm.org/buildbot/#/builders/55/builds/6846
2025-02-10 16:35:26 -08:00
Amit Kumar Pandey
c69be3fe4b
[Driver][ROCm][OpenMP] Fix default ockl linking for OpenMP. (#126186)
ASan gpu runtime (asanrtl.bc) linking is dependent on 'ockl.bc'. Link
'ockl.bc' only when ASan is enabled for openmp amdgpu offloading
application.
2025-02-10 21:41:49 +05:30
Joseph Huber
2e18c94ad1
[Clang] Forward arguments to the device compiler better (#125957)
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.
2025-02-06 10:42:15 -06:00
Jordan Rupprecht
a57bbff736
[clang][test][OpenMP] Fix test assumptions of libomp and clang paths (#125891)
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
2025-02-05 13:31:04 -06:00
Amit Kumar Pandey
56a49884ad
[NFC] Fix Lit test 'amdgpu-openmp-sanitize-options.c'. (#125857)
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'```.
2025-02-05 20:16:39 +05:30
Amit Kumar Pandey
646d352ab0
[OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (#124754)
Enable device code ASan instrumentation for openmp offload applications
using option '-fsanitize=address'.
2025-02-05 13:37:31 +05:30