[flang-commits] [flang] [flang][OpenMP] Undeprecate accidentally deprecated TARGET LOOP (PR #167495)

via flang-commits flang-commits at lists.llvm.org
Tue Nov 11 04:18:14 PST 2025


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-flang-semantics

@llvm/pr-subscribers-flang-openmp

Author: Krzysztof Parzyszek (kparzysz)

<details>
<summary>Changes</summary>



---
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
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

``````````

</details>


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


More information about the flang-commits mailing list