|
@@ -2886,6 +2886,11 @@ void CodeGenFunction::EmitOMPTaskBasedDirective(
|
|
for (unsigned Cnt = 0, E = Data.ReductionVars.size(); Cnt < E; ++Cnt) {
|
|
for (unsigned Cnt = 0, E = Data.ReductionVars.size(); Cnt < E; ++Cnt) {
|
|
RedCG.emitSharedLValue(CGF, Cnt);
|
|
RedCG.emitSharedLValue(CGF, Cnt);
|
|
RedCG.emitAggregateType(CGF, Cnt);
|
|
RedCG.emitAggregateType(CGF, Cnt);
|
|
|
|
+ // FIXME: This must removed once the runtime library is fixed.
|
|
|
|
+ // Emit required threadprivate variables for
|
|
|
|
+ // initilizer/combiner/finalizer.
|
|
|
|
+ CGF.CGM.getOpenMPRuntime().emitTaskReductionFixups(CGF, S.getLocStart(),
|
|
|
|
+ RedCG, Cnt);
|
|
Address Replacement = CGF.CGM.getOpenMPRuntime().getTaskReductionItem(
|
|
Address Replacement = CGF.CGM.getOpenMPRuntime().getTaskReductionItem(
|
|
CGF, S.getLocStart(), ReductionsPtr, RedCG.getSharedLValue(Cnt));
|
|
CGF, S.getLocStart(), ReductionsPtr, RedCG.getSharedLValue(Cnt));
|
|
Replacement =
|
|
Replacement =
|
|
@@ -2898,11 +2903,6 @@ void CodeGenFunction::EmitOMPTaskBasedDirective(
|
|
Replacement = RedCG.adjustPrivateAddress(CGF, Cnt, Replacement);
|
|
Replacement = RedCG.adjustPrivateAddress(CGF, Cnt, Replacement);
|
|
Scope.addPrivate(RedCG.getBaseDecl(Cnt),
|
|
Scope.addPrivate(RedCG.getBaseDecl(Cnt),
|
|
[Replacement]() { return Replacement; });
|
|
[Replacement]() { return Replacement; });
|
|
- // FIXME: This must removed once the runtime library is fixed.
|
|
|
|
- // Emit required threadprivate variables for
|
|
|
|
- // initilizer/combiner/finalizer.
|
|
|
|
- CGF.CGM.getOpenMPRuntime().emitTaskReductionFixups(CGF, S.getLocStart(),
|
|
|
|
- RedCG, Cnt);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
// Privatize all private variables except for in_reduction items.
|
|
// Privatize all private variables except for in_reduction items.
|
|
@@ -2935,6 +2935,11 @@ void CodeGenFunction::EmitOMPTaskBasedDirective(
|
|
RedCG.emitAggregateType(CGF, Cnt);
|
|
RedCG.emitAggregateType(CGF, Cnt);
|
|
// The taskgroup descriptor variable is always implicit firstprivate and
|
|
// The taskgroup descriptor variable is always implicit firstprivate and
|
|
// privatized already during procoessing of the firstprivates.
|
|
// privatized already during procoessing of the firstprivates.
|
|
|
|
+ // FIXME: This must removed once the runtime library is fixed.
|
|
|
|
+ // Emit required threadprivate variables for
|
|
|
|
+ // initilizer/combiner/finalizer.
|
|
|
|
+ CGF.CGM.getOpenMPRuntime().emitTaskReductionFixups(CGF, S.getLocStart(),
|
|
|
|
+ RedCG, Cnt);
|
|
llvm::Value *ReductionsPtr =
|
|
llvm::Value *ReductionsPtr =
|
|
CGF.EmitLoadOfScalar(CGF.EmitLValue(TaskgroupDescriptors[Cnt]),
|
|
CGF.EmitLoadOfScalar(CGF.EmitLValue(TaskgroupDescriptors[Cnt]),
|
|
TaskgroupDescriptors[Cnt]->getExprLoc());
|
|
TaskgroupDescriptors[Cnt]->getExprLoc());
|
|
@@ -2949,11 +2954,6 @@ void CodeGenFunction::EmitOMPTaskBasedDirective(
|
|
Replacement = RedCG.adjustPrivateAddress(CGF, Cnt, Replacement);
|
|
Replacement = RedCG.adjustPrivateAddress(CGF, Cnt, Replacement);
|
|
InRedScope.addPrivate(RedCG.getBaseDecl(Cnt),
|
|
InRedScope.addPrivate(RedCG.getBaseDecl(Cnt),
|
|
[Replacement]() { return Replacement; });
|
|
[Replacement]() { return Replacement; });
|
|
- // FIXME: This must removed once the runtime library is fixed.
|
|
|
|
- // Emit required threadprivate variables for
|
|
|
|
- // initilizer/combiner/finalizer.
|
|
|
|
- CGF.CGM.getOpenMPRuntime().emitTaskReductionFixups(CGF, S.getLocStart(),
|
|
|
|
- RedCG, Cnt);
|
|
|
|
}
|
|
}
|
|
}
|
|
}
|
|
(void)InRedScope.Privatize();
|
|
(void)InRedScope.Privatize();
|