[flang-commits] [mlir] [flang] [flang][openacc] Do not accept static and num for gang clause on routine dir (PR #77673)
via flang-commits
flang-commits at lists.llvm.org
Thu Jan 11 13:10:04 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 5c9b713394486be91dc181062e5c01d696c30787 ac3743ca5b6cd77e666e4a29ea237d33dd4e99df -- flang/lib/Semantics/check-acc-structure.cpp mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
index b4adef7e7d..b8363058e5 100644
--- a/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
+++ b/mlir/lib/Dialect/OpenACC/IR/OpenACC.cpp
@@ -2001,7 +2001,8 @@ void printRoutineGangClause(OpAsmPrinter &p, Operation *op, UnitAttr gang,
<< " : " << gangDim.getType() << ")";
}
-static ParseResult parseDeviceTypeArrayAttr(OpAsmParser &parser, mlir::ArrayAttr &deviceTypes) {
+static ParseResult parseDeviceTypeArrayAttr(OpAsmParser &parser,
+ mlir::ArrayAttr &deviceTypes) {
llvm::SmallVector<mlir::Attribute> attributes;
// Keyword only
if (failed(parser.parseOptionalLParen())) {
@@ -2032,8 +2033,9 @@ static bool hasDeviceTypeValues(std::optional<mlir::ArrayAttr> arrayAttr) {
return false;
}
-static void printDeviceTypeArrayAttr(mlir::OpAsmPrinter &p, mlir::Operation *op,
- std::optional<mlir::ArrayAttr> deviceTypes) {
+static void
+printDeviceTypeArrayAttr(mlir::OpAsmPrinter &p, mlir::Operation *op,
+ std::optional<mlir::ArrayAttr> deviceTypes) {
if (hasDeviceTypeValues(deviceTypes) && deviceTypes->size() == 1) {
auto deviceTypeAttr =
@@ -2044,19 +2046,16 @@ static void printDeviceTypeArrayAttr(mlir::OpAsmPrinter &p, mlir::Operation *op,
if (!hasDeviceTypeValues(deviceTypes))
return;
-
+
p << "([";
- llvm::interleaveComma(*deviceTypes, p,
- [&](mlir::Attribute attr) {
- auto dTypeAttr = mlir::dyn_cast<mlir::acc::DeviceTypeAttr>(attr);
- p << dTypeAttr;
- });
+ llvm::interleaveComma(*deviceTypes, p, [&](mlir::Attribute attr) {
+ auto dTypeAttr = mlir::dyn_cast<mlir::acc::DeviceTypeAttr>(attr);
+ p << dTypeAttr;
+ });
p << "])";
}
-bool RoutineOp::hasWorker() {
- return hasWorker(mlir::acc::DeviceType::None);
-}
+bool RoutineOp::hasWorker() { return hasWorker(mlir::acc::DeviceType::None); }
bool RoutineOp::hasWorker(mlir::acc::DeviceType deviceType) {
if (auto arrayAttr = getWorker()) {
@@ -2066,9 +2065,7 @@ bool RoutineOp::hasWorker(mlir::acc::DeviceType deviceType) {
return false;
}
-bool RoutineOp::hasVector() {
- return hasWorker(mlir::acc::DeviceType::None);
-}
+bool RoutineOp::hasVector() { return hasWorker(mlir::acc::DeviceType::None); }
bool RoutineOp::hasVector(mlir::acc::DeviceType deviceType) {
if (auto arrayAttr = getVector()) {
@@ -2078,9 +2075,7 @@ bool RoutineOp::hasVector(mlir::acc::DeviceType deviceType) {
return false;
}
-bool RoutineOp::hasSeq() {
- return hasWorker(mlir::acc::DeviceType::None);
-}
+bool RoutineOp::hasSeq() { return hasWorker(mlir::acc::DeviceType::None); }
bool RoutineOp::hasSeq(mlir::acc::DeviceType deviceType) {
if (auto arrayAttr = getSeq()) {
``````````
</details>
https://github.com/llvm/llvm-project/pull/77673
More information about the flang-commits
mailing list