Skip to content

[flang][OpenMP] Remove OmpEndLoopDirective from PFT#193602

Merged
kparzysz merged 1 commit intomainfrom
users/kparzysz/end-loop-directive
Apr 23, 2026
Merged

[flang][OpenMP] Remove OmpEndLoopDirective from PFT#193602
kparzysz merged 1 commit intomainfrom
users/kparzysz/end-loop-directive

Conversation

@kparzysz
Copy link
Copy Markdown
Contributor

It's no longer necessary. An end-directive for a loop construct used to be a separate construct, but now it only exists as a member in OpenMPLoopConstruct.

It's no longer necessary. An end-directive for a loop construct used
to be a separate construct, but now it only exists as a member in
OpenMPLoopConstruct.
@kparzysz kparzysz changed the title [flang][OpenMP] Remove OmpEndLoopDiretive from PFT [flang][OpenMP] Remove OmpEndLoopDirective from PFT Apr 22, 2026
@llvmbot llvmbot added flang Flang issues not falling into any other category flang:fir-hlfir labels Apr 22, 2026
@llvmbot
Copy link
Copy Markdown
Member

llvmbot commented Apr 22, 2026

@llvm/pr-subscribers-flang-fir-hlfir

Author: Krzysztof Parzyszek (kparzysz)

Changes

It's no longer necessary. An end-directive for a loop construct used to be a separate construct, but now it only exists as a member in OpenMPLoopConstruct.


Full diff: https://github.com/llvm/llvm-project/pull/193602.diff

3 Files Affected:

  • (modified) flang/include/flang/Lower/PFTBuilder.h (+1-1)
  • (modified) flang/lib/Lower/OpenMP/OpenMP.cpp (-3)
  • (modified) flang/test/Lower/pre-fir-tree03.f90 (-1)
diff --git a/flang/include/flang/Lower/PFTBuilder.h b/flang/include/flang/Lower/PFTBuilder.h
index 55a755acaaeb7..840bbf705ff4a 100644
--- a/flang/include/flang/Lower/PFTBuilder.h
+++ b/flang/include/flang/Lower/PFTBuilder.h
@@ -141,7 +141,7 @@ using Directives =
     std::tuple<parser::CompilerDirective, parser::OpenACCConstruct,
                parser::OpenACCRoutineConstruct,
                parser::OpenACCDeclarativeConstruct, parser::OpenMPConstruct,
-               parser::OpenMPDeclarativeConstruct, parser::OmpEndLoopDirective,
+               parser::OpenMPDeclarativeConstruct,
                parser::CUFKernelDoConstruct>;
 
 using DeclConstructs = std::tuple<parser::OpenMPDeclarativeConstruct,
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 5cdb54a07fecd..ca0dc97cf2841 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -2391,9 +2391,6 @@ static void genFuseOp(Fortran::lower::AbstractConverter &converter,
 
   llvm::SmallVector<mlir::Value> applyees;
   for (auto &child : eval.getNestedEvaluations()) {
-    // Stop at OmpEndLoopDirective
-    if (&child == &eval.getLastNestedEvaluation())
-      break;
     // Skip any Compiler Directive
     if (child.getIf<parser::CompilerDirective>())
       continue;
diff --git a/flang/test/Lower/pre-fir-tree03.f90 b/flang/test/Lower/pre-fir-tree03.f90
index 1de66e3f8d016..03268ba0782d5 100644
--- a/flang/test/Lower/pre-fir-tree03.f90
+++ b/flang/test/Lower/pre-fir-tree03.f90
@@ -21,7 +21,6 @@ program test_omp
     ! CHECK: EndDoStmt
     end do
     ! CHECK: <<End DoConstruct>>
-    ! CHECK: OmpEndLoopDirective
     !$omp end do
     ! CHECK: <<End OpenMPConstruct>>
 

Copy link
Copy Markdown
Member

@Meinersbur Meinersbur left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kparzysz kparzysz merged commit 43aa40d into main Apr 23, 2026
13 checks passed
@kparzysz kparzysz deleted the users/kparzysz/end-loop-directive branch April 23, 2026 12:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:fir-hlfir flang Flang issues not falling into any other category

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants