summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-03-09 15:20:30 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-03-09 15:20:30 +0000
commit21dab12453d2e9bb222820002890cdd653c59b5f (patch)
treefb3d7fb21aec240ec5344caa122c3d20c271ae71 /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parent14b7e1890916c3941153b373e007fd4ce2fecf85 (diff)
downloadbcm5719-llvm-21dab12453d2e9bb222820002890cdd653c59b5f.tar.gz
bcm5719-llvm-21dab12453d2e9bb222820002890cdd653c59b5f.zip
[OPENMP] Fix the address of the original variable in task reductions.
If initialization of the task reductions requires pointer to original variable, which is stored in the threadprivate storage, we used the address of this pointer instead. llvm-svn: 327136
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index f9dab90f398..708f0abd08d 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -5422,6 +5422,9 @@ static llvm::Value *emitReduceInitFunction(CodeGenModule &CGM,
CGM.getOpenMPRuntime().getAddrOfArtificialThreadPrivate(
CGF, CGM.getContext().VoidPtrTy,
generateUniqueName(CGM, "reduction", RCG.getRefExpr(N)));
+ SharedAddr = CGF.EmitLoadOfPointer(
+ SharedAddr,
+ CGM.getContext().VoidPtrTy.castAs<PointerType>()->getTypePtr());
SharedLVal = CGF.MakeAddrLValue(SharedAddr, CGM.getContext().VoidPtrTy);
} else {
SharedLVal = CGF.MakeNaturalAlignAddrLValue(
OpenPOWER on IntegriCloud