Skip to content

Commit 26db529

Browse files
committed
Revert "[flang][OpenMP] Support delayed privatisation for composite do simd (llvm#150979)"
This reverts commit c059147.
1 parent ec0e40b commit 26db529

File tree

2 files changed

+11
-35
lines changed

2 files changed

+11
-35
lines changed

flang/lib/Lower/OpenMP/OpenMP.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3099,6 +3099,7 @@ static mlir::omp::DistributeOp genCompositeDistributeSimd(
30993099
/*shouldCollectPreDeterminedSymbols=*/true,
31003100
/*useDelayedPrivatization=*/false, symTable);
31013101
dsp.processStep1();
3102+
dsp.processStep2();
31023103

31033104
// Pass the innermost leaf construct's clauses because that's where COLLAPSE
31043105
// is placed by construct decomposition.
@@ -3149,16 +3150,12 @@ static mlir::omp::WsloopOp genCompositeDoSimd(
31493150
genSimdClauses(converter, semaCtx, simdItem->clauses, loc, simdClauseOps,
31503151
simdReductionSyms);
31513152

3152-
DataSharingProcessor wsloopItemDSP(
3153-
converter, semaCtx, doItem->clauses, eval,
3154-
/*shouldCollectPreDeterminedSymbols=*/false,
3155-
/*useDelayedPrivatization=*/true, symTable);
3156-
wsloopItemDSP.processStep1(&wsloopClauseOps);
3157-
3158-
DataSharingProcessor simdItemDSP(converter, semaCtx, simdItem->clauses, eval,
3159-
/*shouldCollectPreDeterminedSymbols=*/true,
3160-
/*useDelayedPrivatization=*/true, symTable);
3161-
simdItemDSP.processStep1(&simdClauseOps);
3153+
// TODO: Support delayed privatization.
3154+
DataSharingProcessor dsp(converter, semaCtx, simdItem->clauses, eval,
3155+
/*shouldCollectPreDeterminedSymbols=*/true,
3156+
/*useDelayedPrivatization=*/false, symTable);
3157+
dsp.processStep1();
3158+
dsp.processStep2();
31623159

31633160
// Pass the innermost leaf construct's clauses because that's where COLLAPSE
31643161
// is placed by construct decomposition.
@@ -3169,17 +3166,15 @@ static mlir::omp::WsloopOp genCompositeDoSimd(
31693166

31703167
// Operation creation.
31713168
EntryBlockArgs wsloopArgs;
3172-
wsloopArgs.priv.syms = wsloopItemDSP.getDelayedPrivSymbols();
3173-
wsloopArgs.priv.vars = wsloopClauseOps.privateVars;
3169+
// TODO: Add private syms and vars.
31743170
wsloopArgs.reduction.syms = wsloopReductionSyms;
31753171
wsloopArgs.reduction.vars = wsloopClauseOps.reductionVars;
31763172
auto wsloopOp = genWrapperOp<mlir::omp::WsloopOp>(
31773173
converter, loc, wsloopClauseOps, wsloopArgs);
31783174
wsloopOp.setComposite(/*val=*/true);
31793175

31803176
EntryBlockArgs simdArgs;
3181-
simdArgs.priv.syms = simdItemDSP.getDelayedPrivSymbols();
3182-
simdArgs.priv.vars = simdClauseOps.privateVars;
3177+
// TODO: Add private syms and vars.
31833178
simdArgs.reduction.syms = simdReductionSyms;
31843179
simdArgs.reduction.vars = simdClauseOps.reductionVars;
31853180
auto simdOp =
@@ -3189,7 +3184,7 @@ static mlir::omp::WsloopOp genCompositeDoSimd(
31893184
genLoopNestOp(converter, symTable, semaCtx, eval, loc, queue, simdItem,
31903185
loopNestClauseOps, iv,
31913186
{{wsloopOp, wsloopArgs}, {simdOp, simdArgs}},
3192-
llvm::omp::Directive::OMPD_do_simd, simdItemDSP);
3187+
llvm::omp::Directive::OMPD_do_simd, dsp);
31933188
return wsloopOp;
31943189
}
31953190

flang/test/Lower/OpenMP/wsloop-simd.f90

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
subroutine do_simd_aligned(A)
88
use iso_c_binding
99
type(c_ptr) :: A
10-
10+
1111
! CHECK: omp.wsloop
1212
! CHECK-NOT: aligned({{.*}})
1313
! CHECK-SAME: {
@@ -66,22 +66,3 @@ subroutine do_simd_reduction()
6666
end do
6767
!$omp end do simd
6868
end subroutine do_simd_reduction
69-
70-
! CHECK-LABEL: func.func @_QPdo_simd_private(
71-
subroutine do_simd_private()
72-
integer, allocatable :: tmp
73-
! CHECK: omp.wsloop
74-
! CHECK-NEXT: omp.simd
75-
! CHECK-SAME: private(@[[PRIV_BOX_SYM:.*]] %{{.*}} -> %[[PRIV_BOX:.*]], @[[PRIV_IVAR_SYM:.*]] %{{.*}} -> %[[PRIV_IVAR:.*]] : !fir.ref<!fir.box<!fir.heap<i32>>>, !fir.ref<i32>)
76-
! CHECK-NEXT: omp.loop_nest (%[[IVAR:.*]]) : i32
77-
!$omp do simd private(tmp)
78-
do i=1, 10
79-
! CHECK: %[[PRIV_BOX_DECL:.*]]:2 = hlfir.declare %[[PRIV_BOX]]
80-
! CHECK: %[[PRIV_IVAR_DECL:.*]]:2 = hlfir.declare %[[PRIV_IVAR]]
81-
! CHECK: hlfir.assign %[[IVAR]] to %[[PRIV_IVAR_DECL]]#0
82-
! CHECK: %[[PRIV_BOX_LOAD:.*]] = fir.load %[[PRIV_BOX_DECL]]
83-
! CHECK: hlfir.assign %{{.*}} to %[[PRIV_BOX_DECL]]#0
84-
! CHECK: omp.yield
85-
tmp = tmp + 1
86-
end do
87-
end subroutine do_simd_private

0 commit comments

Comments
 (0)