[flang-commits] [flang] 0ca86a4 - [Flang][OpenMP] Improved reduction clause TODO message

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Thu Mar 2 09:47:00 PST 2023


Author: Kiran Chandramohan
Date: 2023-03-02T17:46:36Z
New Revision: 0ca86a42f0c15ea0db760446fb662c7dcd66345d

URL: https://github.com/llvm/llvm-project/commit/0ca86a42f0c15ea0db760446fb662c7dcd66345d
DIFF: https://github.com/llvm/llvm-project/commit/0ca86a42f0c15ea0db760446fb662c7dcd66345d.diff

LOG: [Flang][OpenMP] Improved reduction clause TODO message

Provide the name of the construct and the clause info (reduction)
in the TODO mesage.

Reviewed By: DavidTruby

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

Added: 
    

Modified: 
    flang/lib/Lower/OpenMP.cpp
    flang/test/Lower/OpenMP/Todo/parallel-reduction.f90

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
index da589626d8b4a..1084707fd23be 100644
--- a/flang/lib/Lower/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -997,8 +997,13 @@ genOMP(Fortran::lower::AbstractConverter &converter,
                        &clause.u)) {
       priorityClauseOperand = fir::getBase(converter.genExprValue(
           *Fortran::semantics::GetExpr(priorityClause->v), stmtCtx));
+    } else if (std::get_if<Fortran::parser::OmpClause::Reduction>(&clause.u)) {
+      TODO(currentLocation,
+           "Reduction in OpenMP " +
+               llvm::omp::getOpenMPDirectiveName(blockDirective.v) +
+               " construct");
     } else {
-      TODO(currentLocation, "OpenMP Block construct clauses");
+      TODO(converter.getCurrentLocation(), "OpenMP Block construct clause");
     }
   }
 

diff  --git a/flang/test/Lower/OpenMP/Todo/parallel-reduction.f90 b/flang/test/Lower/OpenMP/Todo/parallel-reduction.f90
index 54b58ada8ab09..df13f1faefe80 100644
--- a/flang/test/Lower/OpenMP/Todo/parallel-reduction.f90
+++ b/flang/test/Lower/OpenMP/Todo/parallel-reduction.f90
@@ -1,7 +1,7 @@
 ! 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: OpenMP Block construct clauses
+! CHECK: not yet implemented: Reduction in OpenMP parallel construct
 subroutine reduction_parallel
   integer :: x
   !$omp parallel reduction(+:x)


        


More information about the flang-commits mailing list