[flang-commits] [flang] dcd6207 - [Flang][OpenMP] Error gracefully for dependence-type with depobj (#116621)

via flang-commits flang-commits at lists.llvm.org
Mon Nov 18 08:10:54 PST 2024


Author: Kiran Chandramohan
Date: 2024-11-18T16:10:50Z
New Revision: dcd62070cf45f793f321fecdb4139a79628c4132

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

LOG: [Flang][OpenMP] Error gracefully for dependence-type with depobj (#116621)

It also modifies the error message to specify it is the dependence-type
that is not supported.

Resolves the crash in
https://github.com/llvm/llvm-project/issues/115647. A fix can come in
later as part of future OpenMP version support.

Added: 
    flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90

Modified: 
    flang/lib/Lower/OpenMP/ClauseProcessor.cpp
    flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90
    flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90

Removed: 
    


################################################################################
diff  --git a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
index d235f2313c6d65..0f2e849c2c6a0e 100644
--- a/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
+++ b/flang/lib/Lower/OpenMP/ClauseProcessor.cpp
@@ -158,9 +158,10 @@ genDependKindAttr(lower::AbstractConverter &converter,
     break;
   case omp::clause::DependenceType::Mutexinoutset:
   case omp::clause::DependenceType::Inoutset:
-    TODO(currentLocation, "INOUTSET and MUTEXINOUTSET are not supported yet");
-    break;
   case omp::clause::DependenceType::Depobj:
+    TODO(currentLocation,
+         "INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types");
+    break;
   case omp::clause::DependenceType::Sink:
   case omp::clause::DependenceType::Source:
     llvm_unreachable("unhandled parser task dependence type");

diff  --git a/flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90 b/flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90
new file mode 100644
index 00000000000000..3bc730f849192b
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/depend-clause-depobj.f90
@@ -0,0 +1,10 @@
+!RUN: %not_todo_cmd bbc -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s
+!RUN: %not_todo_cmd %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s
+
+!CHECK: not yet implemented: INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types
+
+subroutine f00(x)
+  integer :: x
+  !$omp task depend(depobj: x)
+  !$omp end task
+end

diff  --git a/flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90 b/flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90
index 017df006308331..160893fccdc5f2 100644
--- a/flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90
+++ b/flang/test/Lower/OpenMP/Todo/depend-clause-inoutset.f90
@@ -1,7 +1,7 @@
 !RUN: %not_todo_cmd bbc -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s
 !RUN: %not_todo_cmd %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s
 
-!CHECK: not yet implemented: INOUTSET and MUTEXINOUTSET are not supported yet
+!CHECK: not yet implemented: INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types
 subroutine f00(x)
   integer :: x
   !$omp task depend(inoutset: x)

diff  --git a/flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90 b/flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90
index 2f6ff77b20a88c..17cc3894c548f1 100644
--- a/flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90
+++ b/flang/test/Lower/OpenMP/Todo/depend-clause-mutexinoutset.f90
@@ -1,7 +1,7 @@
 !RUN: %not_todo_cmd bbc -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s
 !RUN: %not_todo_cmd %flang_fc1 -emit-hlfir -fopenmp -fopenmp-version=52 -o - %s 2>&1 | FileCheck %s
 
-!CHECK: not yet implemented: INOUTSET and MUTEXINOUTSET are not supported yet
+!CHECK: not yet implemented: INOUTSET, MUTEXINOUTSET and DEPOBJ dependence-types
 subroutine f00(x)
   integer :: x
   !$omp task depend(mutexinoutset: x)


        


More information about the flang-commits mailing list