diff options
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CGStmt.cpp | 4 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 13 | ||||
| -rw-r--r-- | clang/lib/CodeGen/CodeGenFunction.h | 2 | 
3 files changed, 19 insertions, 0 deletions
| diff --git a/clang/lib/CodeGen/CGStmt.cpp b/clang/lib/CodeGen/CGStmt.cpp index 9447ae56c7a..b4f309353fb 100644 --- a/clang/lib/CodeGen/CGStmt.cpp +++ b/clang/lib/CodeGen/CGStmt.cpp @@ -301,6 +301,10 @@ void CodeGenFunction::EmitStmt(const Stmt *S) {    case Stmt::OMPTeamsDistributeDirectiveClass:      EmitOMPTeamsDistributeDirective(cast<OMPTeamsDistributeDirective>(*S));      break; +  case Stmt::OMPTeamsDistributeSimdDirectiveClass: +    EmitOMPTeamsDistributeSimdDirective( +        cast<OMPTeamsDistributeSimdDirective>(*S)); +    break;    }  } diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index 7c2cfd5909c..b09d8c8807d 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -1959,6 +1959,19 @@ void CodeGenFunction::EmitOMPTeamsDistributeDirective(        });  } +void CodeGenFunction::EmitOMPTeamsDistributeSimdDirective( +    const OMPTeamsDistributeSimdDirective &S) { +  OMPLexicalScope Scope(*this, S, /*AsInlined=*/true); +  CGM.getOpenMPRuntime().emitInlinedDirective( +      *this, OMPD_teams_distribute_simd, +      [&S](CodeGenFunction &CGF, PrePostActionTy &) { +        OMPLoopScope PreInitScope(CGF, S); +        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 a63cce65f58..2782f4b1670 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -2526,6 +2526,8 @@ public:        const OMPTargetParallelForSimdDirective &S);    void EmitOMPTargetSimdDirective(const OMPTargetSimdDirective &S);    void EmitOMPTeamsDistributeDirective(const OMPTeamsDistributeDirective &S); +  void +  EmitOMPTeamsDistributeSimdDirective(const OMPTeamsDistributeSimdDirective &S);    /// Emit outlined function for the target directive.    static std::pair<llvm::Function * /*OutlinedFn*/, | 

