[flang-commits] [flang] 8141a43 - [flang][OpenMP] Make OpenMPLoopConstruct inherit from OmpBlockConstruct (#193823)

via flang-commits flang-commits at lists.llvm.org
Fri Apr 24 04:22:16 PDT 2026


Author: Krzysztof Parzyszek
Date: 2026-04-24T06:22:11-05:00
New Revision: 8141a4351c5e0803902e27182a9ff0ebb7cb7bee

URL: https://github.com/llvm/llvm-project/commit/8141a4351c5e0803902e27182a9ff0ebb7cb7bee
DIFF: https://github.com/llvm/llvm-project/commit/8141a4351c5e0803902e27182a9ff0ebb7cb7bee.diff

LOG: [flang][OpenMP] Make OpenMPLoopConstruct inherit from OmpBlockConstruct (#193823)

Conceptually OpenMPLoopConstruct has the exact same structure as
OmpBlockConstruct: directive specification for the begin directive,
optional one for the end directive, and a block of code. The reason why
OpenMPLoopConstruct was not originally made to be a descendant of
OmpBlockConstruct was to preserve the behavior of AST visitors, where a
separate (type-based) visitor could be defined for the begin/end
directives of a block construct, and for a loop construct. The AST nodes
representing the begin/end directives in block and loop construct had
different types: Omp{Begin|End}Directive for block constructs, and
Omp{Begin|End}LoopDirective for loop constructs.
Today this distinction is not needed anywhere, and so the loop construct
will be represented in the same way as a block construct.

Added: 
    

Modified: 
    flang/examples/FeatureList/FeatureList.cpp
    flang/include/flang/Lower/OpenMP.h
    flang/include/flang/Parser/dump-parse-tree.h
    flang/include/flang/Parser/openmp-utils.h
    flang/include/flang/Parser/parse-tree.h
    flang/lib/Lower/Bridge.cpp
    flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
    flang/lib/Parser/openmp-parsers.cpp
    flang/lib/Parser/unparse.cpp
    flang/lib/Semantics/canonicalize-omp.cpp
    flang/lib/Semantics/check-omp-loop.cpp
    flang/lib/Semantics/check-omp-structure.cpp
    flang/lib/Semantics/check-omp-structure.h
    flang/lib/Semantics/resolve-directives.cpp
    flang/lib/Semantics/resolve-names.cpp
    flang/test/Lower/pre-fir-tree03.f90
    flang/test/Parser/OpenMP/bind-clause.f90
    flang/test/Parser/OpenMP/cross-label-do.f90
    flang/test/Parser/OpenMP/declare-reduction-multi.f90
    flang/test/Parser/OpenMP/declare-reduction-unparse.f90
    flang/test/Parser/OpenMP/depth-clause.f90
    flang/test/Parser/OpenMP/do-interchange.f90
    flang/test/Parser/OpenMP/do-tile-size.f90
    flang/test/Parser/OpenMP/doacross-clause.f90
    flang/test/Parser/OpenMP/fuse-looprange.f90
    flang/test/Parser/OpenMP/fuse01.f90
    flang/test/Parser/OpenMP/fuse02.f90
    flang/test/Parser/OpenMP/in-reduction-clause.f90
    flang/test/Parser/OpenMP/interchange-permutation.f90
    flang/test/Parser/OpenMP/interchange.f90
    flang/test/Parser/OpenMP/linear-clause.f90
    flang/test/Parser/OpenMP/loop-transformation-construct01.f90
    flang/test/Parser/OpenMP/loop-transformation-construct02.f90
    flang/test/Parser/OpenMP/loop-transformation-construct03.f90
    flang/test/Parser/OpenMP/loop-transformation-construct04.f90
    flang/test/Parser/OpenMP/loop-transformation-construct05.f90
    flang/test/Parser/OpenMP/masked-unparse.f90
    flang/test/Parser/OpenMP/master-unparse.f90
    flang/test/Parser/OpenMP/nonblock-do-nested-omp.f90
    flang/test/Parser/OpenMP/order-clause01.f90
    flang/test/Parser/OpenMP/ordered-depend.f90
    flang/test/Parser/OpenMP/parallel-loop-unparse.f90
    flang/test/Parser/OpenMP/reduction-modifier.f90
    flang/test/Parser/OpenMP/target-loop-unparse.f90
    flang/test/Parser/OpenMP/taskloop.f90
    flang/test/Parser/OpenMP/threadset-clause.f90
    flang/test/Parser/OpenMP/tile-size.f90
    flang/test/Parser/OpenMP/tile.f90
    flang/test/Parser/OpenMP/transparent-clause.f90
    flang/test/Parser/OpenMP/unroll-full.f90
    flang/test/Parser/OpenMP/unroll-heuristic.f90
    flang/test/Parser/OpenMP/unroll-partial.f90
    flang/unittests/Semantics/OpenMPUtils.cpp

Removed: 
    


################################################################################
diff  --git a/flang/examples/FeatureList/FeatureList.cpp b/flang/examples/FeatureList/FeatureList.cpp
index c338fd0ab8dfc..51d32bae40409 100644
--- a/flang/examples/FeatureList/FeatureList.cpp
+++ b/flang/examples/FeatureList/FeatureList.cpp
@@ -453,7 +453,6 @@ struct NodeVisitor {
   READ_FEATURE(OmpAlignedClause)
   READ_FEATURE(OmpAllocateDirective)
   READ_FEATURE(OmpBeginDirective)
-  READ_FEATURE(OmpBeginLoopDirective)
   READ_FEATURE(OmpBeginSectionsDirective)
   READ_FEATURE(OmpBlockConstruct)
   READ_FEATURE(OmpClause)
@@ -477,7 +476,6 @@ struct NodeVisitor {
   READ_FEATURE(OmpIterationOffset)
   READ_FEATURE(OmpIterationVector)
   READ_FEATURE(OmpEndDirective)
-  READ_FEATURE(OmpEndLoopDirective)
   READ_FEATURE(OmpEndSectionsDirective)
   READ_FEATURE(OmpGrainsizeClause)
   READ_FEATURE(OmpGrainsizeClause::Modifier)

diff  --git a/flang/include/flang/Lower/OpenMP.h b/flang/include/flang/Lower/OpenMP.h
index 0080b306d4867..852a120c3782c 100644
--- a/flang/include/flang/Lower/OpenMP.h
+++ b/flang/include/flang/Lower/OpenMP.h
@@ -35,7 +35,6 @@ namespace Fortran {
 namespace parser {
 struct OpenMPConstruct;
 struct OpenMPDeclarativeConstruct;
-struct OmpEndLoopDirective;
 struct OmpClauseList;
 } // namespace parser
 

diff  --git a/flang/include/flang/Parser/dump-parse-tree.h b/flang/include/flang/Parser/dump-parse-tree.h
index 58bd02ce76918..5d96befcd6dce 100644
--- a/flang/include/flang/Parser/dump-parse-tree.h
+++ b/flang/include/flang/Parser/dump-parse-tree.h
@@ -559,7 +559,6 @@ class ParseTreeDumper {
   NODE_ENUM(OmpAutomapModifier, Value)
   NODE(parser, OmpBaseVariantNames)
   NODE(parser, OmpBeginDirective)
-  NODE(parser, OmpBeginLoopDirective)
   NODE(parser, OmpBeginSectionsDirective)
   NODE(parser, OmpBindClause)
   NODE_ENUM(OmpBindClause, Binding)
@@ -611,7 +610,6 @@ class ParseTreeDumper {
   NODE(parser, OmpDynGroupprivateClause)
   NODE(OmpDynGroupprivateClause, Modifier)
   NODE(parser, OmpEndDirective)
-  NODE(parser, OmpEndLoopDirective)
   NODE(parser, OmpEndSectionsDirective)
   NODE(parser, OmpEnterClause)
   NODE(OmpEnterClause, Modifier)

diff  --git a/flang/include/flang/Parser/openmp-utils.h b/flang/include/flang/Parser/openmp-utils.h
index e2e5ec19c2c34..2c27c1bcf1b42 100644
--- a/flang/include/flang/Parser/openmp-utils.h
+++ b/flang/include/flang/Parser/openmp-utils.h
@@ -42,7 +42,6 @@ struct DirectiveSpecificationScope {
   template <typename T> static const ODS &GetODS(const T &x) {
     if constexpr ( //
         std::is_base_of_v<OmpBlockConstruct, T> ||
-        std::is_same_v<OpenMPLoopConstruct, T> ||
         std::is_same_v<OpenMPSectionsConstruct, T>) {
       return x.BeginDir();
     } else if constexpr (WrapperTrait<T>) {
@@ -78,10 +77,6 @@ struct DirectiveNameScope {
     return x;
   }
 
-  static OmpDirectiveName GetOmpDirectiveName(const OmpBeginLoopDirective &x) {
-    return x.DirName();
-  }
-
   static OmpDirectiveName GetOmpDirectiveName(const OpenMPSectionConstruct &x) {
     if (auto &spec{std::get<std::optional<OmpDirectiveSpecification>>(x.t)}) {
       return spec->DirName();

diff  --git a/flang/include/flang/Parser/parse-tree.h b/flang/include/flang/Parser/parse-tree.h
index cde779842b4d7..9f3dd5e0d1032 100644
--- a/flang/include/flang/Parser/parse-tree.h
+++ b/flang/include/flang/Parser/parse-tree.h
@@ -5448,32 +5448,12 @@ struct OpenMPStandaloneConstruct {
       u;
 };
 
-struct OmpBeginLoopDirective : public OmpBeginDirective {
-  INHERITED_TUPLE_CLASS_BOILERPLATE(OmpBeginLoopDirective, OmpBeginDirective);
-};
-
-struct OmpEndLoopDirective : public OmpEndDirective {
-  INHERITED_TUPLE_CLASS_BOILERPLATE(OmpEndLoopDirective, OmpEndDirective);
-};
-
 // OpenMP directives enclosing do loop
-struct OpenMPLoopConstruct {
-  TUPLE_CLASS_BOILERPLATE(OpenMPLoopConstruct);
-  OpenMPLoopConstruct(OmpBeginLoopDirective &&a)
-      : t({std::move(a), Block{}, std::nullopt}) {}
+struct OpenMPLoopConstruct : public OmpBlockConstruct {
+  INHERITED_TUPLE_CLASS_BOILERPLATE(OpenMPLoopConstruct, OmpBlockConstruct);
 
-  const OmpBeginLoopDirective &BeginDir() const {
-    return std::get<OmpBeginLoopDirective>(t);
-  }
-  const std::optional<OmpEndLoopDirective> &EndDir() const {
-    return std::get<std::optional<OmpEndLoopDirective>>(t);
-  }
   const DoConstruct *GetNestedLoop() const;
   const OpenMPLoopConstruct *GetNestedConstruct() const;
-
-  CharBlock source;
-  std::tuple<OmpBeginLoopDirective, Block, std::optional<OmpEndLoopDirective>>
-      t;
 };
 
 // Lookahead class to identify execution-part OpenMP constructs without

diff  --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index e1ff770fb7ad4..94f371d03079c 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -6391,7 +6391,6 @@ class FirConverter : public Fortran::lower::AbstractConverter {
   void genFIR(const Fortran::parser::IfStmt &) {}              // nop
   void genFIR(const Fortran::parser::IfThenStmt &) {}          // nop
   void genFIR(const Fortran::parser::NonLabelDoStmt &) {}      // nop
-  void genFIR(const Fortran::parser::OmpEndLoopDirective &) {} // nop
   void genFIR(const Fortran::parser::SelectTypeStmt &) {}      // nop
   void genFIR(const Fortran::parser::TypeGuardStmt &) {}       // nop
   void genFIR(const Fortran::parser::ChangeTeamStmt &stmt) {}  // nop

diff  --git a/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp b/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
index 457a2abba3ca0..e392497d30de7 100644
--- a/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
+++ b/flang/lib/Lower/OpenMP/DataSharingProcessor.cpp
@@ -422,7 +422,6 @@ static parser::CharBlock getSource(const semantics::SemanticsContext &semaCtx,
         return parser::omp::GetOmpDirectiveName(x).source;
       },
       [&](const parser::OpenMPDeclarativeConstruct &x) { return x.source; },
-      [&](const parser::OmpEndLoopDirective &x) { return x.source; },
       [&](const auto &x) { return parser::CharBlock{}; },
   });
 }

diff  --git a/flang/lib/Parser/openmp-parsers.cpp b/flang/lib/Parser/openmp-parsers.cpp
index f41fa5608631c..72089d6cefe1a 100644
--- a/flang/lib/Parser/openmp-parsers.cpp
+++ b/flang/lib/Parser/openmp-parsers.cpp
@@ -2048,26 +2048,26 @@ struct OmpLoopConstructParser {
       if (assoc == llvm::omp::Association::LoopNest) {
         if (auto &&item{attempt(loopItem).Parse(state)}) {
           auto end{maybe(OmpEndDirectiveParser{loopDir}).Parse(state)};
-          return OpenMPLoopConstruct{OmpBeginLoopDirective(std::move(*begin)),
+          return OpenMPLoopConstruct{OmpBeginDirective(std::move(*begin)),
               std::move(*item),
               llvm::transformOptional(std::move(*end),
-                  [](auto &&s) { return OmpEndLoopDirective(std::move(s)); })};
+                  [](auto &&s) { return OmpEndDirective(std::move(s)); })};
         } else if (auto &&empty{pure<Block>().Parse(state)}) {
           // Allow empty body.
           auto end{maybe(OmpEndDirectiveParser{loopDir}).Parse(state)};
-          return OpenMPLoopConstruct{OmpBeginLoopDirective(std::move(*begin)),
+          return OpenMPLoopConstruct{OmpBeginDirective(std::move(*begin)),
               std::move(*empty),
               llvm::transformOptional(std::move(*end),
-                  [](auto &&s) { return OmpEndLoopDirective(std::move(s)); })};
+                  [](auto &&s) { return OmpEndDirective(std::move(s)); })};
         }
       } else if (assoc == llvm::omp::Association::LoopSeq) {
         // Parse loop sequence as a block.
         if (auto &&body{validBlock.Parse(state)}) {
           auto end{maybe(OmpEndDirectiveParser{loopDir}).Parse(state)};
-          return OpenMPLoopConstruct{OmpBeginLoopDirective(std::move(*begin)),
+          return OpenMPLoopConstruct{OmpBeginDirective(std::move(*begin)),
               std::move(*body),
               llvm::transformOptional(std::move(*end),
-                  [](auto &&s) { return OmpEndLoopDirective(std::move(s)); })};
+                  [](auto &&s) { return OmpEndDirective(std::move(s)); })};
         }
       } else {
         llvm_unreachable("Unexpected association");

diff  --git a/flang/lib/Parser/unparse.cpp b/flang/lib/Parser/unparse.cpp
index 33d7475798b8e..46a3b38697c30 100644
--- a/flang/lib/Parser/unparse.cpp
+++ b/flang/lib/Parser/unparse.cpp
@@ -2204,9 +2204,6 @@ class UnparseVisitor {
     Put("\n");
     EndOpenMP();
   }
-  void Unparse(const OmpBeginLoopDirective &x) {
-    Unparse(static_cast<const OmpBeginDirective &>(x));
-  }
   void Unparse(const OmpBeginSectionsDirective &x) {
     Unparse(static_cast<const OmpBeginDirective &>(x));
   }
@@ -2312,9 +2309,6 @@ class UnparseVisitor {
     Put("\n");
     EndOpenMP();
   }
-  void Unparse(const OmpEndLoopDirective &x) {
-    Unparse(static_cast<const OmpEndDirective &>(x));
-  }
   void Unparse(const OmpEndSectionsDirective &x) {
     Unparse(static_cast<const OmpEndDirective &>(x));
   }

diff  --git a/flang/lib/Semantics/canonicalize-omp.cpp b/flang/lib/Semantics/canonicalize-omp.cpp
index 802b2acd3c0d2..f67ac689add14 100644
--- a/flang/lib/Semantics/canonicalize-omp.cpp
+++ b/flang/lib/Semantics/canonicalize-omp.cpp
@@ -15,12 +15,9 @@
 // After Loop Canonicalization, rewrite OpenMP parse tree to make OpenMP
 // Constructs more structured which provide explicit scopes for later
 // structural checks and semantic analysis.
-//   1. move structured DoConstruct and OmpEndLoopDirective into
-//      OpenMPLoopConstruct. Compilation will not proceed in case of errors
-//      after this pass.
-//   2. Associate declarative OMP allocation directives with their
+//   1. Associate declarative OMP allocation directives with their
 //      respective executable allocation directive
-//   3. TBD
+//   2. TBD
 namespace Fortran::semantics {
 
 using namespace parser::literals;

diff  --git a/flang/lib/Semantics/check-omp-loop.cpp b/flang/lib/Semantics/check-omp-loop.cpp
index 1299686a99ad2..739c76da15a7f 100644
--- a/flang/lib/Semantics/check-omp-loop.cpp
+++ b/flang/lib/Semantics/check-omp-loop.cpp
@@ -629,32 +629,6 @@ void OmpStructureChecker::Leave(const parser::OpenMPLoopConstruct &x) {
   loopStack_.pop_back();
 }
 
-void OmpStructureChecker::Enter(const parser::OmpEndLoopDirective &x) {
-  const parser::OmpDirectiveName &dir{x.DirName()};
-  ResetPartialContext(dir.source);
-  switch (dir.v) {
-  // 2.7.1 end-do -> END DO [nowait-clause]
-  // 2.8.3 end-do-simd -> END DO SIMD [nowait-clause]
-  case llvm::omp::Directive::OMPD_do:
-    PushContextAndClauseSets(dir.source, llvm::omp::Directive::OMPD_end_do);
-    break;
-  case llvm::omp::Directive::OMPD_do_simd:
-    PushContextAndClauseSets(
-        dir.source, llvm::omp::Directive::OMPD_end_do_simd);
-    break;
-  default:
-    // no clauses are allowed
-    break;
-  }
-}
-
-void OmpStructureChecker::Leave(const parser::OmpEndLoopDirective &x) {
-  if ((GetContext().directive == llvm::omp::Directive::OMPD_end_do) ||
-      (GetContext().directive == llvm::omp::Directive::OMPD_end_do_simd)) {
-    dirContext_.pop_back();
-  }
-}
-
 void OmpStructureChecker::Enter(const parser::OmpClause::Depth &x) {
   CheckAllowedClause(llvm::omp::Clause::OMPC_depth);
 

diff  --git a/flang/lib/Semantics/check-omp-structure.cpp b/flang/lib/Semantics/check-omp-structure.cpp
index 8b5cd35929689..bc90247732fff 100644
--- a/flang/lib/Semantics/check-omp-structure.cpp
+++ b/flang/lib/Semantics/check-omp-structure.cpp
@@ -3273,6 +3273,14 @@ void OmpStructureChecker::Enter(const parser::OmpEndDirective &x) {
   case llvm::omp::Directive::OMPD_workshare:
     PushContextAndClauseSets(source, llvm::omp::Directive::OMPD_end_workshare);
     break;
+  // 2.7.1 end-do -> END DO [nowait-clause]
+  // 2.8.3 end-do-simd -> END DO SIMD [nowait-clause]
+  case llvm::omp::Directive::OMPD_do:
+    PushContextAndClauseSets(source, llvm::omp::Directive::OMPD_end_do);
+    break;
+  case llvm::omp::Directive::OMPD_do_simd:
+    PushContextAndClauseSets(source, llvm::omp::Directive::OMPD_end_do_simd);
+    break;
   default:
     // no clauses are allowed
     break;
@@ -3287,7 +3295,9 @@ void OmpStructureChecker::Enter(const parser::OmpEndDirective &x) {
 void OmpStructureChecker::Leave(const parser::OmpEndDirective &x) {
   if ((GetContext().directive == llvm::omp::Directive::OMPD_end_scope) ||
       (GetContext().directive == llvm::omp::Directive::OMPD_end_single) ||
-      (GetContext().directive == llvm::omp::Directive::OMPD_end_workshare)) {
+      (GetContext().directive == llvm::omp::Directive::OMPD_end_workshare) ||
+      (GetContext().directive == llvm::omp::Directive::OMPD_end_do) ||
+      (GetContext().directive == llvm::omp::Directive::OMPD_end_do_simd)) {
     dirContext_.pop_back();
   }
 }

diff  --git a/flang/lib/Semantics/check-omp-structure.h b/flang/lib/Semantics/check-omp-structure.h
index ab4e32858ca53..2d9472874b0c8 100644
--- a/flang/lib/Semantics/check-omp-structure.h
+++ b/flang/lib/Semantics/check-omp-structure.h
@@ -103,8 +103,6 @@ class OmpStructureChecker : public OmpStructureCheckerBase {
 
   void Enter(const parser::OpenMPLoopConstruct &);
   void Leave(const parser::OpenMPLoopConstruct &);
-  void Enter(const parser::OmpEndLoopDirective &);
-  void Leave(const parser::OmpEndLoopDirective &);
 
   void Enter(const parser::OpenMPAssumeConstruct &);
   void Leave(const parser::OpenMPAssumeConstruct &);

diff  --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp
index 3fbd8e1ade347..bc76f1f8cd52c 100644
--- a/flang/lib/Semantics/resolve-directives.cpp
+++ b/flang/lib/Semantics/resolve-directives.cpp
@@ -611,9 +611,6 @@ class OmpAttributeVisitor : DirectiveAttributeVisitor<llvm::omp::Directive> {
 
   bool Pre(const parser::OpenMPLoopConstruct &);
   void Post(const parser::OpenMPLoopConstruct &) { PopContext(); }
-  void Post(const parser::OmpBeginLoopDirective &) {
-    GetContext().withinConstruct = true;
-  }
   bool Pre(const parser::OpenMPMisplacedEndDirective &x) { return false; }
   bool Pre(const parser::OpenMPInvalidDirective &x) { return false; }
 

diff  --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index 7a0d864071659..94c1cc799e7e0 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -1731,18 +1731,6 @@ class OmpVisitor : public virtual DeclarationVisitor {
     return true;
   }
   void Post(const parser::OpenMPLoopConstruct &) { PopScope(); }
-  bool Pre(const parser::OmpBeginLoopDirective &x) {
-    return Pre(static_cast<const parser::OmpDirectiveSpecification &>(x));
-  }
-  void Post(const parser::OmpBeginLoopDirective &x) {
-    Post(static_cast<const parser::OmpDirectiveSpecification &>(x));
-  }
-  bool Pre(const parser::OmpEndLoopDirective &x) {
-    return Pre(static_cast<const parser::OmpDirectiveSpecification &>(x));
-  }
-  void Post(const parser::OmpEndLoopDirective &x) {
-    Post(static_cast<const parser::OmpDirectiveSpecification &>(x));
-  }
 
   void Post(const parser::OmpTypeName &);
   bool Pre(const parser::OmpStylizedDeclaration &);

diff  --git a/flang/test/Lower/pre-fir-tree03.f90 b/flang/test/Lower/pre-fir-tree03.f90
index 03268ba0782d5..b20b472d79137 100644
--- a/flang/test/Lower/pre-fir-tree03.f90
+++ b/flang/test/Lower/pre-fir-tree03.f90
@@ -38,7 +38,6 @@ program test_omp
     end do
     ! CHECK: <<End DoConstruct>>
     ! CHECK: <<End OpenMPConstruct>>
-    ! CHECK-NOT: OmpEndLoopDirective
     ! CHECK: PrintStmt
     print *, "no in omp do"
   !$omp end parallel

diff  --git a/flang/test/Parser/OpenMP/bind-clause.f90 b/flang/test/Parser/OpenMP/bind-clause.f90
index af89719c04e6d..9c86fae608f68 100644
--- a/flang/test/Parser/OpenMP/bind-clause.f90
+++ b/flang/test/Parser/OpenMP/bind-clause.f90
@@ -18,7 +18,7 @@ subroutine f00
 !UNPARSE: END SUBROUTINE
 
 !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | OmpBeginLoopDirective
+!PARSE-TREE: | OmpBeginDirective
 !PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = loop
 !PARSE-TREE: | | OmpClauseList -> OmpClause -> Bind -> OmpBindClause -> Binding = Parallel
 !PARSE-TREE: | | Flags = {}

diff  --git a/flang/test/Parser/OpenMP/cross-label-do.f90 b/flang/test/Parser/OpenMP/cross-label-do.f90
index f1a406c334c39..8d07e4b8ac02e 100644
--- a/flang/test/Parser/OpenMP/cross-label-do.f90
+++ b/flang/test/Parser/OpenMP/cross-label-do.f90
@@ -29,7 +29,7 @@ subroutine f00
 !PARSE-TREE: | | | | LiteralConstant -> IntLiteralConstant = '10'
 !PARSE-TREE: | Block
 !PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | | | OmpBeginLoopDirective
+!PARSE-TREE: | | | OmpBeginDirective
 !PARSE-TREE: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE: | | | | OmpClauseList ->
 !PARSE-TREE: | | | | Flags = {CrossesLabelDo}

diff  --git a/flang/test/Parser/OpenMP/declare-reduction-multi.f90 b/flang/test/Parser/OpenMP/declare-reduction-multi.f90
index 7e462e0265800..e08afce718fcb 100644
--- a/flang/test/Parser/OpenMP/declare-reduction-multi.f90
+++ b/flang/test/Parser/OpenMP/declare-reduction-multi.f90
@@ -192,7 +192,7 @@ program omp_examples
 !CHECK: !$OMP PARALLEL DO REDUCTION(+: sum)
 
 !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | OmpBeginLoopDirective
+!PARSE-TREE: | OmpBeginDirective
 !PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = parallel do
 !PARSE-TREE: | | OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause
 !PARSE-TREE: | | | Modifier -> OmpReductionIdentifier -> DefinedOperator -> IntrinsicOperator = Add
@@ -210,7 +210,7 @@ program omp_examples
 !CHECK: !$OMP PARALLEL DO REDUCTION(*: prod)
 
 !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | OmpBeginLoopDirective
+!PARSE-TREE: | OmpBeginDirective
 !PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = parallel do
 !PARSE-TREE: | | OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause
 !PARSE-TREE: | | | Modifier -> OmpReductionIdentifier -> DefinedOperator -> IntrinsicOperator = Multiply
@@ -228,7 +228,7 @@ program omp_examples
 !CHECK:  $OMP PARALLEL DO REDUCTION(max: big)
 
 !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | OmpBeginLoopDirective
+!PARSE-TREE: | OmpBeginDirective
 !PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = parallel do
 !PARSE-TREE: | | OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause
 !PARSE-TREE: | | | Modifier -> OmpReductionIdentifier -> ProcedureDesignator -> Name = 'max'
@@ -246,7 +246,7 @@ program omp_examples
 !CHECK: !$OMP PARALLEL DO REDUCTION(min: small)
 
 !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | OmpBeginLoopDirective
+!PARSE-TREE: | OmpBeginDirective
 !PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = parallel do
 !PARSE-TREE: | | OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause
 !PARSE-TREE: | | | Modifier -> OmpReductionIdentifier -> ProcedureDesignator -> Name = 'min'

diff  --git a/flang/test/Parser/OpenMP/declare-reduction-unparse.f90 b/flang/test/Parser/OpenMP/declare-reduction-unparse.f90
index 6ca7b0fe79198..41fbde296761b 100644
--- a/flang/test/Parser/OpenMP/declare-reduction-unparse.f90
+++ b/flang/test/Parser/OpenMP/declare-reduction-unparse.f90
@@ -64,7 +64,7 @@ end subroutine initme
 !PARSE-TREE: | Expr = 'init'
 !PARSE-TREE: | | Designator -> DataRef -> Name = 'init'
 !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | OmpBeginLoopDirective
+!PARSE-TREE: | OmpBeginDirective
 !PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = simd
 !PARSE-TREE: | | OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause
 !PARSE-TREE: | | | Modifier -> OmpReductionIdentifier -> ProcedureDesignator -> Name = 'red_add'

diff  --git a/flang/test/Parser/OpenMP/depth-clause.f90 b/flang/test/Parser/OpenMP/depth-clause.f90
index 168391cc01a6d..bd090c265c738 100644
--- a/flang/test/Parser/OpenMP/depth-clause.f90
+++ b/flang/test/Parser/OpenMP/depth-clause.f90
@@ -30,7 +30,7 @@ subroutine f00
 !UNPARSE: END SUBROUTINE
 
 !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | OmpBeginLoopDirective
+!PARSE-TREE: | OmpBeginDirective
 !PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !PARSE-TREE: | | OmpClauseList -> OmpClause -> Depth -> Scalar -> Integer -> Constant ->
 !PARSE-TREE:  = '2_4'

diff  --git a/flang/test/Parser/OpenMP/do-interchange.f90 b/flang/test/Parser/OpenMP/do-interchange.f90
index e5fbc288cef39..814491a0ed353 100644
--- a/flang/test/Parser/OpenMP/do-interchange.f90
+++ b/flang/test/Parser/OpenMP/do-interchange.f90
@@ -23,10 +23,10 @@ subroutine openmp_do_interchange(x)
 !$omp end do
 
 !PARSE-TREE:| | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE:| | | OmpBeginLoopDirective
+!PARSE-TREE:| | | OmpBeginDirective
 !PARSE-TREE:| | | Block
 !PARSE-TREE:| | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE:| | | | | OmpBeginLoopDirective
+!PARSE-TREE:| | | | | OmpBeginDirective
 !PARSE-TREE:| | | | | | OmpDirectiveName -> llvm::omp::Directive = interchange
 !PARSE-TREE:| | | | | Block
 !PARSE-TREE:| | | | | | ExecutionPartConstruct -> ExecutableConstruct -> DoConstruct

diff  --git a/flang/test/Parser/OpenMP/do-tile-size.f90 b/flang/test/Parser/OpenMP/do-tile-size.f90
index b8d175c236bf9..7c137aa5e416e 100644
--- a/flang/test/Parser/OpenMP/do-tile-size.f90
+++ b/flang/test/Parser/OpenMP/do-tile-size.f90
@@ -20,10 +20,10 @@ subroutine openmp_do_tiles(x)
 !$omp end do
 
 !PARSE-TREE:| | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE:| | | OmpBeginLoopDirective
+!PARSE-TREE:| | | OmpBeginDirective
 !PARSE-TREE:| | | Block
 !PARSE-TREE:| | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE:| | | | | OmpBeginLoopDirective
+!PARSE-TREE:| | | | | OmpBeginDirective
 !PARSE-TREE:| | | | | | OmpDirectiveName -> llvm::omp::Directive = tile
 !PARSE-TREE:| | | | | | OmpClauseList -> OmpClause -> Sizes -> Scalar -> Integer -> Expr = '2_4'
 !PARSE-TREE:| | | | | Block

diff  --git a/flang/test/Parser/OpenMP/doacross-clause.f90 b/flang/test/Parser/OpenMP/doacross-clause.f90
index d2a52c59cc1a0..28245630d0361 100644
--- a/flang/test/Parser/OpenMP/doacross-clause.f90
+++ b/flang/test/Parser/OpenMP/doacross-clause.f90
@@ -26,7 +26,7 @@ subroutine f00(x)
 !UNPARSE: END SUBROUTINE
 
 !PARSE-TREE-LABEL: ProgramUnit -> SubroutineSubprogram
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Ordered -> Scalar -> Integer -> Constant -> Expr = '2_4'
 !PARSE-TREE: | | LiteralConstant -> IntLiteralConstant = '2'
@@ -60,7 +60,7 @@ subroutine f01(x)
 !UNPARSE: END SUBROUTINE
 
 !PARSE-TREE-LABEL: ProgramUnit -> SubroutineSubprogram
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Ordered -> Scalar -> Integer -> Constant -> Expr = '2_4'
 !PARSE-TREE: | | LiteralConstant -> IntLiteralConstant = '2'

diff  --git a/flang/test/Parser/OpenMP/fuse-looprange.f90 b/flang/test/Parser/OpenMP/fuse-looprange.f90
index d6e6416175b33..6e57d010d046e 100644
--- a/flang/test/Parser/OpenMP/fuse-looprange.f90
+++ b/flang/test/Parser/OpenMP/fuse-looprange.f90
@@ -26,7 +26,7 @@ subroutine openmp_fuse(x)
 !$omp end fuse
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = fuse
 !PARSE-TREE: OmpClauseList -> OmpClause -> Looprange -> OmpLooprangeClause
 !PARSE-TREE: Scalar -> Integer -> Constant -> Expr = '1_4'

diff  --git a/flang/test/Parser/OpenMP/fuse01.f90 b/flang/test/Parser/OpenMP/fuse01.f90
index 98ce0e33797b5..820823d191932 100644
--- a/flang/test/Parser/OpenMP/fuse01.f90
+++ b/flang/test/Parser/OpenMP/fuse01.f90
@@ -21,7 +21,7 @@ subroutine openmp_fuse(x)
 !$omp end fuse
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = fuse
 
 END subroutine openmp_fuse

diff  --git a/flang/test/Parser/OpenMP/fuse02.f90 b/flang/test/Parser/OpenMP/fuse02.f90
index 4b1819f3896cf..c3b9d18885f47 100644
--- a/flang/test/Parser/OpenMP/fuse02.f90
+++ b/flang/test/Parser/OpenMP/fuse02.f90
@@ -25,13 +25,13 @@ subroutine fuse_on_fuse
 
 !CHECK-PARSE: | ExecutionPart -> Block
 !CHECK-PARSE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}
 !CHECK-PARSE-NEXT: | | | Block
 !CHECK-PARSE-NEXT: | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
@@ -58,7 +58,7 @@ subroutine fuse_on_fuse
 !CHECK-PARSE-NEXT: | | | | | | | Block
 !CHECK-PARSE-NEXT: | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> ContinueStmt
 !CHECK-PARSE-NEXT: | | | | | | | EndDoStmt ->
-!CHECK-PARSE-NEXT: | | | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
@@ -73,7 +73,7 @@ subroutine fuse_on_fuse
 !CHECK-PARSE-NEXT: | | | | | Block
 !CHECK-PARSE-NEXT: | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> ContinueStmt
 !CHECK-PARSE-NEXT: | | | | | EndDoStmt ->
-!CHECK-PARSE-NEXT: | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}

diff  --git a/flang/test/Parser/OpenMP/in-reduction-clause.f90 b/flang/test/Parser/OpenMP/in-reduction-clause.f90
index eb39398c3468a..aad52b6625cd3 100644
--- a/flang/test/Parser/OpenMP/in-reduction-clause.f90
+++ b/flang/test/Parser/OpenMP/in-reduction-clause.f90
@@ -41,7 +41,7 @@ end subroutine omp_in_reduction_taskgroup
 !PARSE-TREE-NEXT: OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'z'
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = taskloop
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> InReduction -> OmpInReductionClause
 !PARSE-TREE-NEXT: OmpReductionIdentifier -> DefinedOperator -> IntrinsicOperator = Add
@@ -72,7 +72,7 @@ end subroutine omp_in_reduction_parallel
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = taskloop simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> InReduction -> OmpInReductionClause
 !PARSE-TREE-NEXT: OmpReductionIdentifier -> DefinedOperator -> IntrinsicOperator = Add

diff  --git a/flang/test/Parser/OpenMP/interchange-permutation.f90 b/flang/test/Parser/OpenMP/interchange-permutation.f90
index 53392e050a662..fac55f9e434e2 100644
--- a/flang/test/Parser/OpenMP/interchange-permutation.f90
+++ b/flang/test/Parser/OpenMP/interchange-permutation.f90
@@ -20,7 +20,7 @@ subroutine openmp_interchange(x)
 !$omp end interchange
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE:  OmpDirectiveName -> llvm::omp::Directive = interchange
 !PARSE-TREE:   OmpClauseList -> OmpClause -> Permutation -> Scalar -> Integer -> Constant -> Expr = '2_4'
 !PARSE-TREE:     LiteralConstant -> IntLiteralConstant = '2'
@@ -29,7 +29,7 @@ subroutine openmp_interchange(x)
 !PARSE-TREE:     Flags = {}
 !PARSE-TREE:   DoConstruct
 !PARSE-TREE:   EndDoStmt
-!PARSE-TREE: OmpEndLoopDirective
+!PARSE-TREE: OmpEndDirective
 !PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = interchange
 
 END subroutine openmp_interchange

diff  --git a/flang/test/Parser/OpenMP/interchange.f90 b/flang/test/Parser/OpenMP/interchange.f90
index 8aba562724428..d5c7ed6a99b32 100644
--- a/flang/test/Parser/OpenMP/interchange.f90
+++ b/flang/test/Parser/OpenMP/interchange.f90
@@ -20,11 +20,11 @@ subroutine openmp_interchange(x)
 !$omp end interchange
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE:  OmpDirectiveName -> llvm::omp::Directive = interchange
 !PARSE-TREE:   DoConstruct
 !PARSE-TREE:   EndDoStmt
-!PARSE-TREE: OmpEndLoopDirective
+!PARSE-TREE: OmpEndDirective
 !PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = interchange
 
 END subroutine openmp_interchange

diff  --git a/flang/test/Parser/OpenMP/linear-clause.f90 b/flang/test/Parser/OpenMP/linear-clause.f90
index fb02f251fc300..a6f84b3d844aa 100644
--- a/flang/test/Parser/OpenMP/linear-clause.f90
+++ b/flang/test/Parser/OpenMP/linear-clause.f90
@@ -17,7 +17,7 @@ subroutine f00(x)
 !UNPARSE: !$OMP END DO
 !UNPARSE: END SUBROUTINE
 
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Linear -> OmpLinearClause
 !PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'
@@ -41,7 +41,7 @@ subroutine f01(x)
 !UNPARSE: !$OMP END DO
 !UNPARSE: END SUBROUTINE
 
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Linear -> OmpLinearClause
 !PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'
@@ -67,7 +67,7 @@ subroutine f02(x)
 !UNPARSE: !$OMP END DO
 !UNPARSE: END SUBROUTINE
 
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Linear -> OmpLinearClause
 !PARSE-TREE: | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'x'

diff  --git a/flang/test/Parser/OpenMP/loop-transformation-construct01.f90 b/flang/test/Parser/OpenMP/loop-transformation-construct01.f90
index 16154b3bfdf53..e4f2e1810dc3a 100644
--- a/flang/test/Parser/OpenMP/loop-transformation-construct01.f90
+++ b/flang/test/Parser/OpenMP/loop-transformation-construct01.f90
@@ -20,13 +20,13 @@ subroutine loop_transformation_construct
 
 !CHECK-PARSE: | ExecutionPart -> Block
 !CHECK-PARSE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}
 !CHECK-PARSE-NEXT: | | | Block
 !CHECK-PARSE-NEXT: | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = unroll
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList -> OmpClause -> Partial -> Scalar -> Integer -> Constant -> Expr = '1_4'
 !CHECK-PARSE-NEXT: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
@@ -57,11 +57,11 @@ subroutine loop_transformation_construct
 !CHECK-PARSE-NEXT: | | | | | | | | | | | Expr = '5_4'
 !CHECK-PARSE-NEXT: | | | | | | | | | | | | LiteralConstant -> IntLiteralConstant = '5'
 !CHECK-PARSE-NEXT: | | | | | | | EndDoStmt ->
-!CHECK-PARSE-NEXT: | | | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = unroll
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
-!CHECK-PARSE-NEXT: | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}

diff  --git a/flang/test/Parser/OpenMP/loop-transformation-construct02.f90 b/flang/test/Parser/OpenMP/loop-transformation-construct02.f90
index 52a78112b3dc4..460c4895d9ecc 100644
--- a/flang/test/Parser/OpenMP/loop-transformation-construct02.f90
+++ b/flang/test/Parser/OpenMP/loop-transformation-construct02.f90
@@ -22,20 +22,20 @@ subroutine loop_transformation_construct
 
 !CHECK-PARSE: | ExecutionPart -> Block
 !CHECK-PARSE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}
 !CHECK-PARSE-NEXT: | | | Block
 !CHECK-PARSE-NEXT: | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = unroll
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList -> OmpClause -> Partial -> Scalar -> Integer -> Constant -> Expr = '1_4'
 !CHECK-PARSE-NEXT: | | | | | | | LiteralConstant -> IntLiteralConstant = '1'
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
 !CHECK-PARSE-NEXT: | | | | | Block
 !CHECK-PARSE-NEXT: | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | | | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | | | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = tile
 !CHECK-PARSE-NEXT: | | | | | | | | OmpClauseList -> OmpClause -> Sizes -> Scalar -> Integer -> Expr = '2_4'
 !CHECK-PARSE-NEXT: | | | | | | | | | LiteralConstant -> IntLiteralConstant = '2'
@@ -66,15 +66,15 @@ subroutine loop_transformation_construct
 !CHECK-PARSE-NEXT: | | | | | | | | | | | | | Expr = '5_4'
 !CHECK-PARSE-NEXT: | | | | | | | | | | | | | | LiteralConstant -> IntLiteralConstant = '5'
 !CHECK-PARSE-NEXT: | | | | | | | | | EndDoStmt ->
-!CHECK-PARSE-NEXT: | | | | | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | | | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = tile
 !CHECK-PARSE-NEXT: | | | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | | | Flags = {}
-!CHECK-PARSE-NEXT: | | | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = unroll
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
-!CHECK-PARSE-NEXT: | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}

diff  --git a/flang/test/Parser/OpenMP/loop-transformation-construct03.f90 b/flang/test/Parser/OpenMP/loop-transformation-construct03.f90
index 10d87c45b4802..0c94b21d48239 100644
--- a/flang/test/Parser/OpenMP/loop-transformation-construct03.f90
+++ b/flang/test/Parser/OpenMP/loop-transformation-construct03.f90
@@ -20,7 +20,7 @@ subroutine loop_transformation_construct7
 
 !CHECK-PARSE: | ExecutionPart -> Block
 !CHECK-PARSE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = target teams distribute parallel do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList -> OmpClause -> Collapse -> Scalar -> Integer -> Constant -> Expr = '2_4'
 !CHECK-PARSE-NEXT: | | | | | LiteralConstant -> IntLiteralConstant = '2'

diff  --git a/flang/test/Parser/OpenMP/loop-transformation-construct04.f90 b/flang/test/Parser/OpenMP/loop-transformation-construct04.f90
index 4944347ea5bad..daed580910a63 100644
--- a/flang/test/Parser/OpenMP/loop-transformation-construct04.f90
+++ b/flang/test/Parser/OpenMP/loop-transformation-construct04.f90
@@ -22,13 +22,13 @@ subroutine loop_transformation_construct
 
 !CHECK-PARSE: | ExecutionPart -> Block
 !CHECK-PARSE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}
 !CHECK-PARSE-NEXT: | | | Block
 !CHECK-PARSE-NEXT: | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
@@ -55,11 +55,11 @@ subroutine loop_transformation_construct
 !CHECK-PARSE-NEXT: | | | | | | | Block
 !CHECK-PARSE-NEXT: | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> ContinueStmt
 !CHECK-PARSE-NEXT: | | | | | | | EndDoStmt ->
-!CHECK-PARSE-NEXT: | | | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
-!CHECK-PARSE-NEXT: | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}

diff  --git a/flang/test/Parser/OpenMP/loop-transformation-construct05.f90 b/flang/test/Parser/OpenMP/loop-transformation-construct05.f90
index f26679388346c..8a8d1f746cd22 100644
--- a/flang/test/Parser/OpenMP/loop-transformation-construct05.f90
+++ b/flang/test/Parser/OpenMP/loop-transformation-construct05.f90
@@ -24,13 +24,13 @@ subroutine loop_transformation_construct
 
 !CHECK-PARSE: | ExecutionPart -> Block
 !CHECK-PARSE-NEXT: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}
 !CHECK-PARSE-NEXT: | | | Block
 !CHECK-PARSE-NEXT: | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
@@ -47,7 +47,7 @@ subroutine loop_transformation_construct
 !CHECK-PARSE-NEXT: | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> ContinueStmt
 !CHECK-PARSE-NEXT: | | | | | | | EndDoStmt ->
 !CHECK-PARSE-NEXT: | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!CHECK-PARSE-NEXT: | | | | | | | OmpBeginLoopDirective
+!CHECK-PARSE-NEXT: | | | | | | | OmpBeginDirective
 !CHECK-PARSE-NEXT: | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = tile
 !CHECK-PARSE-NEXT: | | | | | | | | OmpClauseList -> OmpClause -> Sizes -> Scalar -> Integer -> Expr = '2_4'
 !CHECK-PARSE-NEXT: | | | | | | | | | LiteralConstant -> IntLiteralConstant = '2'
@@ -64,11 +64,11 @@ subroutine loop_transformation_construct
 !CHECK-PARSE-NEXT: | | | | | | | | | Block
 !CHECK-PARSE-NEXT: | | | | | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> ActionStmt -> ContinueStmt
 !CHECK-PARSE-NEXT: | | | | | | | | | EndDoStmt ->
-!CHECK-PARSE-NEXT: | | | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | | | OmpDirectiveName -> llvm::omp::Directive = fuse
 !CHECK-PARSE-NEXT: | | | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | | | Flags = {}
-!CHECK-PARSE-NEXT: | | | OmpEndLoopDirective
+!CHECK-PARSE-NEXT: | | | OmpEndDirective
 !CHECK-PARSE-NEXT: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 !CHECK-PARSE-NEXT: | | | | OmpClauseList ->
 !CHECK-PARSE-NEXT: | | | | Flags = {}

diff  --git a/flang/test/Parser/OpenMP/masked-unparse.f90 b/flang/test/Parser/OpenMP/masked-unparse.f90
index 7156f4cf94924..655be746c784e 100644
--- a/flang/test/Parser/OpenMP/masked-unparse.f90
+++ b/flang/test/Parser/OpenMP/masked-unparse.f90
@@ -24,7 +24,7 @@ subroutine test_masked()
 
 subroutine test_masked_taskloop_simd()
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = masked taskloop simd
   !CHECK: !$omp masked taskloop simd
   !$omp masked taskloop simd
@@ -36,7 +36,7 @@ subroutine test_masked_taskloop_simd()
 
 subroutine test_masked_taskloop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = masked taskloop
   !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Filter -> Scalar -> Integer -> Expr = '2_4'
   !PARSE-TREE-NEXT: LiteralConstant -> IntLiteralConstant = '2'
@@ -67,7 +67,7 @@ subroutine test_parallel_masked
 
 subroutine test_parallel_masked_taskloop_simd
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel masked taskloop simd
   !CHECK: !$omp parallel masked taskloop simd
   !$omp parallel masked taskloop simd
@@ -79,7 +79,7 @@ subroutine test_parallel_masked_taskloop_simd
 
 subroutine test_parallel_masked_taskloop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel masked taskloop
   !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Filter -> Scalar -> Integer -> Expr = '2_4'
   !PARSE-TREE-NEXT: LiteralConstant -> IntLiteralConstant = '2'

diff  --git a/flang/test/Parser/OpenMP/master-unparse.f90 b/flang/test/Parser/OpenMP/master-unparse.f90
index bee6c9662d247..3651145891230 100644
--- a/flang/test/Parser/OpenMP/master-unparse.f90
+++ b/flang/test/Parser/OpenMP/master-unparse.f90
@@ -16,7 +16,7 @@ subroutine test_master()
 
 subroutine test_master_taskloop_simd()
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = master taskloop simd
   !CHECK: !$omp master taskloop simd
   !$omp master taskloop simd
@@ -28,7 +28,7 @@ subroutine test_master_taskloop_simd()
 
 subroutine test_master_taskloop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = master taskloop
   !CHECK: !$omp master taskloop
   !$omp master taskloop
@@ -50,7 +50,7 @@ subroutine test_parallel_master
 
 subroutine test_parallel_master_taskloop_simd
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel master taskloop simd
   !CHECK: !$omp parallel master taskloop simd
   !$omp parallel master taskloop simd
@@ -62,7 +62,7 @@ subroutine test_parallel_master_taskloop_simd
 
 subroutine test_parallel_master_taskloop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel master taskloop
   !CHECK: !$omp parallel master taskloop
   !$omp parallel master taskloop

diff  --git a/flang/test/Parser/OpenMP/nonblock-do-nested-omp.f90 b/flang/test/Parser/OpenMP/nonblock-do-nested-omp.f90
index c4f580336a79a..7e0760e365ac6 100644
--- a/flang/test/Parser/OpenMP/nonblock-do-nested-omp.f90
+++ b/flang/test/Parser/OpenMP/nonblock-do-nested-omp.f90
@@ -35,7 +35,7 @@ subroutine f
 !PARSE-TREE: | | ImplicitPart ->
 !PARSE-TREE: | ExecutionPart -> Block
 !PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | | | OmpBeginLoopDirective
+!PARSE-TREE: | | | OmpBeginDirective
 !PARSE-TREE: | | | | OmpDirectiveName -> llvm::omp::Directive = parallel do
 !PARSE-TREE: | | | | OmpClauseList -> OmpClause -> Lastprivate -> OmpLastprivateClause
 !PARSE-TREE: | | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'i'
@@ -51,7 +51,7 @@ subroutine f
 !PARSE-TREE: | | | | | | | | LiteralConstant -> IntLiteralConstant = '2'
 !PARSE-TREE: | | | | | Block
 !PARSE-TREE: | | | | | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | | | | | | | OmpBeginLoopDirective
+!PARSE-TREE: | | | | | | | OmpBeginDirective
 !PARSE-TREE: | | | | | | | | OmpDirectiveName -> llvm::omp::Directive = parallel do
 !PARSE-TREE: | | | | | | | | OmpClauseList -> OmpClause -> Lastprivate -> OmpLastprivateClause
 !PARSE-TREE: | | | | | | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'j'

diff  --git a/flang/test/Parser/OpenMP/order-clause01.f90 b/flang/test/Parser/OpenMP/order-clause01.f90
index 5fc1b580b64f2..4abf36553b8d0 100644
--- a/flang/test/Parser/OpenMP/order-clause01.f90
+++ b/flang/test/Parser/OpenMP/order-clause01.f90
@@ -14,7 +14,7 @@ subroutine test_do_order()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: Ordering = Concurrent
@@ -31,7 +31,7 @@ subroutine test_simd_order_reproducible()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Reproducible
@@ -49,7 +49,7 @@ subroutine test_do_simd_order_unconstrained()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = do simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Unconstrained
@@ -67,7 +67,7 @@ subroutine test_parallel_do_order()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel do
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: Ordering = Concurrent
@@ -84,7 +84,7 @@ subroutine test_parallel_do_simd_order_reproducible()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel do simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Reproducible
@@ -102,7 +102,7 @@ subroutine test_target_simd_order_unconstrained()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Unconstrained
@@ -120,7 +120,7 @@ subroutine test_target_parallel_do_order()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target parallel do
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: Ordering = Concurrent
@@ -137,7 +137,7 @@ subroutine test_target_parallel_do_simd_order_reproducible()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target parallel do simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Reproducible
@@ -155,7 +155,7 @@ subroutine test_teams_distribute_simd_order_unconstrained()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = teams distribute simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Unconstrained
@@ -173,7 +173,7 @@ subroutine test_teams_distribute_parallel_do_order()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = teams distribute parallel do
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: Ordering = Concurrent
@@ -190,7 +190,7 @@ subroutine test_teams_distribute_parallel_do_simd_order_reproducible()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = teams distribute parallel do simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Reproducible
@@ -208,7 +208,7 @@ subroutine test_target_teams_distribute_simd_order_unconstrained()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target teams distribute simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Unconstrained
@@ -226,7 +226,7 @@ subroutine test_target_teams_distribute_parallel_do_order()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target teams distribute parallel do
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: Ordering = Concurrent
@@ -243,7 +243,7 @@ subroutine test_target_teams_distribute_parallel_do_simd_order_reproducible()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target teams distribute parallel do simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Reproducible
@@ -261,7 +261,7 @@ subroutine test_taskloop_simd_order_unconstrained()
 end subroutine
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE-NEXT: OmpBeginLoopDirective
+!PARSE-TREE-NEXT: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = taskloop simd
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Order -> OmpOrderClause
 !PARSE-TREE-NEXT: OmpOrderModifier -> Value = Unconstrained

diff  --git a/flang/test/Parser/OpenMP/ordered-depend.f90 b/flang/test/Parser/OpenMP/ordered-depend.f90
index 4826d134362c8..aa2ef044f4c20 100644
--- a/flang/test/Parser/OpenMP/ordered-depend.f90
+++ b/flang/test/Parser/OpenMP/ordered-depend.f90
@@ -26,7 +26,7 @@ subroutine f00(x)
 !UNPARSE: END SUBROUTINE
 
 !PARSE-TREE-LABEL: ProgramUnit -> SubroutineSubprogram
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Ordered -> Scalar -> Integer -> Constant -> Expr = '2_4'
 !PARSE-TREE: | | LiteralConstant -> IntLiteralConstant = '2'
@@ -60,7 +60,7 @@ subroutine f01(x)
 !UNPARSE: END SUBROUTINE
 
 !PARSE-TREE-LABEL: ProgramUnit -> SubroutineSubprogram
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = do
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Ordered -> Scalar -> Integer -> Constant -> Expr = '2_4'
 !PARSE-TREE: | | LiteralConstant -> IntLiteralConstant = '2'

diff  --git a/flang/test/Parser/OpenMP/parallel-loop-unparse.f90 b/flang/test/Parser/OpenMP/parallel-loop-unparse.f90
index 12efe8f80c946..0c4864cacec89 100644
--- a/flang/test/Parser/OpenMP/parallel-loop-unparse.f90
+++ b/flang/test/Parser/OpenMP/parallel-loop-unparse.f90
@@ -8,7 +8,7 @@
 
 subroutine test_parallel_loop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel loop
   !CHECK: !$omp parallel loop
   !$omp parallel loop
@@ -19,14 +19,14 @@ subroutine test_parallel_loop
 
 subroutine test_parallel_loop_with_end
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel loop
   !CHECK: !$omp parallel loop
   !$omp parallel loop
   do i=1,10
    j = j + 1
   end do
-  !PARSE-TREE: OmpEndLoopDirective
+  !PARSE-TREE: OmpEndDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel loop
   !CHECK: !$omp end parallel loop
   !$omp end parallel loop
@@ -34,7 +34,7 @@ subroutine test_parallel_loop_with_end
 
 subroutine test_parallel_loop_with_clauses
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel loop
   !CHECK: !$omp parallel loop num_threads(4_4) collapse(1_4) private(j) default(shared)
   !$omp parallel loop num_threads(4) collapse(1) private(j) default(shared)
@@ -46,7 +46,7 @@ subroutine test_parallel_loop_with_clauses
 subroutine test_parallel_loop_with_reduction
   integer :: i, total
   total = 0
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel loop
   !CHECK: !$omp parallel loop reduction(+: total)
   !$omp parallel loop reduction(+:total)
@@ -59,7 +59,7 @@ subroutine test_parallel_loop_with_if
   integer :: i, j = 1
   logical :: cond
   cond = .true.
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = parallel loop
   !CHECK: !$omp parallel loop if(cond) proc_bind(close)
   !$omp parallel loop if(cond) proc_bind(close)

diff  --git a/flang/test/Parser/OpenMP/reduction-modifier.f90 b/flang/test/Parser/OpenMP/reduction-modifier.f90
index 8c7d5b1472018..9e98fdea0cdb1 100644
--- a/flang/test/Parser/OpenMP/reduction-modifier.f90
+++ b/flang/test/Parser/OpenMP/reduction-modifier.f90
@@ -6,7 +6,7 @@ subroutine foo()
   j = 0
 ! CHECK: !$OMP DO  REDUCTION(TASK, *: j)
 ! PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-! PARSE-TREE: | | | OmpBeginLoopDirective
+! PARSE-TREE: | | | OmpBeginDirective
 ! PARSE-TREE: | | | | OmpDirectiveName -> llvm::omp::Directive = do
 ! PARSE-TREE: | | | | OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause
 ! PARSE-TREE: | | | | | Modifier -> OmpReductionModifier -> Value = Task

diff  --git a/flang/test/Parser/OpenMP/target-loop-unparse.f90 b/flang/test/Parser/OpenMP/target-loop-unparse.f90
index 142bcabf0894b..e20edad41043c 100644
--- a/flang/test/Parser/OpenMP/target-loop-unparse.f90
+++ b/flang/test/Parser/OpenMP/target-loop-unparse.f90
@@ -8,7 +8,7 @@
 
 subroutine test_loop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = loop
   !CHECK: !$omp loop
   !$omp loop
@@ -17,7 +17,7 @@ subroutine test_loop
   end do
   !$omp end loop
 
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = loop
   !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Bind -> OmpBindClause -> Binding = Thread
   !CHECK: !$omp loop
@@ -30,7 +30,7 @@ subroutine test_loop
 
 subroutine test_target_loop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target loop
   !CHECK: !$omp target loop
   !$omp target loop
@@ -42,7 +42,7 @@ subroutine test_target_loop
 
 subroutine test_target_teams_loop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target teams loop
   !CHECK: !$omp target teams loop
   !$omp target teams loop
@@ -54,7 +54,7 @@ subroutine test_target_teams_loop
 
 subroutine test_target_parallel_loop
   integer :: i, j = 1
-  !PARSE-TREE: OmpBeginLoopDirective
+  !PARSE-TREE: OmpBeginDirective
   !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = target parallel loop
   !CHECK: !$omp target parallel loop
   !$omp target parallel loop

diff  --git a/flang/test/Parser/OpenMP/taskloop.f90 b/flang/test/Parser/OpenMP/taskloop.f90
index 3ea91daae160e..6a7a9c3637987 100644
--- a/flang/test/Parser/OpenMP/taskloop.f90
+++ b/flang/test/Parser/OpenMP/taskloop.f90
@@ -5,7 +5,7 @@ subroutine parallel_work
   integer :: i
 
 !CHECK: !$OMP TASKLOOP  GRAINSIZE(STRICT: 500_4)
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = taskloop
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Grainsize -> OmpGrainsizeClause
 !PARSE-TREE-NEXT: Modifier -> OmpPrescriptiveness -> Value = Strict
@@ -17,7 +17,7 @@ subroutine parallel_work
   !$omp end taskloop
 
 !CHECK: !$OMP TASKLOOP  GRAINSIZE(500_4)
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = taskloop
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> Grainsize -> OmpGrainsizeClause
 !PARSE-TREE-NEXT: Scalar -> Integer -> Expr = '500_4'
@@ -28,7 +28,7 @@ subroutine parallel_work
   !$omp end taskloop
 
 !CHECK: !$OMP TASKLOOP  NUM_TASKS(STRICT: 500_4)
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE-NEXT: OmpDirectiveName -> llvm::omp::Directive = taskloop
 !PARSE-TREE-NEXT: OmpClauseList -> OmpClause -> NumTasks -> OmpNumTasksClause
 !PARSE-TREE-NEXT: Modifier -> OmpPrescriptiveness -> Value = Strict

diff  --git a/flang/test/Parser/OpenMP/threadset-clause.f90 b/flang/test/Parser/OpenMP/threadset-clause.f90
index 3f19302c3ca1f..fbbbb981864fe 100644
--- a/flang/test/Parser/OpenMP/threadset-clause.f90
+++ b/flang/test/Parser/OpenMP/threadset-clause.f90
@@ -54,7 +54,7 @@ subroutine f002(x)
 !UNPARSE: !$OMP END TASK
 !UNPARSE: END SUBROUTINE
 
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = taskloop
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Team
 
@@ -74,6 +74,6 @@ subroutine f003(x)
 !UNPARSE: !$OMP END TASK
 !UNPARSE: END SUBROUTINE
 
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: | OmpDirectiveName -> llvm::omp::Directive = taskloop
 !PARSE-TREE: | OmpClauseList -> OmpClause -> Threadset -> OmpThreadsetClause -> ThreadsetPolicy = Omp_Pool

diff  --git a/flang/test/Parser/OpenMP/tile-size.f90 b/flang/test/Parser/OpenMP/tile-size.f90
index 5110493de4a0c..28d9d4e7497ca 100644
--- a/flang/test/Parser/OpenMP/tile-size.f90
+++ b/flang/test/Parser/OpenMP/tile-size.f90
@@ -17,7 +17,7 @@ subroutine openmp_tiles(x)
 
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = tile
 !PARSE-TREE: OmpClauseList -> OmpClause -> Sizes -> Scalar -> Integer -> Expr = '2_4'
 END subroutine openmp_tiles

diff  --git a/flang/test/Parser/OpenMP/tile.f90 b/flang/test/Parser/OpenMP/tile.f90
index 483261f9d6d98..83a81893d4402 100644
--- a/flang/test/Parser/OpenMP/tile.f90
+++ b/flang/test/Parser/OpenMP/tile.f90
@@ -16,13 +16,13 @@ subroutine openmp_tiles(x)
 !$omp end tile
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE:   OmpClauseList -> OmpClause -> Sizes -> Scalar -> Integer -> Expr = '2_4'
 !PARSE-TREE:     LiteralConstant -> IntLiteralConstant = '2'
 !PARSE-TREE:     Flags = {}
 !PARSE-TREE:   DoConstruct
 !PARSE-TREE:   EndDoStmt
-!PARSE-TREE: OmpEndLoopDirective
+!PARSE-TREE: OmpEndDirective
 !PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = tile
 
 END subroutine openmp_tiles

diff  --git a/flang/test/Parser/OpenMP/transparent-clause.f90 b/flang/test/Parser/OpenMP/transparent-clause.f90
index f9471b55e6c83..5581180631dfc 100644
--- a/flang/test/Parser/OpenMP/transparent-clause.f90
+++ b/flang/test/Parser/OpenMP/transparent-clause.f90
@@ -69,7 +69,7 @@ subroutine f02
 !UNPARSE: END SUBROUTINE
 
 !PARSE-TREE: ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: | OmpBeginLoopDirective
+!PARSE-TREE: | OmpBeginDirective
 !PARSE-TREE: | | OmpDirectiveName -> llvm::omp::Directive = taskloop
 !PARSE-TREE: | | OmpClauseList -> OmpClause -> Transparent -> OmpTransparentClause -> Scalar -> Integer -> Expr = '2_4'
 !PARSE-TREE: | | | LiteralConstant -> IntLiteralConstant = '2'

diff  --git a/flang/test/Parser/OpenMP/unroll-full.f90 b/flang/test/Parser/OpenMP/unroll-full.f90
index 80b2cac296fee..9dc62612026c2 100644
--- a/flang/test/Parser/OpenMP/unroll-full.f90
+++ b/flang/test/Parser/OpenMP/unroll-full.f90
@@ -16,7 +16,7 @@ subroutine openmp_parse_unroll(x)
 !$omp end unroll
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = unroll
 !PARSE-TREE: OmpClauseList -> OmpClause -> Full
 END subroutine openmp_parse_unroll

diff  --git a/flang/test/Parser/OpenMP/unroll-heuristic.f90 b/flang/test/Parser/OpenMP/unroll-heuristic.f90
index 6ce7b7e12c8a6..caf4ab492c91e 100644
--- a/flang/test/Parser/OpenMP/unroll-heuristic.f90
+++ b/flang/test/Parser/OpenMP/unroll-heuristic.f90
@@ -19,7 +19,7 @@ END subroutine openmp_parse_unroll_heuristic
 !UNPARSE-NEXT: !$OMP END UNROLL
 
 !PTREE:      OpenMPConstruct -> OpenMPLoopConstruct
-!PTREE-NEXT: | OmpBeginLoopDirective
+!PTREE-NEXT: | OmpBeginDirective
 !PTREE-NEXT: | | OmpDirectiveName -> llvm::omp::Directive = unroll
 !PTREE-NEXT: | | OmpClauseList ->
 !PTREE-NEXT: | | Flags = {}
@@ -40,7 +40,7 @@ END subroutine openmp_parse_unroll_heuristic
 !PTREE-NEXT: | | | | | | | ActualArg -> Expr = 'i'
 !PTREE-NEXT: | | | | | | | | Designator -> DataRef -> Name = 'i'
 !PTREE-NEXT: | | | EndDoStmt ->
-!PTREE-NEXT: | OmpEndLoopDirective
+!PTREE-NEXT: | OmpEndDirective
 !PTREE-NEXT: | | OmpDirectiveName -> llvm::omp::Directive = unroll
 !PTREE-NEXT: | | OmpClauseList ->
 !PTREE-NEXT: | | Flags = {}

diff  --git a/flang/test/Parser/OpenMP/unroll-partial.f90 b/flang/test/Parser/OpenMP/unroll-partial.f90
index 59dffb63cee6c..c43183cf4a129 100644
--- a/flang/test/Parser/OpenMP/unroll-partial.f90
+++ b/flang/test/Parser/OpenMP/unroll-partial.f90
@@ -16,7 +16,7 @@ subroutine openmp_parse_unroll(x)
 !$omp end unroll
 
 !PARSE-TREE: OpenMPConstruct -> OpenMPLoopConstruct
-!PARSE-TREE: OmpBeginLoopDirective
+!PARSE-TREE: OmpBeginDirective
 !PARSE-TREE: OmpDirectiveName -> llvm::omp::Directive = unroll
 !PARSE-TREE: OmpClauseList -> OmpClause -> Partial -> Scalar -> Integer -> Constant -> Expr = '3_4'
 !PARSE-TREE: LiteralConstant -> IntLiteralConstant = '3'

diff  --git a/flang/unittests/Semantics/OpenMPUtils.cpp b/flang/unittests/Semantics/OpenMPUtils.cpp
index 32664388ef4d0..6506c064127c9 100644
--- a/flang/unittests/Semantics/OpenMPUtils.cpp
+++ b/flang/unittests/Semantics/OpenMPUtils.cpp
@@ -134,7 +134,7 @@ TEST_F(OpenMPUtilsTest, AffectedNestDepthNoClauses) {
     // | | ImplicitPart ->
     // | ExecutionPart -> Block
     // | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct
-    // | | | OmpBeginLoopDirective
+    // | | | OmpBeginDirective
     // | | | | OmpDirectiveName -> llvm::omp::Directive = do
     // | | | | OmpClauseList ->
     // | | | | Flags = {}


        


More information about the flang-commits mailing list