Skip to content

Conversation

@kparzysz
Copy link
Contributor

No description provided.

@llvmbot llvmbot added flang Flang issues not falling into any other category flang:openmp flang:semantics labels Nov 11, 2025
@llvmbot
Copy link
Member

llvmbot commented Nov 11, 2025

@llvm/pr-subscribers-flang-semantics

@llvm/pr-subscribers-flang-openmp

Author: Krzysztof Parzyszek (kparzysz)

Changes

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

2 Files Affected:

  • (modified) flang/lib/Semantics/resolve-directives.cpp (+3-4)
  • (added) flang/test/Semantics/OpenMP/target-loop-still-there.f90 (+10)
diff --git a/flang/lib/Semantics/resolve-directives.cpp b/flang/lib/Semantics/resolve-directives.cpp index 224c69163b85e..411291bcd0c3a 100644 --- a/flang/lib/Semantics/resolve-directives.cpp +++ b/flang/lib/Semantics/resolve-directives.cpp @@ -2038,8 +2038,7 @@ bool OmpAttributeVisitor::Pre(const parser::OpenMPLoopConstruct &x) { if (beginName.v == llvm::omp::OMPD_master_taskloop || beginName.v == llvm::omp::OMPD_master_taskloop_simd || beginName.v == llvm::omp::OMPD_parallel_master_taskloop || - beginName.v == llvm::omp::OMPD_parallel_master_taskloop_simd || - beginName.v == llvm::omp::Directive::OMPD_target_loop) { + beginName.v == llvm::omp::OMPD_parallel_master_taskloop_simd) { unsigned version{context_.langOptions().OpenMPVersion}; IssueNonConformanceWarning(beginName.v, beginName.source, version); } @@ -3669,8 +3668,8 @@ void OmpAttributeVisitor::IssueNonConformanceWarning(llvm::omp::Directive D, case llvm::omp::OMPD_allocate: setAlternativeStr("ALLOCATORS"); break; - case llvm::omp::OMPD_target_loop: - default:; + default: + break; } context_.Warn(common::UsageWarning::OpenMPUsage, source, "%s"_warn_en_US, warnStrOS.str()); diff --git a/flang/test/Semantics/OpenMP/target-loop-still-there.f90 b/flang/test/Semantics/OpenMP/target-loop-still-there.f90 new file mode 100644 index 0000000000000..2d3b1820e23d4 --- /dev/null +++ b/flang/test/Semantics/OpenMP/target-loop-still-there.f90 @@ -0,0 +1,10 @@ +!RUN: %flang_fc1 -fsyntax-only -fopenmp -fopenmp-version=60 -Werror %s | FileCheck --allow-empty %s + +!CHECK-NOT: deprecated +subroutine f00 + implicit none + integer :: i + !$omp target loop + do i = 1, 10 + end do +end 
@kparzysz
Copy link
Contributor Author

Ping. @anchuraj, you wrote the original code, could you take a look?

@anchuraj
Copy link
Contributor

anchuraj commented Nov 17, 2025

Can you remove target_loop from https://github.com/llvm/llvm-project/blob/main/flang/lib/Semantics/resolve-directives.cpp#L3625. Otherwise it LGTM. Please feel free to merge after the change.

@kparzysz
Copy link
Contributor Author

Can you remove target_loop from https://github.com/llvm/llvm-project/blob/main/flang/lib/Semantics/resolve-directives.cpp#L3625. Otherwise it LGTM. Please feel free to merge after the change.

Yes, that's the change at lines 3672-3673.

@kparzysz kparzysz merged commit 4be0ab6 into main Nov 17, 2025
14 checks passed
@kparzysz kparzysz deleted the users/kparzysz/target-loop branch November 17, 2025 18:23
aadeshps-mcw pushed a commit to aadeshps-mcw/llvm-project that referenced this pull request Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

flang:openmp flang:semantics flang Flang issues not falling into any other category

4 participants