summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2019-01-30 20:49:52 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2019-01-30 20:49:52 +0000
commit4920e1a72ed07bc3eb392c80b86e0baeac2d0378 (patch)
treef4d480d51f3687052ca68872191d704a59362ed4 /clang/lib/CodeGen/CGStmtOpenMP.cpp
parent04a83a4caed15ae544b23976d3d4d55483fba8a6 (diff)
downloadbcm5719-llvm-4920e1a72ed07bc3eb392c80b86e0baeac2d0378.tar.gz
bcm5719-llvm-4920e1a72ed07bc3eb392c80b86e0baeac2d0378.zip
[OPENMP]Fix PR40536: Do not emit __kmpc_push_target_tripcount if not
required. Function __kmpc_push_target_tripcount should be emitted only if the offloading entry is going to be emitted (for use in tgt_target... functions). Otherwise, it should not be emitted. llvm-svn: 352669
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index fe9b3bc37cb..a38e0afc600 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -4078,8 +4078,9 @@ static void emitCommonOMPTargetDirective(CodeGenFunction &CGF,
/*IsSigned=*/false);
return NumIterations;
};
- CGM.getOpenMPRuntime().emitTargetNumIterationsCall(CGF, S, Device,
- SizeEmitter);
+ if (IsOffloadEntry)
+ CGM.getOpenMPRuntime().emitTargetNumIterationsCall(CGF, S, Device,
+ SizeEmitter);
CGM.getOpenMPRuntime().emitTargetCall(CGF, S, Fn, FnID, IfCond, Device);
}
OpenPOWER on IntegriCloud