Skip to content

[flang][OpenMP] Don't check unlabelled cycle branching for target loops #111656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions flang/lib/Semantics/check-directive-structure.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ template <typename D> class NoBranchingEnforce {
case llvm::omp::Directive::OMPD_distribute_parallel_for:
case llvm::omp::Directive::OMPD_distribute_simd:
case llvm::omp::Directive::OMPD_distribute_parallel_for_simd:
case llvm::omp::Directive::OMPD_target_teams_distribute_parallel_do:
case llvm::omp::Directive::
OMPD_target_teams_distribute_parallel_do_simd:
Copy link
Contributor

Choose a reason for hiding this comment

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

Stray formatting change?

Copy link
Member Author

Choose a reason for hiding this comment

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

Nope, our formatting rules demand this.

return;
default:
break;
Expand Down
15 changes: 15 additions & 0 deletions flang/test/Semantics/OpenMP/do05-positivecase.f90
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,19 @@ program omp_do
end do
!$omp end parallel

!$omp target teams distribute parallel do
!DEF:/omp_do/OtherConstruct4/i (OmpPrivate ,OmpPreDetermined) HostAssoc INTEGER(4)
do i=1,100
!REF:/omp_do/OtherConstruct4/i
if(i<10) cycle
end do
!$omp end target teams distribute parallel do

!$omp target teams distribute parallel do simd
!DEF:/omp_do/OtherConstruct5/i (OmpLinear,OmpPreDetermined) HostAssoc INTEGER(4)
do i=1,100
!REF:/omp_do/OtherConstruct5/i
if(i<10) cycle
end do
!$omp end target teams distribute parallel do simd
end program omp_do
Loading