@@ -2910,10 +2910,10 @@ void CodeGenFunction::EmitOMPOuterLoop(
2910
2910
EmitBlock (LoopExit.getBlock ());
2911
2911
2912
2912
// Tell the runtime we are done.
2913
- auto &&CodeGen = [DynamicOrOrdered, &S](CodeGenFunction &CGF) {
2913
+ auto &&CodeGen = [DynamicOrOrdered, &S, &LoopArgs ](CodeGenFunction &CGF) {
2914
2914
if (!DynamicOrOrdered)
2915
2915
CGF.CGM .getOpenMPRuntime ().emitForStaticFinish (CGF, S.getEndLoc (),
2916
- S. getDirectiveKind () );
2916
+ LoopArgs. DKind );
2917
2917
};
2918
2918
OMPCancelStack.emitExit (*this , S.getDirectiveKind (), CodeGen);
2919
2919
}
@@ -3019,6 +3019,7 @@ void CodeGenFunction::EmitOMPForOuterLoop(
3019
3019
OuterLoopArgs.Cond = S.getCond ();
3020
3020
OuterLoopArgs.NextLB = S.getNextLowerBound ();
3021
3021
OuterLoopArgs.NextUB = S.getNextUpperBound ();
3022
+ OuterLoopArgs.DKind = LoopArgs.DKind ;
3022
3023
EmitOMPOuterLoop (DynamicOrOrdered, IsMonotonic, S, LoopScope, OuterLoopArgs,
3023
3024
emitOMPLoopBodyWithStopPoint, CodeGenOrdered);
3024
3025
}
@@ -3080,6 +3081,7 @@ void CodeGenFunction::EmitOMPDistributeOuterLoop(
3080
3081
OuterLoopArgs.NextUB = isOpenMPLoopBoundSharingDirective (S.getDirectiveKind ())
3081
3082
? S.getCombinedNextUpperBound ()
3082
3083
: S.getNextUpperBound ();
3084
+ OuterLoopArgs.DKind = OMPD_distribute;
3083
3085
3084
3086
EmitOMPOuterLoop (/* DynamicOrOrdered = */ false , /* IsMonotonic = */ false , S,
3085
3087
LoopScope, OuterLoopArgs, CodeGenLoopContent,
@@ -3452,15 +3454,16 @@ bool CodeGenFunction::EmitOMPWorksharingLoop(
3452
3454
// Tell the runtime we are done.
3453
3455
auto &&CodeGen = [&S](CodeGenFunction &CGF) {
3454
3456
CGF.CGM .getOpenMPRuntime ().emitForStaticFinish (CGF, S.getEndLoc (),
3455
- S. getDirectiveKind () );
3457
+ OMPD_for );
3456
3458
};
3457
3459
OMPCancelStack.emitExit (*this , S.getDirectiveKind (), CodeGen);
3458
3460
} else {
3459
3461
// Emit the outer loop, which requests its work chunk [LB..UB] from
3460
3462
// runtime and runs the inner loop to process it.
3461
- const OMPLoopArguments LoopArguments (
3463
+ OMPLoopArguments LoopArguments (
3462
3464
LB.getAddress (*this ), UB.getAddress (*this ), ST.getAddress (*this ),
3463
3465
IL.getAddress (*this ), Chunk, EUB);
3466
+ LoopArguments.DKind = OMPD_for;
3464
3467
EmitOMPForOuterLoop (ScheduleKind, IsMonotonic, S, LoopScope, Ordered,
3465
3468
LoopArguments, CGDispatchBounds);
3466
3469
}
@@ -4082,7 +4085,7 @@ void CodeGenFunction::EmitSections(const OMPExecutableDirective &S) {
4082
4085
// Tell the runtime we are done.
4083
4086
auto &&CodeGen = [&S](CodeGenFunction &CGF) {
4084
4087
CGF.CGM .getOpenMPRuntime ().emitForStaticFinish (CGF, S.getEndLoc (),
4085
- S. getDirectiveKind () );
4088
+ OMPD_sections );
4086
4089
};
4087
4090
CGF.OMPCancelStack .emitExit (CGF, S.getDirectiveKind (), CodeGen);
4088
4091
CGF.EmitOMPReductionClauseFinal (S, /* ReductionKind=*/ OMPD_parallel);
@@ -5782,7 +5785,7 @@ void CodeGenFunction::EmitOMPDistributeLoop(const OMPLoopDirective &S,
5782
5785
});
5783
5786
EmitBlock (LoopExit.getBlock ());
5784
5787
// Tell the runtime we are done.
5785
- RT.emitForStaticFinish (*this , S.getEndLoc (), S. getDirectiveKind () );
5788
+ RT.emitForStaticFinish (*this , S.getEndLoc (), OMPD_distribute );
5786
5789
} else {
5787
5790
// Emit the outer loop, which requests its work chunk [LB..UB] from
5788
5791
// runtime and runs the inner loop to process it.
0 commit comments