Skip to content

Conversation

kparzysz
Copy link
Contributor

Starting from OpenMP spec 5.1, the order clause is allowed on the distribute directive.

Starting from OpenMP spec 5.1, the `order` clause is allowed on the
`distribute` directive.
@llvmbot llvmbot added flang:openmp clang:openmp OpenMP related changes to Clang labels Apr 30, 2024
@llvmbot
Copy link
Member

llvmbot commented Apr 30, 2024

@llvm/pr-subscribers-flang-openmp

Author: Krzysztof Parzyszek (kparzysz)

Changes

Starting from OpenMP spec 5.1, the order clause is allowed on the distribute directive.


Full diff: https://github.com/llvm/llvm-project/pull/90689.diff

1 Files Affected:

  • (modified) llvm/include/llvm/Frontend/OpenMP/OMP.td (+2-1)
diff --git a/llvm/include/llvm/Frontend/OpenMP/OMP.td b/llvm/include/llvm/Frontend/OpenMP/OMP.td
index e91169e8da1aa5..9c9bfb4c59fc77 100644
--- a/llvm/include/llvm/Frontend/OpenMP/OMP.td
+++ b/llvm/include/llvm/Frontend/OpenMP/OMP.td
@@ -1173,7 +1173,8 @@ def OMP_Distribute : Directive<"distribute"> {
     VersionedClause<OMPC_Private>,
     VersionedClause<OMPC_FirstPrivate>,
     VersionedClause<OMPC_LastPrivate>,
-    VersionedClause<OMPC_Allocate>
+    VersionedClause<OMPC_Allocate>,
+    VersionedClause<OMPC_Order, 51>
   ];
   let allowedOnceClauses = [
     VersionedClause<OMPC_Collapse>,

@alexey-bataev
Copy link
Member

It requires testing and proper codegen

Copy link
Contributor

@kiranchandramohan kiranchandramohan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Flang this is only currently used for checking which clauses are allowed in which constructs. At the moment this will lead to an error. With this change it will pass. Adding a test might be good.

$ ./bin/flang-new -fopenmp nb.f90
error: Semantic errors in nb.f90
./nb.f90:10:20: error: ORDER clause is not allowed on the DISTRIBUTE directive
    !$omp distribute order(concurrent)

Please wait for @alexey-bataev for the Clang side.

@sandeepkosuri
Copy link
Contributor

I am working on codegen support of order clause modifiers and I would like this PR to be checked in. Any updates on this @kparzysz?

@kparzysz kparzysz closed this Jun 11, 2025
@kparzysz kparzysz deleted the users/kparzysz/distribute-order branch June 11, 2025 16:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang:openmp OpenMP related changes to Clang flang:openmp
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants