summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-03-18 18:40:00 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-03-18 18:40:00 +0000
commitf6a53d63a10078a5150fd1f9c867e7714ea21417 (patch)
treef7efc8cb9716179f394362248dc346b9cf5e0eb3 /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parent8a595b1d2edf3d5d987a2a498e7f696596d0eaa5 (diff)
downloadbcm5719-llvm-f6a53d63a10078a5150fd1f9c867e7714ea21417.tar.gz
bcm5719-llvm-f6a53d63a10078a5150fd1f9c867e7714ea21417.zip
[OPENMP] Set scheduling for doacross loops as schedule, 1.
The default scheduling for doacross loops is changed from static to static, 1. llvm-svn: 356388
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index f3a0f0d5955..4e6cfa6e258 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -3270,6 +3270,24 @@ unsigned CGOpenMPRuntime::getDefaultFlagsForBarriers(OpenMPDirectiveKind Kind) {
return Flags;
}
+void CGOpenMPRuntime::getDefaultScheduleAndChunk(
+ CodeGenFunction &CGF, const OMPLoopDirective &S,
+ OpenMPScheduleClauseKind &ScheduleKind, const Expr *&ChunkExpr) const {
+ // Check if the loop directive is actually a doacross loop directive. In this
+ // case choose static, 1 schedule.
+ if (llvm::any_of(
+ S.getClausesOfKind<OMPOrderedClause>(),
+ [](const OMPOrderedClause *C) { return C->getNumForLoops(); })) {
+ ScheduleKind = OMPC_SCHEDULE_static;
+ // Chunk size is 1 in this case.
+ llvm::APInt ChunkSize(32, 1);
+ ChunkExpr = IntegerLiteral::Create(
+ CGF.getContext(), ChunkSize,
+ CGF.getContext().getIntTypeForBitwidth(32, /*Signed=*/0),
+ SourceLocation());
+ }
+}
+
void CGOpenMPRuntime::emitBarrierCall(CodeGenFunction &CGF, SourceLocation Loc,
OpenMPDirectiveKind Kind, bool EmitChecks,
bool ForceSimpleCall) {
OpenPOWER on IntegriCloud