diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-01-30 20:49:52 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-01-30 20:49:52 +0000 |
| commit | 4920e1a72ed07bc3eb392c80b86e0baeac2d0378 (patch) | |
| tree | f4d480d51f3687052ca68872191d704a59362ed4 /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
| parent | 04a83a4caed15ae544b23976d3d4d55483fba8a6 (diff) | |
| download | bcm5719-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.cpp | 5 |
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); } |

