From 5dff95c04de0d096563462530160fd5fc221fd8f Mon Sep 17 00:00:00 2001 From: Alexey Bataev Date: Fri, 22 Apr 2016 03:56:56 +0000 Subject: [OPENMP] Fix for LCV in simd directives in explicit clauses. If loop control variable for simd-based directives is explicitly marked as linear/lastprivate in clauses, codegen for such construct would crash. Patch fixes this problem. llvm-svn: 267101 --- clang/lib/CodeGen/CodeGenFunction.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'clang/lib/CodeGen/CodeGenFunction.h') diff --git a/clang/lib/CodeGen/CodeGenFunction.h b/clang/lib/CodeGen/CodeGenFunction.h index 28754c306ba..17b7fcaa255 100644 --- a/clang/lib/CodeGen/CodeGenFunction.h +++ b/clang/lib/CodeGen/CodeGenFunction.h @@ -2309,7 +2309,17 @@ public: /// it is the last iteration of the loop code in associated directive, or to /// 'i1 false' otherwise. If this item is nullptr, no final check is required. void EmitOMPLastprivateClauseFinal(const OMPExecutableDirective &D, + bool NoFinals, llvm::Value *IsLastIterCond = nullptr); + /// Emit initial code for linear clauses. + void EmitOMPLinearClause(const OMPLoopDirective &D, + CodeGenFunction::OMPPrivateScope &PrivateScope); + /// Emit final code for linear clauses. + /// \param CondGen Optional conditional code for final part of codegen for + /// linear clause. + void EmitOMPLinearClauseFinal( + const OMPLoopDirective &D, + const llvm::function_ref &CondGen); /// \brief Emit initial code for reduction variables. Creates reduction copies /// and initializes them with the values according to OpenMP standard. /// @@ -2390,9 +2400,11 @@ public: const llvm::function_ref &PostIncGen); JumpDest getOMPCancelDestination(OpenMPDirectiveKind Kind); + /// Emit initial code for loop counters of loop-based directives. + void EmitOMPPrivateLoopCounters(const OMPLoopDirective &S, + OMPPrivateScope &LoopScope); private: - /// Helpers for the OpenMP loop directives. void EmitOMPLoopBody(const OMPLoopDirective &D, JumpDest LoopExit); void EmitOMPSimdInit(const OMPLoopDirective &D, bool IsMonotonic = false); -- cgit v1.2.3