@@ -3094,12 +3094,16 @@ static mlir::omp::DistributeOp genCompositeDistributeSimd(
3094
3094
genSimdClauses (converter, semaCtx, simdItem->clauses , loc, simdClauseOps,
3095
3095
simdReductionSyms);
3096
3096
3097
- // TODO: Support delayed privatization.
3098
- DataSharingProcessor dsp (converter, semaCtx, simdItem->clauses , eval,
3099
- /* shouldCollectPreDeterminedSymbols=*/ true ,
3100
- /* useDelayedPrivatization=*/ false , symTable);
3101
- dsp.processStep1 ();
3102
- dsp.processStep2 ();
3097
+ DataSharingProcessor distributeItemDSP (
3098
+ converter, semaCtx, distributeItem->clauses , eval,
3099
+ /* shouldCollectPreDeterminedSymbols=*/ false ,
3100
+ /* useDelayedPrivatization=*/ true , symTable);
3101
+ distributeItemDSP.processStep1 (&distributeClauseOps);
3102
+
3103
+ DataSharingProcessor simdItemDSP (converter, semaCtx, simdItem->clauses , eval,
3104
+ /* shouldCollectPreDeterminedSymbols=*/ true ,
3105
+ /* useDelayedPrivatization=*/ true , symTable);
3106
+ simdItemDSP.processStep1 (&simdClauseOps);
3103
3107
3104
3108
// Pass the innermost leaf construct's clauses because that's where COLLAPSE
3105
3109
// is placed by construct decomposition.
@@ -3110,13 +3114,15 @@ static mlir::omp::DistributeOp genCompositeDistributeSimd(
3110
3114
3111
3115
// Operation creation.
3112
3116
EntryBlockArgs distributeArgs;
3113
- // TODO: Add private syms and vars.
3117
+ distributeArgs.priv .syms = distributeItemDSP.getDelayedPrivSymbols ();
3118
+ distributeArgs.priv .vars = distributeClauseOps.privateVars ;
3114
3119
auto distributeOp = genWrapperOp<mlir::omp::DistributeOp>(
3115
3120
converter, loc, distributeClauseOps, distributeArgs);
3116
3121
distributeOp.setComposite (/* val=*/ true );
3117
3122
3118
3123
EntryBlockArgs simdArgs;
3119
- // TODO: Add private syms and vars.
3124
+ simdArgs.priv .syms = simdItemDSP.getDelayedPrivSymbols ();
3125
+ simdArgs.priv .vars = simdClauseOps.privateVars ;
3120
3126
simdArgs.reduction .syms = simdReductionSyms;
3121
3127
simdArgs.reduction .vars = simdClauseOps.reductionVars ;
3122
3128
auto simdOp =
@@ -3126,7 +3132,7 @@ static mlir::omp::DistributeOp genCompositeDistributeSimd(
3126
3132
genLoopNestOp (converter, symTable, semaCtx, eval, loc, queue, simdItem,
3127
3133
loopNestClauseOps, iv,
3128
3134
{{distributeOp, distributeArgs}, {simdOp, simdArgs}},
3129
- llvm::omp::Directive::OMPD_distribute_simd, dsp );
3135
+ llvm::omp::Directive::OMPD_distribute_simd, simdItemDSP );
3130
3136
return distributeOp;
3131
3137
}
3132
3138
@@ -3150,12 +3156,16 @@ static mlir::omp::WsloopOp genCompositeDoSimd(
3150
3156
genSimdClauses (converter, semaCtx, simdItem->clauses , loc, simdClauseOps,
3151
3157
simdReductionSyms);
3152
3158
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 ();
3159
+ DataSharingProcessor wsloopItemDSP (
3160
+ converter, semaCtx, doItem->clauses , eval,
3161
+ /* shouldCollectPreDeterminedSymbols=*/ false ,
3162
+ /* useDelayedPrivatization=*/ true , symTable);
3163
+ wsloopItemDSP.processStep1 (&wsloopClauseOps);
3164
+
3165
+ DataSharingProcessor simdItemDSP (converter, semaCtx, simdItem->clauses , eval,
3166
+ /* shouldCollectPreDeterminedSymbols=*/ true ,
3167
+ /* useDelayedPrivatization=*/ true , symTable);
3168
+ simdItemDSP.processStep1 (&simdClauseOps);
3159
3169
3160
3170
// Pass the innermost leaf construct's clauses because that's where COLLAPSE
3161
3171
// is placed by construct decomposition.
@@ -3166,15 +3176,17 @@ static mlir::omp::WsloopOp genCompositeDoSimd(
3166
3176
3167
3177
// Operation creation.
3168
3178
EntryBlockArgs wsloopArgs;
3169
- // TODO: Add private syms and vars.
3179
+ wsloopArgs.priv .syms = wsloopItemDSP.getDelayedPrivSymbols ();
3180
+ wsloopArgs.priv .vars = wsloopClauseOps.privateVars ;
3170
3181
wsloopArgs.reduction .syms = wsloopReductionSyms;
3171
3182
wsloopArgs.reduction .vars = wsloopClauseOps.reductionVars ;
3172
3183
auto wsloopOp = genWrapperOp<mlir::omp::WsloopOp>(
3173
3184
converter, loc, wsloopClauseOps, wsloopArgs);
3174
3185
wsloopOp.setComposite (/* val=*/ true );
3175
3186
3176
3187
EntryBlockArgs simdArgs;
3177
- // TODO: Add private syms and vars.
3188
+ simdArgs.priv .syms = simdItemDSP.getDelayedPrivSymbols ();
3189
+ simdArgs.priv .vars = simdClauseOps.privateVars ;
3178
3190
simdArgs.reduction .syms = simdReductionSyms;
3179
3191
simdArgs.reduction .vars = simdClauseOps.reductionVars ;
3180
3192
auto simdOp =
@@ -3184,7 +3196,7 @@ static mlir::omp::WsloopOp genCompositeDoSimd(
3184
3196
genLoopNestOp (converter, symTable, semaCtx, eval, loc, queue, simdItem,
3185
3197
loopNestClauseOps, iv,
3186
3198
{{wsloopOp, wsloopArgs}, {simdOp, simdArgs}},
3187
- llvm::omp::Directive::OMPD_do_simd, dsp );
3199
+ llvm::omp::Directive::OMPD_do_simd, simdItemDSP );
3188
3200
return wsloopOp;
3189
3201
}
3190
3202
0 commit comments