[Mlir-commits] [mlir] 927a70d - Revert "[Flang OpenMP] Add LLVM translation support for UNTIED in Task (#115283)"
Muhammad Omair Javaid
llvmlistbot at llvm.org
Mon Dec 23 12:53:42 PST 2024
Author: Muhammad Omair Javaid
Date: 2024-12-24T01:47:24+05:00
New Revision: 927a70daf31b1610627f346b0dc140eda72144b9
URL: https://github.com/llvm/llvm-project/commit/927a70daf31b1610627f346b0dc140eda72144b9
DIFF: https://github.com/llvm/llvm-project/commit/927a70daf31b1610627f346b0dc140eda72144b9.diff
LOG: Revert "[Flang OpenMP] Add LLVM translation support for UNTIED in Task (#115283)"
This reverts commit 919aead1db64b2f1444842bc75a3af7836238671.
It breaks following LLVM bots:
https://lab.llvm.org/buildbot/#/builders/199
https://lab.llvm.org/buildbot/#/builders/143
https://lab.llvm.org/buildbot/#/builders/17
Added:
flang/test/Lower/OpenMP/Todo/task_untied.f90
Modified:
flang/lib/Lower/OpenMP/OpenMP.cpp
flang/test/Lower/OpenMP/task.f90
mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
mlir/test/Target/LLVMIR/openmp-llvm.mlir
mlir/test/Target/LLVMIR/openmp-todo.mlir
Removed:
################################################################################
diff --git a/flang/lib/Lower/OpenMP/OpenMP.cpp b/flang/lib/Lower/OpenMP/OpenMP.cpp
index 4de5ecf187a4cb..b07e89d201d198 100644
--- a/flang/lib/Lower/OpenMP/OpenMP.cpp
+++ b/flang/lib/Lower/OpenMP/OpenMP.cpp
@@ -2867,7 +2867,6 @@ static void genOMP(lower::AbstractConverter &converter, lower::SymMap &symTable,
!std::holds_alternative<clause::UseDevicePtr>(clause.u) &&
!std::holds_alternative<clause::InReduction>(clause.u) &&
!std::holds_alternative<clause::Mergeable>(clause.u) &&
- !std::holds_alternative<clause::Untied>(clause.u) &&
!std::holds_alternative<clause::TaskReduction>(clause.u) &&
!std::holds_alternative<clause::Detach>(clause.u)) {
std::string name =
diff --git a/flang/test/Lower/OpenMP/Todo/task_untied.f90 b/flang/test/Lower/OpenMP/Todo/task_untied.f90
new file mode 100644
index 00000000000000..87d242ba3e9d21
--- /dev/null
+++ b/flang/test/Lower/OpenMP/Todo/task_untied.f90
@@ -0,0 +1,13 @@
+! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
+! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s
+
+!===============================================================================
+! `untied` clause
+!===============================================================================
+
+! CHECK: not yet implemented: UNTIED clause is not implemented yet
+subroutine omp_task_untied()
+ !$omp task untied
+ call foo()
+ !$omp end task
+end subroutine omp_task_untied
diff --git a/flang/test/Lower/OpenMP/task.f90 b/flang/test/Lower/OpenMP/task.f90
index a8cc16c540c9c8..6e525a044b011e 100644
--- a/flang/test/Lower/OpenMP/task.f90
+++ b/flang/test/Lower/OpenMP/task.f90
@@ -235,10 +235,6 @@ subroutine task_multiple_clauses()
!$omp end task
end subroutine task_multiple_clauses
-!===============================================================================
-! `mergeable` clause
-!===============================================================================
-
subroutine task_mergeable()
!CHECK: omp.task mergeable {
!CHECK: omp.terminator
@@ -246,16 +242,3 @@ subroutine task_mergeable()
!$omp task mergeable
!$omp end task
end subroutine
-
-!===============================================================================
-! `untied` clause
-!===============================================================================
-
-!CHECK-LABEL: func.func @_QPomp_task_untied() {
-subroutine omp_task_untied()
- !CHECK: omp.task untied {
- !$omp task untied
- call foo()
- !CHECK: omp.terminator
- !$omp end task
-end subroutine omp_task_untied
diff --git a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
index d591c98a5497f8..060113c4123241 100644
--- a/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/Dialect/OpenMP/OpenMPToLLVMIRTranslation.cpp
@@ -258,6 +258,7 @@ static LogicalResult checkImplementationStatus(Operation &op) {
checkAllocate(op, result);
checkInReduction(op, result);
checkPriority(op, result);
+ checkUntied(op, result);
})
.Case([&](omp::TaskgroupOp op) {
checkAllocate(op, result);
@@ -267,10 +268,6 @@ static LogicalResult checkImplementationStatus(Operation &op) {
checkDepend(op, result);
checkNowait(op, result);
})
- .Case([&](omp::TaskloopOp op) {
- // TODO: Add other clauses check
- checkUntied(op, result);
- })
.Case([&](omp::WsloopOp op) {
checkAllocate(op, result);
checkLinear(op, result);
diff --git a/mlir/test/Target/LLVMIR/openmp-llvm.mlir b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
index 8903bf283b5c75..5f8bdf8afdf783 100644
--- a/mlir/test/Target/LLVMIR/openmp-llvm.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-llvm.mlir
@@ -3020,18 +3020,6 @@ module attributes {omp.is_target_device = true} {
// -----
-llvm.func @omp_task_untied() {
- // The third argument is 0: which signifies the united task
- // CHECK: {{.*}} = call ptr @__kmpc_omp_task_alloc(ptr @1, i32 %{{.*}}, i32 0,
- // CHECK-SAME: i64 40, i64 0, ptr @{{.*}})
- omp.task untied {
- omp.terminator
- }
- llvm.return
-}
-
-// -----
-
// Third argument is 5: essentially (4 || 1)
// signifying this task is TIED and MERGEABLE
diff --git a/mlir/test/Target/LLVMIR/openmp-todo.mlir b/mlir/test/Target/LLVMIR/openmp-todo.mlir
index 8ae795ec1ec6b0..8f3e466cfbbeb6 100644
--- a/mlir/test/Target/LLVMIR/openmp-todo.mlir
+++ b/mlir/test/Target/LLVMIR/openmp-todo.mlir
@@ -440,6 +440,17 @@ llvm.func @task_priority(%x : i32) {
// -----
+llvm.func @task_untied() {
+ // expected-error at below {{not yet implemented: Unhandled clause untied in omp.task operation}}
+ // expected-error at below {{LLVM Translation failed for operation: omp.task}}
+ omp.task untied {
+ omp.terminator
+ }
+ llvm.return
+}
+
+// -----
+
llvm.func @taskgroup_allocate(%x : !llvm.ptr) {
// expected-error at below {{not yet implemented: Unhandled clause allocate in omp.taskgroup operation}}
// expected-error at below {{LLVM Translation failed for operation: omp.taskgroup}}
@@ -492,19 +503,6 @@ llvm.func @taskloop(%lb : i32, %ub : i32, %step : i32) {
// -----
-llvm.func @taskloop_untied(%lb : i32, %ub : i32, %step : i32) {
- // expected-error at below {{not yet implemented: omp.taskloop}}
- // expected-error at below {{LLVM Translation failed for operation: omp.taskloop}}
- omp.taskloop untied {
- omp.loop_nest (%iv) : i32 = (%lb) to (%ub) step (%step) {
- omp.yield
- }
- }
- llvm.return
-}
-
-// -----
-
llvm.func @taskwait_depend(%x: !llvm.ptr) {
// expected-error at below {{not yet implemented: Unhandled clause depend in omp.taskwait operation}}
// expected-error at below {{LLVM Translation failed for operation: omp.taskwait}}
More information about the Mlir-commits
mailing list