summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen
diff options
context:
space:
mode:
authorKelvin Li <kkwli0@gmail.com>2016-12-25 04:52:54 +0000
committerKelvin Li <kkwli0@gmail.com>2016-12-25 04:52:54 +0000
commit83c451e9986e2d2ccd28395595465d69f0d4db6e (patch)
tree75c1356a97696a372040aaf0cf1364b8b9f1ee4c /clang/lib/CodeGen
parent690952d15e6e21cd42a7c99e0941dc983e608866 (diff)
downloadbcm5719-llvm-83c451e9986e2d2ccd28395595465d69f0d4db6e.tar.gz
bcm5719-llvm-83c451e9986e2d2ccd28395595465d69f0d4db6e.zip
[OpenMP] Sema and parsing for 'target teams distribute' pragma
This patch is to implement sema and parsing for 'target teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D28015 llvm-svn: 290508
Diffstat (limited to 'clang/lib/CodeGen')
-rw-r--r--clang/lib/CodeGen/CGStmt.cpp4
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp8
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.h2
3 files changed, 14 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp
index 5b426b8f92e..0100dc23fac 100644
--- a/clang/lib/CodeGen/CGStmt.cpp
+++ b/clang/lib/CodeGen/CGStmt.cpp
@@ -318,6 +318,10 @@ void CodeGenFunction::EmitStmt(const Stmt *S) {
case Stmt::OMPTargetTeamsDirectiveClass:
EmitOMPTargetTeamsDirective(cast<OMPTargetTeamsDirective>(*S));
break;
+ case Stmt::OMPTargetTeamsDistributeDirectiveClass:
+ EmitOMPTargetTeamsDistributeDirective(
+ cast<OMPTargetTeamsDistributeDirective>(*S));
+ break;
}
}
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index 0ca7f34a7a9..fad8b7314f2 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -2011,6 +2011,14 @@ void CodeGenFunction::EmitOMPTargetTeamsDirective(
});
}
+void CodeGenFunction::EmitOMPTargetTeamsDistributeDirective(
+ const OMPTargetTeamsDistributeDirective &S) {
+ CGM.getOpenMPRuntime().emitInlinedDirective(*this, OMPD_target_teams_distribute,
+ [&S](CodeGenFunction &CGF, PrePostActionTy &) {
+ CGF.EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt());
+ });
+}
+
/// \brief Emit a helper variable and return corresponding lvalue.
static LValue EmitOMPHelperVar(CodeGenFunction &CGF,
const DeclRefExpr *Helper) {
diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h
index b78abdc1112..55fc8227132 100644
--- a/clang/lib/CodeGen/CodeGenFunction.h
+++ b/clang/lib/CodeGen/CodeGenFunction.h
@@ -2695,6 +2695,8 @@ public:
void EmitOMPTeamsDistributeParallelForDirective(
const OMPTeamsDistributeParallelForDirective &S);
void EmitOMPTargetTeamsDirective(const OMPTargetTeamsDirective &S);
+ void EmitOMPTargetTeamsDistributeDirective(
+ const OMPTargetTeamsDistributeDirective &S);
/// Emit outlined function for the target directive.
static std::pair<llvm::Function * /*OutlinedFn*/,
OpenPOWER on IntegriCloud