Commit graph

3687 commits

Author SHA1 Message Date
Robert Imschweiler
2d8a394129
[libomp] Add kmp_str_ref (ADT 1/2) (#176162)
libomp currently has two limitations:
1) although it's C++, it doesn't link against the C++ stdlib 2) it
cannot link against the implementation of LLVM ADTs

These limitations shall not be altered at the moment.

As a result, this commit introduces kmp_str_ref, which is similar to
LLVM's StringRef. It currently only includes methods I need at the
moment, but it's easily extensible.
2026-06-15 17:20:56 +02:00
Michael Kruse
23d906e24b
[openmp] Fix export file paths (#202692)
The files omp_lib.h and omp-tools.h are the outputs of two
configure_file invocations which specify the full path of the outputs.
Use these full paths in LibompExports.cmake so they can actually be
found.
2026-06-12 13:27:46 +02:00
Jameson Nash
7daddf2b6f
[docs] try again to handle doxygen everywhere (#203081)
The previous attempt at this (b7da956501)
still broke standalone builds. Now I have locally tested standalone
flang, runtimes (with openmp), lldb, combined builds, and the utils
script. Hopefully that covers everything this time, and gets everything
into a more consistent state (always using the HandleDoxygen script in
the same way, included exactly once as required by the cmake design).
2026-06-11 08:58:36 -04:00
Jameson Nash
b7da956501
[docs] update CI to use latest release of doxygen (#202420)
Resubmitting https://github.com/llvm/llvm-project/pull/191501 for
review, with added https://github.com/llvm/llvm-project/pull/202404 for
SHA checksum verification and fix for cmake target name conflicts.
Tested with `./llvm/utils/release/build-docs.sh -no-sphinx` locally.

Co-authored-by: Aiden Grossman <aidengrossman@google.com>
2026-06-10 10:25:33 -04:00
Sairudra More
5adc7ddc15
[OpenMP] Ignore teams ICV setters in restricted contexts (#194428)
This patch prevents `omp_set_num_teams()` and
`omp_set_teams_thread_limit()` from updating teams-related ICVs when
called from restricted runtime contexts.

The non-implicit parallel-region case follows the OpenMP 5.1
restriction. The active `teams`-region case is handled defensively
because these ICVs are device-scoped and updating them during an active
`teams` region can affect later teams execution.

The calls now warn and return without updating the ICVs. 

Fixes #194426.
2026-06-09 11:31:17 -05:00
Jameson Nash
50088e2275
Revert "[docs] update CI to use latest release of doxygen" (#202412)
Reverts llvm/llvm-project#191501 as cmake CI is having an issue with it:

```
-- Doxygen enabled (1.14.0).
CMake Error at /work/as-worker-4/publish-doxygen-docs/llvm-project/cmake/Modules/HandleDoxygen.cmake:29 (add_custom_target):
  add_custom_target cannot create target "doxygen" because another target
  with the same name already exists.  The existing target is a custom target
  created in source directory
  "/work/as-worker-4/publish-doxygen-docs/llvm-project/llvm".  See
  documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  docs/CMakeLists.txt:59 (include)
```
2026-06-08 15:28:03 -04:00
Jameson Nash
2eed192c21
[docs] update CI to use latest release of doxygen (#191501)
Previously this was likely 1.9.8, with the Ubuntu 24.04 worker. Now this
is 1.17.0. This is a fix for
https://discourse.llvm.org/t/many-doxygen-links-are-broken/83809/2.

Fixes 3 significant issues for LLVM:

- `dot` execution performance is very slow (cuts this half hour step
down to mere seconds). https://github.com/doxygen/doxygen/pull/12037
- multi-thread performance is very slow (worse than single threading),
and now uses all cores for ncpu times speedup (when using version with
fix, autodetected by cmake).
https://github.com/doxygen/doxygen/pull/12027
- file links for IR.cpp and similar files were wrong
https://github.com/doxygen/doxygen/pull/11944

Assisted-by: Claude Code
2026-06-08 13:17:05 -04:00
Joseph Huber
5b6236c376
[Runtimes] Drop 'flang' from runtimes configure dependency (#198205)
Summary:
This PR cuts `flang` out of the core runtimes configure dependency. We
will need the runtimes infrastructure to handle `flang` module
generation, but this dependency poisons the entire dependency stack.
`flang` and `mlir` are by far the heavily parts of the LLVM stack and
for distribution we want to only build it when absolutely necessary,
which as of now is only to install flang module files.

The approach here is to simply remove the `flang` target from the core
dependency tree, but intead configure it for the top-level `module`
targets which are part of `all`. To make this work we need to pass
COMPILER_WORKS and set up a dummy location so that configuration passes.
it's a little backdoor, but this is an extremely important quality of
life improvement for LLVM distribution support.
2026-06-08 08:47:04 -05:00
Paul Osmialowski
81e51e0aaf
[openmp][omptest] Include cstdlib for malloc() (#202021)
This is to address the error appearing when building this code with
somewhat more recent compilers:

```
Use of undeclared identifier 'malloc'
```

Such inclusion has already been added to the OmptTester.cpp file.
2026-06-06 10:46:45 +01:00
Joseph Huber
aa8e38f4f8
[OpenMP] FIx omp_lib.mod compilation for the GPU (#201377) 2026-06-03 10:00:30 -05:00
Michael Kruse
911eddeed7
[Flang] Fix omp_lib.h location and search path (#201104)
Before this PR, omp_lib.h is emitted to `${PREFIX}/include` or
`${PREFIX}/lib/clang/<version>/include` (install prefix) and
`${PREFIX}/runtime/src/omp_lib.h` (builddir prefix). It is never found
there because the driver only adds `${PREFIX}/include/flang/OpenMP` to
the include path.

Fix the `omp_lib.h` include by using the same mechanism as the
omp_lib.mod; that is, move it to
`${PREFIX}/lib/clang/<version>/finclude/flang/<target-triple>`. The
search path is already added by the driver via
`-fintrinsics-modules-path` by the driver. Although omp_lib.h currently
does not contain anything target-specific, it could do so in the future
and I don't think it is worth the effort to add a mechanism without the
target triple. It should also me consistent with omp_lib.mod.

The changes in detail consist of:
1. Move the omp_lib.h output in the builddir to
`${RUNTIMES_OUTPUT_RESOURCE_MOD_DIR}`. This already takes care of
whether it is a bootstrapping build or not.
3. Move the omp_lib.h install dir to
`${RUNTIMES_INSTALL_RESOURCE_MOD_PATH}`.
4. Remove the implicit search path `include/flang/OpenMP` from the
frontend. There is nothing in there anyway.
5. Hardcoding the include search path for testing to the
`LLVM_RUNTIME_TARGETS=default` build becomes unnecessary. This was way
the `include-omp-header.f90` test was still passing, although it would
not work outside the regression tests. Essentially, it tested
lit.site.cfg, not the driver.
6. Replace the old `include-omp-header.f90` test. It created a temporary
`omp_lib.h` that interferes with any other test that use `include
omp_lib.h` (there currently isn't but I originally intended to add the
replacement as an additional omp_lib.h test which resulted in a flaky
test while the original test was there). Due to how the %flang(_fc1)
substitution works, lookup order may also vary.
2026-06-03 15:26:50 +02:00
Reid Kleckner
798d0f5ee8
[docs] Rename SphinxQuickstartTemplate.{rst|md} for blame (#198899)
Renames SphinxQuickstartTemplate.rst to SphinxQuickstartTemplate.md as
an isolated commit to preserve blame history. The file content is not
yet valid Markdown; the rewrite follows in a stacked PR.
Cross-references in MarkdownQuickstartTemplate.md, README.txt, and
openmp/docs/README.txt are updated accordingly.

See RFC:
https://discourse.llvm.org/t/rfc-make-myst-markdown-the-llvm-docs-format-rip-rest/90840
2026-06-02 14:01:42 -07:00
Jan Patrick Lehr
afd040cb46
[OpenMP][OMPT] Remove unused var in archer (#201140)
Working on enabling the build of OpenMP and Offload in pre-merge checks
surfaced this unused var and pre-merge checks run with -Werror.

As I did not see where it should be used, remove the variable to address
the warning.

The pre-merge running into the warning as error is
https://github.com/llvm/llvm-project/actions/runs/26826349862/job/79094823845?pr=174955
2026-06-02 15:02:06 +00:00
Michael Kruse
bafde6fbb8
[Flang] Move builtin .mod generation into runtimes (Reapply #137828) (#171515)
Reapplication of #137828 and #169638

Move building the .mod files from openmp/flang to openmp/flang-rt using
a shared mechanism. Motivations to do so are:

1. Most modules are target-dependent and need to be re-compiled for each
target separately, which is something the LLVM_ENABLE_RUNTIMES system
already does. Prime example is `iso_c_binding.mod` which encodes the
target's ABI. Constants such as `c_long_double` also have different
values).
Most other modules have `#ifdef`-enclosed code as well. For instance
this caused offload targets nvptx64-nvidia-cuda/amdgpu-amd-amdhsa to use
the modules files compiled for the host which may contrain uses of the
types REAL(10) or REAL(16) not available for nvptx/amdgpu.

2. CMake has support for Fortran that we should use. Among other things,
it automatically determines module dependencies so there is no need to
hardcode them in the CMakeLists.txt.

Currently the dependencies between builtin modules and `omp_lib.mod`
seem to be incorrect:
https://github.com/llvm/llvm-project/pull/174474#issuecomment-3880189581

3. It allows using Fortran itself to implement Flang-RT. Currently, only
`iso_fortran_env_impl.f90` emits object files that are needed by Fortran
applications (#89403). The workaround of #95388 could be reverted (PR
#169525).


If using Flang for cross-compilation or target-offloading, flang-rt must
now be compiled for each target not only for the library, but also to
get the target-specific module files. For instance in a bootstrapping
runtime build, this can be done by adding:
`-DLLVM_RUNTIME_TARGETS=default;nvptx64-nvidia-cuda;amdgpu-amd-amdhsa`.


Some new dependencies come into play:
* openmp depends on flang-rt for building `lib_omp.mod` and
`lib_omp_kinds.mod`. Currently, if flang-rt is not found then the
modules are not built.
* check-flang depends on flang-rt: If not found, the majority of tests
are disabled. If not building in a bootstrpping build, the location of
the module files can be pointed to using
`-DFLANG_INTRINSIC_MODULES_DIR=<path>`, e.g. in a flang-standalone
build. Alternatively, the test needing any of the intrinsic modules
could be marked with `REQUIRES: flangrt-modules`.
* check-flang depends on openmp: Not a change; tests requiring
`lib_omp.mod` and `lib_omp_kinds.mod` those are already marked with
`openmp_runtime`.

As intrinsic are now specific to the target, their location is moved
from `include/flang` to `<resource-dir>/finclude/flang/<triple>`. The
mechnism to compute the location have been moved from flang-rt
(previously used to compute the location of `libflang_rt.*.a`) to common
locations in `cmake/GetToolchainDirs.cmake` and
`runtimes/CMakeLists.txt` so they can be used by both, openmp and
flang-rt. Potentially the mechnism could also be shared by other
libraries such as compiler-rt.

`finclude` was chosen because `gfortran` uses it as well and avoids
misuse such as `#include <flang/iso_c_binding.mod>`. The search location
is now determined by `ToolChain` in the driver, instead of by the
frontend. Another subdirectory `flang` avoids accidental inclusion of
gfortran-modules which due to compression would result in
user-unfriendly errors. Now the driver adds `-fintrinsic-module-path`
for that location to the frontend call (Just like gfortran does).
Since the driver determines the location,
tests invoking `flang -fc1` and `bbc` must also be passed the location
by llvm-lit. This works like llvm-lit does for finding the include dirs
for Clang using `-print-file-name=...`.
2026-05-29 10:50:52 +02:00
Joseph Huber
13da33e922
[libc] Demote compiler check error to a warning (#198033)
Summary:
This check exists to encode the policy that this is only intended to be
built with a just-built compiler. In practice it's a little too strict
and breaks pretty much every six months when the version bumps or when
people try to build a separate patch. Just demote to a warning.
2026-05-18 10:08:44 -05:00
Joseph Huber
499d0bb35f
[Offload] Add a proper install-offload target (#198206)
Summary:
This target is missing, it's the expected behavior for all LLVM
components to have a way to install them individually as components.
This allows us to selectively install offload versus other pieces of the
runtime. Also make this and the openmp handling canonical with libcxx.
2026-05-18 08:26:00 -05:00
Joseph Huber
eec28baa5f
[OpenMP] Fix missing install-openmp component (#197603)
Summary:
This pattern is consistent throughout all the runtimes and is what the
top-level `install-openmp-<triple>` corresponds to. It should be
provided and used.
2026-05-15 07:37:18 -05:00
Robert Imschweiler
f59aca9103
[OpenMP][offload] Inline target reductions (#196061)
Significantly reduces register usage and removes register spilling in
`offload/test/offloading/multiple-reductions.cpp`, for example. Provides
speedup of up to 5-10x for a lot of reductions in such a larger setup.

Based on https://github.com/llvm/llvm-project/pull/195940.
See also the discussion in
https://github.com/llvm/llvm-project/pull/195102.
2026-05-13 09:26:48 +02:00
Jan Patrick Lehr
27c5421df2
[OpenMP] Fix set-but-unused-var warning in omptest (#196069)
This fixes a warning in omptest about a set but unused variable. The var
was intended to control whether colored logging output is created.
That logic has been moved into the `Logger` itself.
2026-05-08 13:49:27 +02:00
Joseph Huber
1232bc0162
[OpenMP] Fix incorrect use of align instead of round (#196191) 2026-05-06 16:51:14 -05:00
Joseph Huber
4bae755a3f
[OpenMP][NFC] Simplify rounding operations (#196155)
Summary:
There were a lot of these cases that did rounding up / down. Make
helpers for them and simplify.
2026-05-06 15:37:43 -05:00
Daniel Chen
dd145eb899
[openmp][flang] To add a cmake option to build OPENMP Fortran modules only without building the libomp lib (#195576)
PR #192687 Introduces a dependency to the Fortran intrinsic module when
building `openmp` Fortran modules, which requires a Flang enabled llvm
build in order to build `openmp` Fortran modules.

This PR is to add a cmake option `LIBOMP_FORTRAN_MODULES_ONLY` to allow
users to build 'openmp` Fortran modules only for Flang without building
the libomp runtime library.
This will allow libomp.a/so build still be independent from the Flang
build as before.

E.g. To build `openmp` Fortran modules only for Flang, one would need to
use the following options.
```
cmake \
...
  -DLIBOMP_FORTRAN_MODULES_ONLY=ON \
  -DLLVM_ENABLE_PROJECTS="flang" \
  -DLLVM_ENABLE_RUNTIMES="openmp" \
  ...
2026-05-06 11:58:00 -04:00
Jan André Reuter
8be29edc20
[OpenMP][OMPT] Update tools header for OpenMP v6.0 (#195829)
Add new enum values, structs and variables to `omp-tools.h` header,
according to the OpenMP v6.0 specification.
Update `openmp` and `offload` tools headers to recognize the new values
to ease testing once those features are implemented.

Since no feature is implemented here, update the docs to mention
`partial` support, pointing to this PR for the enums.

---------

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
2026-05-05 14:03:58 +00:00
Jan Patrick Lehr
6d8d7d00a6
[OpenMP] Add target to build OpenMP runtime (#189557)
This adds a top-level target to build the OpenMP runtime, similar to
what was done in https://github.com/llvm/llvm-project/pull/186099 for
the Offload runtime.

Having this top-level target enables us to execute the build in the
pre-commit CI as shown in
https://github.com/llvm/llvm-project/pull/174955 (I actually just
cherry-picked the commit from that branch)
2026-05-05 11:40:06 +02:00
Xing Xue
f56e695272
[libomp] Set arch string for PPC (#195129)
Add the missing arch string for PPC.
2026-04-30 16:30:30 -04:00
Joseph Huber
105bd6b654
[Offload] Clean up and split Shared/Utils.h (#194876)
Summary:
This is used in the GPU portion of the build, but really shouldn't be.
Most of these helpers were only used by the GPU portion, which has much
nicer builtins available in new clang. Using these in the main offload
build is broken on Windows and not available on older compilers, so we
split. Also means one less header we share.

The alignment helpers are trivially replaced by an LLVM utility, the
only thing that remains are the pointer arithmetic functions. There's no
conveient place to put these so I just let them stay.
2026-04-29 13:10:38 -05:00
Jan André Reuter
0a4798ad4b
[OMPT][OpenMP] Use omp_initial_device for host in callbacks (#192924)
The OpenMP specification offers different ways for identifying the host
device. While users of the OpenMP API can use `omp_get_initial_device()`
or the constant `omp_initial_device` (available since OpenMP v5.2), a
tool needs to rely on the `initial_device_num` passed by the OpenMP
runtime during the `initialize` callback.

In #134451, it was discovered that the `initial_device_num` passed is
always `0`, regardless of any device are available for offload
execution. For host-only OpenMP code, this matches the result of
`omp_get_num_devices()`, and is a valid result. In the case of devices
being available though, this passed identifier is incorrect. While
`libomp` calls `omp_get_num_devices()`, `libomptarget` has not fully
initialized its PluginManager at that point, hence returning no
available devices. Tools relying on `initial_device_num` might therefore
incorrectly assume host-side execution when some code runs on a device.
Since the `ompt_get_num_devices()` entry point is also not fully
implemented, tools currently need to do on-the-fly handling for the host
device.

To make handling easier, consistently use the `omp_initial_device`
identifier as the `initial_device_num` and for all device callbacks.
This does not rely on knowing the number of available devices during
OMPT initialization in the runtime and ensures a consistent value for
tools to handle.

Closes #134451

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
2026-04-29 12:06:41 +02:00
Mark Zhuang
ab43ab6158
[OpenMP] Fix use of uninitialized Dl_info when dladdr fails in ompd_init (#193643)
When dladdr() fails, dl_info is left uninitialized. The code printed the
error but then fell through to unconditionally call
strrchr(dl_info.dli_fname, '/'), accessing an uninitialized pointer --
typically NULL on the stack -- causing a SIGSEGV.

Fix by turning the second 'if' into 'else if', so the path-extraction
block is only reached when dladdr() succeeded and dl_info is valid.

Assisted-by: Claude Sonnet 4.6
2026-04-29 05:05:33 +08:00
Amit Tiwari
3c14034c55
[Flang][OpenMP] Validate omp_initial_device omp_invalid_device as device IDs (#193669)
As per OpenMP 5.2/6.0 the below are valid device values in a `#pragma
omp target` directive:

omp_initial_device (-1) -> refers to the host CPU.
omp_invalid_device (-2) -> an intentionally invalid device, used to
trigger a runtime error.

For the 2 values discussed above flang fails with:

```
error: The device expression of the DEVICE clause must be a positive integer expression
      !$OMP TARGET DEVICE(-1)
error: Must have INTEGER type, but is REAL(4)
      !$OMP TARGET DEVICE(OMP_INVALID_DEVICE)

```
Issue: https://github.com/llvm/llvm-project/issues/192989
2026-04-28 21:31:04 +05:30
Julian Brown
cced408278
[OpenMP] Rename ompx_taskgraph->omp_taskgraph_experimental
This patch renames the option to enable taskgraph support in the
runtime from OMPX_TASKGRAPH to OMP_TASKGRAPH_EXPERIMENTAL, to reflect
the feature's official status in OpenMP 6.0, but also the feature's
current work-in-progress nature.

commit-id:fa62775a

Reviewers: ro-i

Reviewed By: ro-i

Pull Request: https://github.com/llvm/llvm-project/pull/194045
2026-04-28 10:38:09 +01:00
Amit Tiwari
09cd294482
[Clang][OpenMP] Validate omp_initial_device omp_invalid_device as device IDs (#193688)
The counterpart fix for clang (as too done here:
[flang-fix](https://github.com/llvm/llvm-project/pull/193669))

The incorrectly interpreted device values in the `target` directive
throws:
 
```
 error: argument to 'device' clause must be a non-negative integer value
    #pragma omp target device(-1)
                              ^~
error: argument to 'device' clause must be a non-negative integer value
    #pragma omp target device(omp_invalid_device)
                              ^~~~~~~~~~~~~~~~~~
```
2026-04-28 14:28:37 +05:30
Julian Brown
295a7a9f75
[OpenMP] Make loop index unsigned in __kmpc_omp_task_with_deps/__kmp_omp_task
NFC.

Co-authored-by: Adrian Munera <adrian.munera@bsc.es>

Reviewers: ro-i

Pull Request: https://github.com/llvm/llvm-project/pull/194044
2026-04-27 10:34:35 +01:00
nvptm
8b96c2104e
[flang] Add comparison operators for c_devptr (#192687) 2026-04-23 15:13:34 -07:00
Kevin Sala Penades
3baafed3e7
[NFC][offload][OpenMP] Fix kernel replay documentation (#193832) 2026-04-23 13:13:12 -07:00
Kevin Sala Penades
254fcbefac
[offload][OpenMP] Add basic documentation for kernel record replay (#193699) 2026-04-23 09:44:06 -07:00
Kevin Sala Penades
df77a29237
[offload] Fix envar description in docs (#193642) 2026-04-23 09:42:34 -07:00
Joseph Huber
58127f3ebf
[OpenMP] Fix OpenMP device subdir installation w/ multilibs (#193378)
Summary:
These did not use the correct subdir so if you did a mulitilib build of
the OpenMP runtime it would simply overwrite it.
2026-04-22 07:46:12 -05:00
Nick Sarnie
5aea02a163
[OpenMP][Device] Fix __llvm_omp_indirect_call_lookup function pointer types (#192502)
`__llvm_omp_indirect_call_lookup` takes in and returns a function
pointer, so make sure the types are correct, which includes the correct
address space.

The FE was recently changed to generate the correct code
[here](https://github.com/llvm/llvm-project/pull/192470).

With this change, three function pointer tests start passing.

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2026-04-16 18:51:52 +00:00
Kevin Sala Penades
18bed37e5d
[offload][OpenMP] Require CUDA 11.8 (#191100) 2026-04-15 17:01:51 -07:00
Alexandre Ganea
40690e55a8
[openmp] Fix Darwin after 988e00e (#192135)
As per
https://github.com/llvm/llvm-project/pull/191556#issuecomment-4246459320
2026-04-15 07:15:14 -04:00
Wenju He
9b8611b1c5
[OpenMP] Create check-openmp target for device targets (#192175)
offload/cmake/caches/AMDGPUBot.cmake enables
RUNTIMES_amdgcn-amd-amdhsa_LLVM_ENABLE_RUNTIMES="openmp". In that
sub-build, check-openmp target doesn't exist and there is build error
`unknown target 'check-openmp'` after 18f63d1375, which makes
top-level check-openmp depend on check-openmp-amdgcn-amd-amdhsa.

In openmp, the device targets only call add_subdirectory(device), which
doesn't calls construct_check_openmp_target() and check-openmp target
doesn't exist. `ninja check-openmp-amdgcn-amd-amdhsa` also fails with
the same error before 18f63d1375.

Fix by adding construct_check_openmp_target() for device targets as well.

Assisted-by: Claude Sonnet 4.6
2026-04-15 10:42:28 +08:00
Jan André Reuter
1737a913ed
[OpenMP][OMPT] Revert control_tool.c changes from #191429 (#192069)
On s390x, the changes to `control_tool.c` cause a different return
address to be returned from the call to `print_current_address(0)`. Due
to the strictness of the current address returned by this call, this
lead to a test failure.

Since the return values of `omp_control_tool` are checked in separate
tests already, revert the changes to ensure that the return address
stays at the expected value.

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
2026-04-14 16:54:57 +02:00
Ye Luo
aab5c1075a
[Offload] Revert part of #187138. Workaround #191910 (#191925)
Closes #191910

---------

Co-authored-by: Joseph Huber <huberjn@outlook.com>
2026-04-14 02:39:32 +00:00
Alexandre Ganea
988e00ebcd
[openmp] Silence warnings when building on Windows (#191556)
Fixes unused-but-set globals on non-Unix paths in kmp_alloc.cpp
2026-04-13 07:11:35 -04:00
Amit Tiwari
1d18740d30
[Clang][OpenMP] Implement Loop splitting #pragma omp split directive (#190397)
Implement Loop-splitting #pragma omp split construct with counts clause.
Posting this PR after the revert of PR
([#183261](https://github.com/llvm/llvm-project/pull/183261))

Changes: 

1. Added `openmp/runtime/test/transform/split/lit.local.cfg`
2. Enforced ICE for `counts` clause items in `SemaOpenMP.cpp` (minor
change)
3. Updated tests `split_messages.cpp`, `split_omp_fill.cpp`,
`split_diag_errors.c`.
4. Removed `nonconstant_count.cpp`
2026-04-13 12:39:40 +05:30
Robert Imschweiler
54d4bf2acb
[OpenMP] Fix nondependent inscan variables in templated functions (#191627)
Fixes https://github.com/llvm/llvm-project/issues/191549.

Assisted-by: claude-4.6-opus
2026-04-11 15:17:42 +02:00
Jan André Reuter
c6bcd19425
[OpenMP][OMPT] Fix omp_control_tool before any directive (#191429)
When a user calls `omp_control_tool`, a tool is attached and it
registered the `ompt_control_tool` callback, the tool should receive a
callback with the users arguments.

However, in #112924, it was discovered that this only happens after at
least one host side directive or runtime call calling into
`__kmp_do_middle_initialize` has been executed.

The check for `__kmp_init_middle` in `FTN_CONTROL_TOOL` did not try to
do the middle initialization and instead always returned `-2` (no tool).
A tool therefore received no callback. The user program did not get the
info that there is a tool attached. To fix this, change the explicit
return to a call of `__kmp_middle_initialize()`, as done in several
other places of `libomp`.

Further handling is then done in `__kmp_control_tool`, where the values
`-2` (no tool), `-1` (no callback), or the tools return value are
returned.

Also expand the tests to introduce checks where no callaback is
registered, or `omp_control_tool` is called before any OpenMP directive.

Fixes #112924

CC @jprotze, @hansangbae

Signed-off-by: Jan André Reuter <j.reuter@fz-juelich.de>
2026-04-10 17:07:07 +02:00
theRonShark
00aede8f19
Revert "[Clang][OpenMP] Implement Loop splitting #pragma omp split directive " (#190335)
Reverts llvm/llvm-project#183261

15 new lit tests failing in openmp
2026-04-03 12:27:07 +00:00
Amit Tiwari
1972cf64fd
[Clang][OpenMP] Implement Loop splitting #pragma omp split directive (#183261)
OpenMP 6.0 Loop-splitting directive `#pragma omp split` construct with `counts`
clause
2026-04-03 10:42:31 +05:30
Michael Kruse
afb80bddf1
[Runtimes] Introduce variables containing resource dir paths (#177953)
Introduce common infrastructure for runtimes that determines compiler
resource path locations. These variables introduced are:

 * RUNTIMES_OUTPUT_RESOURCE_DIR
 * RUNTIMES_INSTALL_RESOURCE_PATH
 
That contain the location for the compiler resource path (typically
`lib/clang/<version>`) in the build tree and the install tree (the
latter relative to CMAKE_INSTALL_PREFIX).

Additionally, define

 * RUNTIMES_OUTPUT_RESOURCE_LIB_DIR
 * RUNTIMES_INSTALL_RESOURCE_LIB_PATH

as for the location of clang/flang version-locked libraries (typically
`lib${LLVM_LIBDIR_SUFFIX}/<targer-triple>`, but also depends on `APPLE`
and `LLVM_ENABLE_PER_TARGET_RUNTIME_DIR`). This code is moved from
flang-rt and initially becomes its only user.

Refactored out of #171610 as requested
[here](https://github.com/llvm/llvm-project/pull/171610#discussion_r2687382481).

Extracted `get_runtimes_target_libdir_common` from compiler-rt as
requested
[here](https://github.com/llvm/llvm-project/pull/171610#discussion_r2689565634).
 
Added TODO comments to all runtimes as requested
[here](https://github.com/llvm/llvm-project/pull/171610#issuecomment-3789598635).
2026-04-02 10:32:14 +00:00