[flang-commits] [flang] 90d9c1c - [Flang][OpenMP] Add TODO message for common block privatisation

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Fri Mar 24 04:23:24 PDT 2023


Author: Kiran Chandramohan
Date: 2023-03-24T11:20:03Z
New Revision: 90d9c1ca74d38ad0c028727b874eab574f904d80

URL: https://github.com/llvm/llvm-project/commit/90d9c1ca74d38ad0c028727b874eab574f904d80
DIFF: https://github.com/llvm/llvm-project/commit/90d9c1ca74d38ad0c028727b874eab574f904d80.diff

LOG: [Flang][OpenMP] Add TODO message for common block privatisation

This is a temporary message until the feature is implemented and
merged.

Note: There is a proposed patch (https://reviews.llvm.org/D127215)

Reviewed By: peixin

Differential Revision: https://reviews.llvm.org/D146768

Added: 
    flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90
    flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90
    flang/test/Lower/OpenMP/Todo/private-commonblock.f90

Modified: 
    flang/lib/Lower/OpenMP.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
index 22e5ff322f6fb..1204ba77c1d49 100644
--- a/flang/lib/Lower/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -173,6 +173,12 @@ void DataSharingProcessor::collectSymbolsForPrivatization() {
     }
   }
 
+  for (auto *ps : privatizedSymbols) {
+    if (ps->has<Fortran::semantics::CommonBlockDetails>())
+      TODO(converter.getCurrentLocation(),
+           "Common Block in privatization clause");
+  }
+
   if (hasCollapse && hasLastPrivateOp)
     TODO(converter.getCurrentLocation(), "Collapse clause with lastprivate");
 }

diff  --git a/flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90 b/flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90
new file mode 100644
index 0000000000000..1018c7b29b1f3
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90
@@ -0,0 +1,10 @@
+! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: Common Block in privatization clause
+subroutine firstprivate_common
+  common /c/ x, y
+  real x, y
+  !$omp parallel firstprivate(/c/)
+  !$omp end parallel
+end subroutine

diff  --git a/flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90 b/flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90
new file mode 100644
index 0000000000000..66ffc468904aa
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90
@@ -0,0 +1,12 @@
+! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: Common Block in privatization clause
+subroutine lastprivate_common
+  common /c/ x, y
+  real x, y
+  !$omp do lastprivate(/c/)
+  do i=1,100
+  end do
+  !$omp end do
+end subroutine

diff  --git a/flang/test/Lower/OpenMP/Todo/private-commonblock.f90 b/flang/test/Lower/OpenMP/Todo/private-commonblock.f90
new file mode 100644
index 0000000000000..da11e5862af3f
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/private-commonblock.f90
@@ -0,0 +1,10 @@
+! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
+
+! CHECK: not yet implemented: Common Block in privatization clause
+subroutine private_common
+  common /c/ x, y
+  real x, y
+  !$omp parallel private(/c/)
+  !$omp end parallel
+end subroutine


        


More information about the flang-commits mailing list