[flang-commits] [flang] 051dea8 - [Flang][OpenMP] Remove TODO for shared and two values of default clause

Kiran Chandramohan via flang-commits flang-commits at lists.llvm.org
Wed Jun 29 05:09:31 PDT 2022


Author: Kiran Chandramohan
Date: 2022-06-29T12:09:03Z
New Revision: 051dea8221522ba320235c9c07bea5dbed2cc0ce

URL: https://github.com/llvm/llvm-project/commit/051dea8221522ba320235c9c07bea5dbed2cc0ce
DIFF: https://github.com/llvm/llvm-project/commit/051dea8221522ba320235c9c07bea5dbed2cc0ce.diff

LOG: [Flang][OpenMP] Remove TODO for shared and two values of default clause

Shared is the default behaviour in the IR, so no handling is required.
Default clause with shared or none do not require any handling since
Shared is the default behaviour in the IR and None is only required
for semantic checks.

This patch is carved out from D123930 to remove couple of false TODOs.

Reviewed By: peixin, shraiysh

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

Co-authored-by: Nimish Mishra <neelam.nimish at gmail.com>

Added: 
    

Modified: 
    flang/lib/Lower/OpenMP.cpp

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/OpenMP.cpp b/flang/lib/Lower/OpenMP.cpp
index 820918cc98cc4..0949cb7d3aea2 100644
--- a/flang/lib/Lower/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP.cpp
@@ -611,6 +611,21 @@ genOMP(Fortran::lower::AbstractConverter &converter,
                std::get_if<Fortran::parser::OmpClause::Copyin>(&clause.u)) {
       // Privatisation and copyin clauses are handled elsewhere.
       continue;
+    } else if (std::get_if<Fortran::parser::OmpClause::Shared>(&clause.u)) {
+      // Shared is the default behavior in the IR, so no handling is required.
+      continue;
+    } else if (const auto &defaultClause =
+                   std::get_if<Fortran::parser::OmpClause::Default>(
+                       &clause.u)) {
+      if ((defaultClause->v.v ==
+           Fortran::parser::OmpDefaultClause::Type::Shared) ||
+          (defaultClause->v.v ==
+           Fortran::parser::OmpDefaultClause::Type::None)) {
+        // Default clause with shared or none do not require any handling since
+        // Shared is the default behavior in the IR and None is only required
+        // for semantic checks.
+        continue;
+      }
     } else if (std::get_if<Fortran::parser::OmpClause::Threads>(&clause.u)) {
       // Nothing needs to be done for threads clause.
       continue;


        


More information about the flang-commits mailing list