summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-11-29 21:21:32 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-11-29 21:21:32 +0000
commit3ce5d827fc857b79e6de4d3d86c7443f1551fc4e (patch)
tree9036d1535a3214fb2f076dfb94cec092dc153b2f /clang/lib/CodeGen
parent49f51bcce39169039a997d6bd47e3e3aaf9bbbda (diff)
downloadbcm5719-llvm-3ce5d827fc857b79e6de4d3d86c7443f1551fc4e.tar.gz
bcm5719-llvm-3ce5d827fc857b79e6de4d3d86c7443f1551fc4e.zip
[OPENMP][NVPTX]Call get __kmpc_global_thread_num in worker after
initialization. Function __kmpc_global_thread_num should be called only after initialization, not earlier. llvm-svn: 347919
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
index d4b599eeff4..2bc98f6178b 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
@@ -1504,6 +1504,8 @@ void CGOpenMPRuntimeNVPTX::emitWorkerLoop(CodeGenFunction &CGF,
// Signal start of parallel region.
CGF.EmitBlock(ExecuteBB);
+ // Skip initialization.
+ setLocThreadIdInsertPt(CGF, /*AtCurrentPoint=*/true);
// Process work items: outlined parallel functions.
for (llvm::Function *W : Work) {
@@ -1564,6 +1566,8 @@ void CGOpenMPRuntimeNVPTX::emitWorkerLoop(CodeGenFunction &CGF,
// Exit target region.
CGF.EmitBlock(ExitBB);
+ // Skip initialization.
+ clearLocThreadIdInsertPt(CGF);
}
/// Returns specified OpenMP runtime function for the current OpenMP
OpenPOWER on IntegriCloud