summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorAlexander Musman <alexander.musman@gmail.com>2015-03-16 07:14:41 +0000
committerAlexander Musman <alexander.musman@gmail.com>2015-03-16 07:14:41 +0000
commit7931b987353c87885562fba2296dd3fc1bb4ab81 (patch)
tree088bd0b6019b8a3bc66355adb2b76ff324e85ddc /clang/lib/CodeGen
parentc01ab519e68c0c14389c668aaba1cee2800a5de9 (diff)
downloadbcm5719-llvm-7931b987353c87885562fba2296dd3fc1bb4ab81.tar.gz
bcm5719-llvm-7931b987353c87885562fba2296dd3fc1bb4ab81.zip
[OPENMP] Enable codegen of the ‘private’ clause for ‘omp simd’ directive
llvm-svn: 232353
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index e3c4384a4bd..a7615ce10a2 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -189,7 +189,7 @@ void CodeGenFunction::EmitOMPFirstprivateClause(
EmitDecl(*VD);
return GetAddrOfLocalVar(VD);
});
- assert(IsRegistered && "counter already registered as private");
+ assert(IsRegistered && "firstprivate var already registered as private");
// Silence the warning about unused variable.
(void)IsRegistered;
++IRef, ++InitsRef;
@@ -216,7 +216,7 @@ void CodeGenFunction::EmitOMPPrivateClause(
EmitDecl(*VD);
return GetAddrOfLocalVar(VD);
});
- assert(IsRegistered && "counter already registered as private");
+ assert(IsRegistered && "private var already registered as private");
// Silence the warning about unused variable.
(void)IsRegistered;
++IRef;
@@ -379,7 +379,6 @@ static void EmitPrivateLoopCounters(CodeGenFunction &CGF,
// Silence the warning about unused variable.
(void)IsRegistered;
}
- (void)LoopScope.Privatize();
}
void CodeGenFunction::EmitOMPSimdDirective(const OMPSimdDirective &S) {
@@ -456,6 +455,8 @@ void CodeGenFunction::EmitOMPSimdDirective(const OMPSimdDirective &S) {
{
OMPPrivateScope LoopScope(*this);
EmitPrivateLoopCounters(*this, LoopScope, S.counters());
+ EmitOMPPrivateClause(S, LoopScope);
+ (void)LoopScope.Privatize();
EmitOMPInnerLoop(S, LoopScope.requiresCleanups(),
S.getCond(/*SeparateIter=*/true), S.getInc(),
[&S, this]() {
@@ -472,6 +473,8 @@ void CodeGenFunction::EmitOMPSimdDirective(const OMPSimdDirective &S) {
{
OMPPrivateScope LoopScope(*this);
EmitPrivateLoopCounters(*this, LoopScope, S.counters());
+ EmitOMPPrivateClause(S, LoopScope);
+ (void)LoopScope.Privatize();
EmitOMPInnerLoop(S, LoopScope.requiresCleanups(),
S.getCond(/*SeparateIter=*/false), S.getInc(),
[&S, this]() {
@@ -670,6 +673,7 @@ void CodeGenFunction::EmitOMPWorksharingLoop(const OMPLoopDirective &S) {
OMPPrivateScope LoopScope(*this);
EmitPrivateLoopCounters(*this, LoopScope, S.counters());
+ (void)LoopScope.Privatize();
// Detect the loop schedule kind and chunk.
auto ScheduleKind = OMPC_SCHEDULE_unknown;
OpenPOWER on IntegriCloud