[flang-commits] [flang] [flang][OpenMP] Lower `target .. private(..)` to `omp.private` ops (PR #94195)

via flang-commits flang-commits at lists.llvm.org
Mon Jun 3 02:04:09 PDT 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 763b96c86d81d51d0db430791a61fd1e8a406bce cd6cce5a43b269d6cce67c71a0c4575a3ef0a5f9 -- flang/lib/Lower/OpenMP/DataSharingProcessor.cpp flang/lib/Lower/OpenMP/DataSharingProcessor.h flang/lib/Lower/OpenMP/OpenMP.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp b/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
index d8421b00cb..2cddfa9eee 100644
--- a/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
+++ b/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
@@ -414,8 +414,7 @@ void DataSharingProcessor::collectPreDeterminedSymbols() {
                    preDeterminedSymbols);
 }
 
-void DataSharingProcessor::privatize(
-    mlir::omp::PrivateClauseOps *clauseOps) {
+void DataSharingProcessor::privatize(mlir::omp::PrivateClauseOps *clauseOps) {
   for (const semantics::Symbol *sym : allPrivatizedSymbols) {
     if (const auto *commonDet =
             sym->detailsIf<semantics::CommonBlockDetails>()) {
@@ -439,8 +438,8 @@ void DataSharingProcessor::copyLastPrivatize(mlir::Operation *op) {
     }
 }
 
-void DataSharingProcessor::doPrivatize(
-    const semantics::Symbol *sym, mlir::omp::PrivateClauseOps *clauseOps) {
+void DataSharingProcessor::doPrivatize(const semantics::Symbol *sym,
+                                       mlir::omp::PrivateClauseOps *clauseOps) {
   if (!useDelayedPrivatization) {
     cloneSymbol(sym);
     copyFirstPrivateSymbol(sym);
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 06ec253411..c8482aaf4c 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -768,7 +768,8 @@ genBodyOfTargetOp(lower::AbstractConverter &converter, lower::SymMap &symTable,
   mlir::OperandRange privateVars = targetOp.getPrivateVars();
 
   llvm::SmallVector<mlir::Type> allRegionArgTypes;
-  allRegionArgTypes.reserve(mapSymTypes.size() + targetOp.getPrivateVars().size());
+  allRegionArgTypes.reserve(mapSymTypes.size() +
+                            targetOp.getPrivateVars().size());
   llvm::transform(mapSymTypes, std::back_inserter(allRegionArgTypes),
                   [](mlir::Type t) { return t; });
   llvm::transform(privateVars, std::back_inserter(allRegionArgTypes),
@@ -1091,7 +1092,7 @@ static void genTargetClauses(
                                          llvm::omp::Directive::OMPD_target);
 
   // `target private(..)` is only supported in delayed privatization mode.
-  if(!enableDelayedPrivatization)
+  if (!enableDelayedPrivatization)
     cp.processTODO<clause::Private>(loc, llvm::omp::Directive::OMPD_target);
 }
 

``````````

</details>


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


More information about the flang-commits mailing list