[flang-commits] [flang] [Flang][OpenMP] Add OpenMP standards support doc (PR #132707)

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Mon Mar 24 05:37:07 PDT 2025


================
@@ -0,0 +1,62 @@
+<!--===- docs/FortranStandardsSupport.md
+
+   Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+   See https://llvm.org/LICENSE.txt for license information.
+   SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+-->
+
+# Flang OpenMP Standards Support
+
+```{contents}
+---
+local:
+---
+```
+
+This document summarizes OpenMP standards support in Flang. The information is only provided as a guideline. The
+TODOs/Not Yet Implemented messages emitted by the compiler for unimplemented features should be treated as authoritative.
+Standards support is provided upto OpenMP 4.0 for now. It will be extended later for OpenMP 4.5, OpenMP 5.* and OpenMP 6.0.
+
+The standards support information is provided as a table with three columns that are self explanatory. The Status column uses
+the letters **P**, **Y**, **N** for the implementation status:
+- **P** : When the implementation is incomplete for a few cases
+- **Y** : When the implementation is complete
+- **N** : When the implementation is absent
+
+Note : No distinction is made between the support in the Parser/Semantics, MLIR or Lowering support, and OpenMPIRBuilder support.
+
+## OpenMP 4.0
+
+| Feature                                                    | Status | Comments                                                |
+|------------------------------------------------------------|--------|---------------------------------------------------------|
+| proc_bind clause                                           | Y      | |
+| simd construct                                             | P      | Some clauses are not supported |
+| declare simd construct                                     | N      | |
+| do simd construct                                          | Y      | |
+| target data construct                                      | P      | |
+| target construct                                           | P      | |
+| target update construct                                    | P      | |
+| declare target directive                                   | P      | |
+| teams construct                                            | P      | |
+| distribute construct                                       | P      | |
+| distribute simd construct                                  | P      | |
+| distribute parallel loop construct                         | P      | |
+| distribute parallel loop simd construct                    | P      | |
+| depend clause                                              | P      | Depend clause with array sections are not supported |
+| declare reduction construct                                | N      | |
+| atomic construct extensions                                | Y      | |
----------------
kiranchandramohan wrote:

I tried an atomic read with `seq_cst` and did not hit a TODO but saw a flush emitted as expected. Could you elaborate on what is missing so that I can make in Partial with an explanation?

```
    !$omp atomic read seq_cst
       c = d
```

```
define void @_QQmain() #0 {
  %1 = alloca i32, i64 1, align 4
  %2 = alloca i32, i64 1, align 4
  %omp.atomic.read = load atomic i32, ptr %1 seq_cst, align 4
  call void @__kmpc_flush(ptr @1)
  store i32 %omp.atomic.read, ptr %2, align 4
  ret void
}
```

https://github.com/llvm/llvm-project/pull/132707


More information about the flang-commits mailing list