[flang-commits] [flang] 0d6017c - [openacc][NFC] Bump parser support number to OpenACC 3.3
Valentin Clement via flang-commits
flang-commits at lists.llvm.org
Fri Jun 30 12:56:34 PDT 2023
Author: Valentin Clement
Date: 2023-06-30T12:56:29-07:00
New Revision: 0d6017cd6227a2ce21e0d174786b9c9c49c39a14
URL: https://github.com/llvm/llvm-project/commit/0d6017cd6227a2ce21e0d174786b9c9c49c39a14
DIFF: https://github.com/llvm/llvm-project/commit/0d6017cd6227a2ce21e0d174786b9c9c49c39a14.diff
LOG: [openacc][NFC] Bump parser support number to OpenACC 3.3
Parser support reached OpenACC 3.3 specification.
Bump the numbers to reflect the latest specs.
Reviewed By: razvanlupusoru, awarzynski
Differential Revision: https://reviews.llvm.org/D154249
Added:
Modified:
flang/include/flang/Parser/parse-tree.h
flang/lib/Frontend/CompilerInvocation.cpp
flang/lib/Parser/openacc-parsers.cpp
flang/lib/Semantics/check-acc-structure.h
flang/tools/bbc/bbc.cpp
llvm/include/llvm/Frontend/OpenACC/ACC.td
mlir/include/mlir/Dialect/OpenACC/OpenACC.h
mlir/include/mlir/Dialect/OpenACC/OpenACCBase.td
Removed:
################################################################################
diff --git a/flang/include/flang/Parser/parse-tree.h b/flang/include/flang/Parser/parse-tree.h
index 404058962c944..73956338a31fe 100644
--- a/flang/include/flang/Parser/parse-tree.h
+++ b/flang/include/flang/Parser/parse-tree.h
@@ -3978,7 +3978,7 @@ struct OpenMPConstruct {
u;
};
-// Parse tree nodes for OpenACC 3.1 directives and clauses
+// Parse tree nodes for OpenACC 3.3 directives and clauses
struct AccObject {
UNION_CLASS_BOILERPLATE(AccObject);
@@ -4037,7 +4037,7 @@ struct AccObjectListWithModifier {
std::tuple<std::optional<AccDataModifier>, AccObjectList> t;
};
-// 2.5.13: + | * | max | min | iand | ior | ieor | .and. | .or. | .eqv. | .neqv.
+// 2.5.15: + | * | max | min | iand | ior | ieor | .and. | .or. | .eqv. | .neqv.
struct AccReductionOperator {
ENUM_CLASS(
Operator, Plus, Multiply, Max, Min, Iand, Ior, Ieor, And, Or, Eqv, Neqv)
diff --git a/flang/lib/Frontend/CompilerInvocation.cpp b/flang/lib/Frontend/CompilerInvocation.cpp
index f8a075ce5f949..9f6edabeae2b3 100644
--- a/flang/lib/Frontend/CompilerInvocation.cpp
+++ b/flang/lib/Frontend/CompilerInvocation.cpp
@@ -1022,7 +1022,7 @@ void CompilerInvocation::setDefaultPredefinitions() {
// Add predefinitions based on extensions enabled
if (frontendOptions.features.IsEnabled(
Fortran::common::LanguageFeature::OpenACC)) {
- fortranOptions.predefinitions.emplace_back("_OPENACC", "202011");
+ fortranOptions.predefinitions.emplace_back("_OPENACC", "202211");
}
if (frontendOptions.features.IsEnabled(
Fortran::common::LanguageFeature::OpenMP)) {
diff --git a/flang/lib/Parser/openacc-parsers.cpp b/flang/lib/Parser/openacc-parsers.cpp
index 7423db6babbfd..dff95decad3f4 100644
--- a/flang/lib/Parser/openacc-parsers.cpp
+++ b/flang/lib/Parser/openacc-parsers.cpp
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
-// Top-level grammar specification for OpenACC 3.1.
+// Top-level grammar specification for OpenACC 3.3.
#include "basic-parsers.h"
#include "expr-parsers.h"
@@ -40,12 +40,12 @@ TYPE_PARSER(construct<AccObjectListWithModifier>(
TYPE_PARSER(construct<AccObjectListWithReduction>(
Parser<AccReductionOperator>{} / ":", Parser<AccObjectList>{}))
-// 2.16.3 (2485) wait-argument is:
+// 2.16 (3249) wait-argument is:
// [devnum : int-expr :] [queues :] int-expr-list
TYPE_PARSER(construct<AccWaitArgument>(maybe("DEVNUM:" >> scalarIntExpr / ":"),
"QUEUES:" >> nonemptyList(scalarIntExpr) || nonemptyList(scalarIntExpr)))
-// 2.9 (1609) size-expr is one of:
+// 2.9 (1984-1986) size-expr is one of:
// * (represented as an empty std::optional<ScalarIntExpr>)
// int-expr
TYPE_PARSER(construct<AccSizeExpr>(scalarIntExpr) ||
@@ -66,7 +66,7 @@ TYPE_PARSER(construct<AccTileExpr>(scalarIntConstantExpr) ||
"*" >> construct<std::optional<ScalarIntConstantExpr>>()))
TYPE_PARSER(construct<AccTileExprList>(nonemptyList(Parser<AccTileExpr>{})))
-// 2.9 gang-arg is one of :
+// 2.9 (1979-1982) gang-arg is one of :
// [num:]int-expr
// dim:int-expr
// static:size-expr
@@ -85,7 +85,7 @@ TYPE_PARSER(
TYPE_PARSER(construct<AccCollapseArg>(
"FORCE:"_tok >> pure(true) || pure(false), scalarIntConstantExpr))
-// 2.5.13 Reduction
+// 2.5.15 Reduction
// Operator for reduction
TYPE_PARSER(sourced(construct<AccReductionOperator>(
first("+" >> pure(AccReductionOperator::Operator::Plus),
@@ -104,7 +104,7 @@ TYPE_PARSER(sourced(construct<AccReductionOperator>(
TYPE_PARSER(sourced(construct<AccBindClause>(name)) ||
sourced(construct<AccBindClause>(scalarDefaultCharExpr)))
-// 2.5.14 Default clause
+// 2.5.16 Default clause
TYPE_PARSER(construct<AccDefaultClause>(
first("NONE" >> pure(llvm::acc::DefaultValue::ACC_Default_none),
"PRESENT" >> pure(llvm::acc::DefaultValue::ACC_Default_present))))
diff --git a/flang/lib/Semantics/check-acc-structure.h b/flang/lib/Semantics/check-acc-structure.h
index fda626e57ba63..42745a6ca69a1 100644
--- a/flang/lib/Semantics/check-acc-structure.h
+++ b/flang/lib/Semantics/check-acc-structure.h
@@ -4,7 +4,7 @@
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
-// OpenACC 3.1 structure validity check list
+// OpenACC 3.3 structure validity check list
// 1. invalid clauses on directive
// 2. invalid repeated clauses on directive
// 3. invalid nesting of regions
diff --git a/flang/tools/bbc/bbc.cpp b/flang/tools/bbc/bbc.cpp
index 6c17ab9ad3125..c1b3dab7ac7b9 100644
--- a/flang/tools/bbc/bbc.cpp
+++ b/flang/tools/bbc/bbc.cpp
@@ -398,7 +398,7 @@ int main(int argc, char **argv) {
// enable parsing of OpenACC
if (enableOpenACC) {
options.features.Enable(Fortran::common::LanguageFeature::OpenACC);
- options.predefinitions.emplace_back("_OPENACC", "202011");
+ options.predefinitions.emplace_back("_OPENACC", "202211");
}
Fortran::common::IntrinsicTypeDefaultKinds defaultKinds;
diff --git a/llvm/include/llvm/Frontend/OpenACC/ACC.td b/llvm/include/llvm/Frontend/OpenACC/ACC.td
index 54d9950263201..62b4113be6e27 100644
--- a/llvm/include/llvm/Frontend/OpenACC/ACC.td
+++ b/llvm/include/llvm/Frontend/OpenACC/ACC.td
@@ -6,7 +6,7 @@
//
//===----------------------------------------------------------------------===//
//
-// This is the definition file for OpenACC 3.1 directives and clauses.
+// This is the definition file for OpenACC 3.3 directives and clauses.
//
//===----------------------------------------------------------------------===//
@@ -64,6 +64,7 @@ def ACCC_Copy : Clause<"copy"> {
let flangClass = "AccObjectList";
let aliases = ["present_or_copy", "pcopy"];
}
+
// 2.7.7
def ACCC_Copyin : Clause<"copyin"> {
let flangClass = "AccObjectListWithModifier";
@@ -82,7 +83,7 @@ def ACCC_Create : Clause<"create"> {
let aliases = ["present_or_create", "pcreate"];
}
-// 2.5.15
+// 2.5.16
def ACC_Default_none : ClauseVal<"none", 1, 1> { let isDefault = 1; }
def ACC_Default_present : ClauseVal<"present", 0, 1> {}
@@ -140,7 +141,7 @@ def ACCC_DeviceType : Clause<"device_type"> {
// 2.6.6
def ACCC_Finalize : Clause<"finalize"> {}
-// 2.5.13
+// 2.5.14
def ACCC_FirstPrivate : Clause<"firstprivate"> {
let flangClass = "AccObjectList";
}
@@ -156,7 +157,7 @@ def ACCC_Host : Clause<"host"> {
let flangClass = "AccObjectList";
}
-// 2.5.5
+// 2.5.6
def ACCC_If : Clause <"if"> {
let flangClass = "ScalarLogicalExpr";
}
@@ -180,13 +181,13 @@ def ACCC_NoCreate : Clause<"no_create"> {
// 2.15.1
def ACCC_NoHost : Clause<"nohost"> {}
-// 2.5.9
+// 2.5.10
def ACCC_NumGangs : Clause<"num_gangs"> {
let flangClass = "ScalarIntExpr";
let isValueList = 1;
}
-// 2.5.10
+// 2.5.11
def ACCC_NumWorkers : Clause<"num_workers"> {
let flangClass = "ScalarIntExpr";
}
@@ -196,7 +197,7 @@ def ACCC_Present : Clause<"present"> {
let flangClass = "AccObjectList";
}
-// 2.5.12
+// 2.5.13
def ACCC_Private : Clause<"private"> {
let flangClass = "AccObjectList";
}
@@ -214,12 +215,12 @@ def ACCC_UseDevice : Clause <"use_device"> {
// 2.12
def ACCC_Read : Clause<"read"> {}
-// 2.5.14
+// 2.5.15
def ACCC_Reduction : Clause<"reduction"> {
let flangClass = "AccObjectListWithReduction";
}
-// 2.5.6
+// 2.5.7
def ACCC_Self : Clause<"self"> {
let flangClass = "AccSelfClause";
let isValueOptional = true;
@@ -235,7 +236,7 @@ def ACCC_Vector : Clause<"vector"> {
let prefix = "length";
}
-// 2.5.11
+// 2.5.12
def ACCC_VectorLength : Clause<"vector_length"> {
let flangClass = "ScalarIntExpr";
}
diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACC.h b/mlir/include/mlir/Dialect/OpenACC/OpenACC.h
index 5d76030dcc67e..fe7a407fe2c6f 100644
--- a/mlir/include/mlir/Dialect/OpenACC/OpenACC.h
+++ b/mlir/include/mlir/Dialect/OpenACC/OpenACC.h
@@ -38,7 +38,7 @@ namespace mlir {
namespace acc {
/// Enumeration used to encode the execution mapping on a loop construct.
-/// They refer directly to the OpenACC 3.1 standard:
+/// They refer directly to the OpenACC 3.3 standard:
/// 2.9.2. gang
/// 2.9.3. worker
/// 2.9.4. vector
diff --git a/mlir/include/mlir/Dialect/OpenACC/OpenACCBase.td b/mlir/include/mlir/Dialect/OpenACC/OpenACCBase.td
index 06c9151a9b3a7..c158cf53f0982 100644
--- a/mlir/include/mlir/Dialect/OpenACC/OpenACCBase.td
+++ b/mlir/include/mlir/Dialect/OpenACC/OpenACCBase.td
@@ -21,7 +21,7 @@ def OpenACC_Dialect : Dialect {
let summary = "An OpenACC dialect for MLIR.";
let description = [{
- This dialect models the construct from the OpenACC 3.1 directive language.
+ This dialect models the construct from the OpenACC 3.3 directive language.
}];
let useDefaultAttributePrinterParser = 1;
More information about the flang-commits
mailing list