-
Notifications
You must be signed in to change notification settings - Fork 11k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[mlir][OpenMP] - Honor dependencies in code-generation of the if clau…
…se in `omp.task` correctly (#90891) This patch fixes the code generation of the if clause, specifically when the condition evaluates to false and when the task directive has the depend clause on it. When the if clause of a task construct evaluates to false, then the task is an undeferred task. This undeferred task still has to honor dependencies. Previously, the OpenMPIRbuilder didn't honor dependencies. This patch fixes that. Fixes #90869
- Loading branch information
1 parent
1a25b72
commit 13cd881
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
// RUN: mlir-translate -mlir-to-llvmir %s | FileCheck %s | ||
|
||
llvm.func @foo_(%arg0: !llvm.ptr {fir.bindc_name = "n"}, %arg1: !llvm.ptr {fir.bindc_name = "r"}) attributes {fir.internal_name = "_QPfoo"} { | ||
%0 = llvm.mlir.constant(false) : i1 | ||
omp.task if(%0) depend(taskdependin -> %arg0 : !llvm.ptr) { | ||
%1 = llvm.load %arg0 : !llvm.ptr -> i32 | ||
llvm.store %1, %arg1 : i32, !llvm.ptr | ||
omp.terminator | ||
} | ||
llvm.return | ||
} | ||
|
||
// CHECK: call void @__kmpc_omp_wait_deps | ||
// CHECK-NEXT: call void @__kmpc_omp_task_begin_if0 | ||
// CHECK-NEXT: call void @foo_..omp_par | ||
// CHECK-NEXT: call void @__kmpc_omp_task_complete_if0 | ||
|