[llvm] ea63b39 - [flang][openacc] Remove single reduction clause limitation
Razvan Lupusoru via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 7 13:45:08 PDT 2023
Author: Razvan Lupusoru
Date: 2023-06-07T13:44:21-07:00
New Revision: ea63b395c0a75257224becd69c3d48ab4290c3b4
URL: https://github.com/llvm/llvm-project/commit/ea63b395c0a75257224becd69c3d48ab4290c3b4
DIFF: https://github.com/llvm/llvm-project/commit/ea63b395c0a75257224becd69c3d48ab4290c3b4.diff
LOG: [flang][openacc] Remove single reduction clause limitation
The constraint that a single reduction clause is allowed is actually
not valid as per OpenACC specification. Multiple reduction clauses
are allowed, especially since reduction clauses can have different
reduction operators.
Reviewed By: vzakhari
Differential Revision: https://reviews.llvm.org/D152389
Added:
Modified:
llvm/include/llvm/Frontend/OpenACC/ACC.td
Removed:
################################################################################
diff --git a/llvm/include/llvm/Frontend/OpenACC/ACC.td b/llvm/include/llvm/Frontend/OpenACC/ACC.td
index e5f0632f59f50..b9e468af667ad 100644
--- a/llvm/include/llvm/Frontend/OpenACC/ACC.td
+++ b/llvm/include/llvm/Frontend/OpenACC/ACC.td
@@ -338,6 +338,7 @@ def ACC_Parallel : Directive<"parallel"> {
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
VersionedClause<ACCC_FirstPrivate>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Wait>
];
let allowedOnceClauses = [
@@ -346,7 +347,6 @@ def ACC_Parallel : Directive<"parallel"> {
VersionedClause<ACCC_If>,
VersionedClause<ACCC_NumGangs>,
VersionedClause<ACCC_NumWorkers>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>,
VersionedClause<ACCC_VectorLength>
];
@@ -368,13 +368,13 @@ def ACC_Serial : Directive<"serial"> {
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
VersionedClause<ACCC_FirstPrivate>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Wait>
];
let allowedOnceClauses = [
VersionedClause<ACCC_Async>,
VersionedClause<ACCC_Default>,
VersionedClause<ACCC_If>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>
];
}
@@ -383,12 +383,12 @@ def ACC_Serial : Directive<"serial"> {
def ACC_Loop : Directive<"loop"> {
let allowedClauses = [
VersionedClause<ACCC_DeviceType>,
- VersionedClause<ACCC_Private>
+ VersionedClause<ACCC_Private>,
+ VersionedClause<ACCC_Reduction>
];
let allowedOnceClauses = [
VersionedClause<ACCC_Collapse>,
VersionedClause<ACCC_Gang>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Tile>,
VersionedClause<ACCC_Vector>,
VersionedClause<ACCC_Worker>
@@ -535,6 +535,7 @@ def ACC_KernelsLoop : Directive<"kernels loop"> {
VersionedClause<ACCC_NoCreate>,
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_DevicePtr>,
VersionedClause<ACCC_Attach>,
VersionedClause<ACCC_Wait>
@@ -547,7 +548,6 @@ def ACC_KernelsLoop : Directive<"kernels loop"> {
VersionedClause<ACCC_If>,
VersionedClause<ACCC_NumGangs>,
VersionedClause<ACCC_NumWorkers>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>,
VersionedClause<ACCC_Tile>,
VersionedClause<ACCC_Vector>,
@@ -575,6 +575,7 @@ def ACC_ParallelLoop : Directive<"parallel loop"> {
VersionedClause<ACCC_NoCreate>,
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Tile>,
VersionedClause<ACCC_Wait>
];
@@ -586,7 +587,6 @@ def ACC_ParallelLoop : Directive<"parallel loop"> {
VersionedClause<ACCC_If>,
VersionedClause<ACCC_NumGangs>,
VersionedClause<ACCC_NumWorkers>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>,
VersionedClause<ACCC_Vector>,
VersionedClause<ACCC_VectorLength>,
@@ -613,6 +613,7 @@ def ACC_SerialLoop : Directive<"serial loop"> {
VersionedClause<ACCC_NoCreate>,
VersionedClause<ACCC_Present>,
VersionedClause<ACCC_Private>,
+ VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Wait>
];
let allowedOnceClauses = [
@@ -621,7 +622,6 @@ def ACC_SerialLoop : Directive<"serial loop"> {
VersionedClause<ACCC_Default>,
VersionedClause<ACCC_Gang>,
VersionedClause<ACCC_If>,
- VersionedClause<ACCC_Reduction>,
VersionedClause<ACCC_Self>,
VersionedClause<ACCC_Tile>,
VersionedClause<ACCC_Vector>,
More information about the llvm-commits
mailing list