From 90d9c1ca74d38ad0c028727b874eab574f904d80 Mon Sep 17 00:00:00 2001 From: Kiran Chandramohan Date: Fri, 24 Mar 2023 11:02:18 +0000 Subject: [PATCH] [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 --- flang/lib/Lower/OpenMP.cpp | 6 ++++++ flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90 | 10 ++++++++++ flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90 | 12 ++++++++++++ flang/test/Lower/OpenMP/Todo/private-commonblock.f90 | 10 ++++++++++ 4 files changed, 38 insertions(+) create mode 100644 flang/test/Lower/OpenMP/Todo/firstprivate-commonblock.f90 create mode 100644 flang/test/Lower/OpenMP/Todo/lastprivate-commonblock.f90 create mode 100644 flang/test/Lower/OpenMP/Todo/private-commonblock.f90 diff --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp index 22e5ff3..1204ba7 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()) + 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 0000000..1018c7b --- /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 0000000..66ffc46 --- /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 0000000..da11e58 --- /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 -- 2.7.4