Flang OpenMP Support¶
This document outlines the OpenMP API features supported by Flang. It is intended as a general reference. For the most accurate information on unimplemented features, rely on the compiler’s TODO or “Not Yet Implemented” messages, which are considered authoritative. Flang provides complete implementation of the OpenMP 3.1 specification and partial implementation of OpenMP 4.0. The sections below summarize support status for OpenMP 4.0, 5.0, 5.1, 5.2, 6.0, and future 6.1. The table entries are derived from the information provided in the Version Differences subsection of the Features History section in the OpenMP standard.
The Status column uses the following values:
unclaimed : No implementation is known to be underway.
partial : Some support exists, but important cases are still missing.
in progress : Work is actively underway, or the implementation is available only experimentally.
done : The feature is considered implemented.
The OpenMP 4.0 section uses the historical Feature/Status/Comments format with
an added Claimed By column. OpenMP 5.0 and newer sections use
Feature/Status/Claimed By/Notes/Reviews to capture implementation state,
ownership, and upstream references. Use GitHub usernames in Claimed By (for
example @alice). Leave the cell blank when nobody has claimed the work.
This page is for OpenMP features that require changes in Flang compiler
components (parser, semantics, lowering, diagnostics) and that may additionally
entail corresponding runtime support. OpenMP features whose status does not
involve updates to the Flang compiler are tracked under the Clang OpenMP Support
page (clang/docs/OpenMPSupport.rst).
Updating This Page¶
When claiming a feature, set
Statusto in progress and add the GitHub username inClaimed By.When a GitHub PR is opened, add the PR link in
Reviews. Keep the claimant listed until the work is finished or unclaimed.When support lands but remains incomplete, set
Statusto partial and summarize the missing parser, semantics, lowering, diagnostics, or test work inNotes.When support is complete, set
Statusto done. ClearClaimed Byif no further follow-up is expected.When work is abandoned or not yet started, set
Statusto unclaimed, remove the claimant, and keepNotesfocused on the missing implementation work.
Note: In the OpenMP 4.0 section, no distinction is made between support in Parser/Semantics, MLIR, Lowering, or the OpenMPIRBuilder.
OpenMP 4.0¶
Feature |
Status |
Claimed By |
Comments |
|---|---|---|---|
proc_bind clause |
done |
||
simd construct |
partial |
Implicit linearization is skipped if iv is a pointer or allocatable |
|
declare simd construct |
partial |
Semantics coverage exists (for example |
|
do simd construct |
partial |
Implicit linearization is skipped if iv is a pointer or allocatable |
|
target data construct |
done |
||
target construct |
done |
||
target update construct |
done |
||
declare target directive |
done |
||
teams construct |
done |
||
distribute construct |
done |
||
distribute simd construct |
partial |
Implicit linearization is skipped if iv is a pointer or allocatable |
|
distribute parallel loop construct |
done |
||
distribute parallel loop simd construct |
partial |
Implicit linearization is skipped if iv is a pointer or allocatable |
|
depend clause |
done |
||
declare reduction construct |
partial |
Partial support, including user-defined reductions with derived types. |
|
atomic construct extensions |
done |
||
cancel construct |
done |
||
cancellation point construct |
done |
||
parallel do simd construct |
partial |
Implicit linearization is skipped if iv is a pointer or allocatable |
|
target teams construct |
done |
||
teams distribute construct |
done |
||
teams distribute simd construct |
partial |
Implicit linearization is skipped if iv is a pointer or allocatable |
|
target teams distribute construct |
done |
||
teams distribute parallel loop construct |
done |
||
target teams distribute parallel loop construct |
done |
||
teams distribute parallel loop simd construct |
partial |
Implicit linearization is skipped if iv is a pointer or allocatable |
|
target teams distribute parallel loop simd construct |
partial |
Implicit linearization is completely skipped |
OpenMP 5.0¶
Feature |
Status |
Claimed By |
Notes |
Reviews |
|---|---|---|---|---|
taskloop and combined taskloop forms |
partial |
Covered in semantics/lowering tests including |
llvm/llvm-project#138646, llvm/llvm-project#165851, llvm/llvm-project#187222 |
|
memory allocators |
partial |
Semantics coverage exists in |
||
allocate directive and allocate clause |
partial |
Semantics coverage exists in |
llvm/llvm-project#121356, llvm/llvm-project#165719, llvm/llvm-project#165865, llvm/llvm-project#187167 |
|
metadirective |
partial |
Semantics coverage exists in |
llvm/llvm-project#159945, llvm/llvm-project#193664, llvm/llvm-project#194402, llvm/llvm-project#194424 |
|
support full defaultmap functionality |
partial |
Core coverage exists ( |
llvm/llvm-project#135226, llvm/llvm-project#166715, llvm/llvm-project#167806, llvm/llvm-project#177389, llvm/llvm-project#190764 |
|
clause: uses_allocators |
partial |
Parsed/checked in semantics allocator tests, but lowering has explicit TODO handling ( |
||
clause: in_reduction |
partial |
Semantics and lowering coverage exists for several task/taskgroup/taskloop forms ( |
||
user-defined mappers |
done |
Supported with semantics/lowering/transform coverage. |
llvm/llvm-project#140560, llvm/llvm-project#163860, llvm/llvm-project#167903, llvm/llvm-project#179936, llvm/llvm-project#189136 |
|
map array-section with implicit mapper |
partial |
Mapper and map coverage exists ( |
||
clause: use_device_addr for target data |
done |
Supported for core forms. |
||
support non-contiguous array sections for target update |
partial |
Target update coverage exists ( |
||
pointer attachment |
partial |
Pointer mapping coverage exists ( |
||
hints for the atomic construct |
partial |
Semantics coverage exists ( |
||
conditional modifier for lastprivate clause |
unclaimed |
Lastprivate lowering/semantics coverage exists for base forms, but no dedicated support coverage for the conditional modifier was identified in current Flang tests. |
||
task affinity |
partial |
Semantics and lowering coverage exists, including iterator-based affinity in task constructs ( |
OpenMP 5.1¶
Feature |
Status |
Claimed By |
Notes |
Reviews |
|---|---|---|---|---|
compare clause on atomic construct |
partial |
Semantics and lowering coverage exist ( |
||
fail clause on atomic construct |
partial |
Semantics coverage exists ( |
||
interop construct |
partial |
Semantics coverage exists ( |
||
dispatch construct |
partial |
Semantics coverage exists ( |
||
masked construct |
partial |
Covered in semantics/lowering ( |
||
masked combined constructs |
partial |
Covered in lowering tests ( |
||
present map type modifier |
partial |
Semantics coverage exists ( |
||
present modifier in motion clauses |
partial |
Motion/update coverage exists ( |
||
present in defaultmap clause |
partial |
Defaultmap semantics coverage exists ( |
||
thread_limit clause on target construct |
partial |
Lowering/semantics coverage exists for thread-limit dimensions ( |
||
has_device_addr clause on target construct |
partial |
Semantics/lowering coverage exists ( |
||
iterators in map or motion clauses |
partial |
Some iterator coverage exists ( |
||
scope construct |
partial |
Scope construct support is available, with follow-on completeness work still in progress for some combinations (see also OpenMP 5.2 scope-related rows). |
||
assumes directives |
unclaimed |
Lowering still has explicit TODO ( |
||
assume directive |
unclaimed |
Lowering still has explicit TODO ( |
||
default(firstprivate) |
partial |
Semantics coverage exists ( |
||
default(private) |
partial |
Semantics/default-clause coverage exists ( |
||
inoutset in depend clause |
partial |
Semantics coverage exists ( |
||
nowait clause on taskwait |
partial |
Taskwait coverage exists ( |
||
strict modifier for taskloop construct |
unclaimed |
No dedicated parser/semantics/lowering coverage for the taskloop strict modifier was identified in current Flang OpenMP tests. |
OpenMP 5.2¶
Feature |
Status |
Claimed By |
Notes |
Reviews |
|---|---|---|---|---|
if clause on teams construct |
partial |
Semantics coverage exists for teams-specific |
||
step modifier |
unclaimed |
Add parser+semantics acceptance/diagnostics for OpenMP 5.2 step-modifier forms, then add lowering coverage showing emitted loop metadata/ops for accepted cases. |
||
declare mapper iterator modifier |
unclaimed |
Parser and semantics should accept iterator-modified DECLARE MAPPER forms, then lowering must thread iterator bounds through map info generation (see related TODO test |
||
otherwise clause on metadirectives |
unclaimed |
BEGIN/END METADIRECTIVE frontend support exists, but metadirective lowering remains TODO ( |
||
doacross with omp_cur_iteration |
unclaimed |
Implement parser/semantics validation for |
||
implicit map type for target enter and exit data |
unclaimed |
Define implicit-map behavior for enter/exit data in lowering map finalization and add dedicated tests covering pointer/allocatable/component cases and mapper interactions. |
||
allocate and firstprivate on scope directive |
partial |
Scope lowering coverage includes |
||
loop consistency changes for order clause |
unclaimed |
Extend semantic loop-consistency checks for updated ORDER rules and add diagnostics tests for invalid nest/ordering combinations. |
||
keep original base pointer on map without matched candidate |
unclaimed |
Update map finalization so unmatched candidates preserve original base-pointer mapping semantics; add lowering tests for pointer-member mapping regressions. |
||
pure procedure support for certain directives |
unclaimed |
Codify semantics restrictions for PURE procedures with these directives and add lowering tests ensuring no illegal side-effecting ops are introduced. |
||
ALLOCATE statement support for allocators |
unclaimed |
Wire OpenMP allocator semantics into Fortran ALLOCATE statement handling and add semantics+lowering tests for allocator traits and error paths. |
||
dispatch extension supporting end directive |
unclaimed |
Base dispatch support is partial, and no dedicated support coverage for the OpenMP 5.2 dispatch end-directive extension was identified. |
||
minus operator deprecation handling |
partial |
Partially handled in semantic diagnostics. |
||
linear clause syntax deprecation |
unclaimed |
Add semantic deprecation diagnostics with fix-it guidance and tests for accepted/deprecated spellings. |
||
map clause modifiers without commas (deprecation) |
unclaimed |
Add parser/semantics deprecation diagnostics for comma-less map modifiers and tests that verify warning text and accepted replacements. |
||
uses_allocators list syntax (deprecation) |
unclaimed |
Add diagnostics for deprecated uses_allocators list syntax and ensure lowering still handles canonical replacements. |
||
default clause on metadirectives (deprecation) |
unclaimed |
Add dedicated metadirective deprecation diagnostics and tests for legacy/default-clause usage. |
||
destroy clause syntax on depobj (deprecation) |
partial |
Deprecation diagnostics are implemented (for example warning coverage in |
||
source and sink task-dependence modifiers (deprecation) |
partial |
Deprecation diagnostics are implemented (for example warning coverage in |
||
interop type position on init clause (deprecation) |
unclaimed |
Add parser+semantics deprecation diagnostics for legacy interop init type-position forms and tests showing canonical replacement. |
OpenMP 6.0¶
Feature |
Status |
Claimed By |
Notes |
Reviews |
|---|---|---|---|---|
threadset clause |
partial |
Semantics coverage exists ( |
||
groupprivate directive |
partial |
Semantics and lowering coverage exists ( |
llvm/llvm-project#166199, llvm/llvm-project#166214, llvm/llvm-project#180934 |
|
recording of task graphs |
in progress |
Semantics coverage exists ( |
||
workdistribute construct |
partial |
Semantics/lowering/transform coverage exists ( |
llvm/llvm-project#154377, llvm/llvm-project#154378, llvm/llvm-project#140523, llvm/llvm-project#199006 |
|
map clause updates (v6.0 forms) |
partial |
Semantics coverage exists ( |
||
map modifier updates (v6.0 and v6.1 forms) |
partial |
Semantics coverage exists ( |
||
loop fusion transformation |
done |
Supported. |
||
loop construct with DO CONCURRENT |
in progress |
Experimental support is available and under active development. |
||
optional argument for all clauses |
partial |
Semantics coverage exists across clause tests (for example |
||
canonical loop sequences |
partial |
Related loop/transform coverage exists ( |
llvm/llvm-project#161213, llvm/llvm-project#168884, llvm/llvm-project#170734, llvm/llvm-project#170735 |
|
pure directives in DO CONCURRENT |
unclaimed |
Define exact PURE+DO CONCURRENT directive legality in semantics and add lowering tests proving accepted forms remain side-effect safe. |
||
extensions to depobj construct |
unclaimed |
Semantics and deprecation diagnostics exist for several depobj forms, but extension support remains incomplete in lowering (for example |
||
extensions to atomic construct |
partial |
Atomic compare lowering is now available ( |
||
clarifications to Fortran map semantics |
unclaimed |
Document each 6.0 clarification point against existing map finalization behavior, then add focused semantics/lowering regression tests for unresolved points. |
OpenMP 6.1 (Future / Experimental)¶
Feature |
Status |
Claimed By |
Notes |
Reviews |
|---|---|---|---|---|
dyn_groupprivate clause |
in progress |
Experimental and in progress ( |
||
dims strict behavior (multidimensional teams/leagues) |
in progress |
Experimental and in progress ( |
llvm/llvm-project#171454, llvm/llvm-project#171767, llvm/llvm-project#171825 |
|
attach map-type modifier |
partial |
Parser/semantics/lowering coverage exists ( |
llvm/llvm-project#177715, llvm/llvm-project#177301, llvm/llvm-project#177302 |
|
need_device_ptr modifier for adjust_args clause |
unclaimed |
Add parser+semantics support for modifier placement/rules, then lower adjust_args with device-pointer selection semantics and add end-to-end tests. |
||
fallback modifier for use_device_ptr clause |
unclaimed |
Add parser+semantics diagnostics and lowering behavior for fallback selection; add tests for fallback and non-fallback resolution paths. |
||
loop flatten transformation |
unclaimed |
Implement parser/semantics acceptance and lowering transform plumbing, then add transform/lowering tests demonstrating flattened loop mapping. |
||
loop grid and tile modifiers for sizes clause |
unclaimed |
Extend clause parsing/semantics for grid/tile size modifiers and add lowering tests showing generated loop partitioning metadata/ops. |
Extensions¶
ATOMIC construct¶
The implementation of the ATOMIC construct follows OpenMP 6.0 with the following extensions:
x = xis an allowed form of ATOMIC UPDATE. This is motivated by the fact that the equivalent formsx = x+0orx = x*1are allowed.Explicit type conversions are allowed in ATOMIC READ, WRITE or UPDATE constructs, and in the capture statement in ATOMIC UPDATE CAPTURE. The OpenMP spec requires intrinsic- or pointer-assignments, which include (as per the Fortran standard) implicit type conversions. Since such conversions need to be handled, allowing explicit conversions comes at no extra cost.
A literal
.true.or.false.is an allowed condition in ATOMIC UPDATE COMPARE. [1]A logical variable is an allowed form of the condition even if its value is not computed within the ATOMIC UPDATE COMPARE construct [1].
expr equalop xis an allowed condition in ATOMIC UPDATE COMPARE. [1]
[1] Code generation for ATOMIC UPDATE COMPARE is not implemented yet.