Skip to content

Commit 17a07ca

Browse files
Update based on comments from Kareeems review
1 parent 47ed197 commit 17a07ca

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1672,12 +1672,7 @@ static void genTargetClauses(
16721672

16731673
// `target private(..)` is only supported in delayed privatization mode.
16741674
if (!enableDelayedPrivatizationStaging)
1675-
cp.processTODO<clause::Private>(loc, llvm::omp::Directive::OMPD_target);
1676-
1677-
// We do not yet have MLIR to LLVMIR translation for privatization in
1678-
// for deferred target tasks.
1679-
if (clauseOps.nowait)
1680-
cp.processTODO<clause::Private, clause::Firstprivate>(
1675+
cp.processTODO<clause::Firstprivate, clause::Private>(
16811676
loc, llvm::omp::Directive::OMPD_target);
16821677
}
16831678

mlir/test/Target/LLVMIR/openmp-target-private.mlir

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -158,12 +158,10 @@ omp.private {type = firstprivate} @sv.firstprivate : i32 copy {
158158
llvm.store %0, %arg1 : i32, !llvm.ptr
159159
omp.yield(%arg1 : !llvm.ptr)
160160
}
161-
llvm.func @target_simple_() attributes {fir.internal_name = "_QPtarget_simple"} {
161+
llvm.func @target_firstprivate_() attributes {fir.internal_name = "_QPtarget_firstprivate"} {
162162
%0 = llvm.mlir.constant(1 : i64) : i64
163163
%sv = llvm.alloca %0 x i32 {bindc_name = "sv"} : (i64) -> !llvm.ptr
164164
%sf = llvm.alloca %0 x f32 {bindc_name = "sf"} : (i64) -> !llvm.ptr
165-
%4 = llvm.mlir.constant(1 : i64) : i64
166-
%5 = llvm.mlir.constant(1 : i64) : i64
167165
%6 = omp.map.info var_ptr(%sv : !llvm.ptr, i32) map_clauses(to) capture(ByRef) -> !llvm.ptr
168166
%7 = omp.map.info var_ptr(%sf : !llvm.ptr, f32) map_clauses(to) capture(ByRef) -> !llvm.ptr
169167
omp.target map_entries(%6 -> %arg0, %7 -> %arg1 : !llvm.ptr, !llvm.ptr) private(@sv.firstprivate %sv -> %arg2 [map_idx=0], @sf.firstprivate %sf -> %arg3 [map_idx=1] : !llvm.ptr, !llvm.ptr) {
@@ -189,7 +187,7 @@ llvm.func @target_simple_() attributes {fir.internal_name = "_QPtarget_simple"}
189187
// CHECK: call void @__omp_offloading_[[PRIVATE_MULTI_BLOCK_OFFLOADED_FUNCTION:.*]]()
190188
// CHECK: define void @target_boxchar_
191189
// CHECK: call void @__omp_offloading_[[BOXCHAR_OFFLOADED_FUNCTION:.*]](ptr {{.*}}, ptr {{.*}})
192-
// CHECK: define void @target_simple_()
190+
// CHECK: define void @target_firstprivate_()
193191
// CHECK: call void @__omp_offloading_[[SIMPLE_OFFLOADED_FUNCTION:.*]](ptr {{.*}}, ptr {{.*}})
194192

195193
// CHECK: define internal void @__omp_offloading_[[MAP_SINGLE_PRIVATE_OFFLOADED_FUNCTION]]

0 commit comments

Comments
 (0)