summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Renamed RefersToEnclosingLocal bitfield to RefersToCapturedVariable.Alexey Bataev2014-12-161-8/+9
| | | | | | | Bitfield RefersToEnclosingLocal of Stmt::DeclRefExprBitfields renamed to RefersToCapturedVariable to reflect latest changes introduced in commit 224323. Also renamed method Expr::refersToEnclosingLocal() to Expr::refersToCapturedVariable() and comments for constant arguments. No functional changes. llvm-svn: 224329
* [OPENMP] Bugfix for processing of global variables in OpenMP regions.Alexey Bataev2014-12-161-3/+22
| | | | | | | | Currently, if global variable is marked as a private OpenMP variable, the compiler crashes in debug version or generates incorrect code in release version. It happens because in the OpenMP region the original global variable is used instead of the generated private copy. It happens because currently globals variables are not captured in the OpenMP region. This patch adds capturing of global variables iff private copy of the global variable must be used in the OpenMP region. Differential Revision: http://reviews.llvm.org/D6259 llvm-svn: 224323
* First patch with codegen of the 'omp for' directive. It implementsAlexander Musman2014-12-151-76/+113
| | | | | | | | | | | | | | | the simplest case, which is used when no chunk_size is specified in the schedule(static) or no 'schedule' clause is specified - the iteration space is divided by the library into chunks that are approximately equal in size, and at most one chunk is distributed to each thread. In this case, we do not need an outer loop in each thread - each thread requests once which iterations range it should handle (using __kmpc_for_static_init runtime call) and then runs the inner loop on this range. Differential Revision: http://reviews.llvm.org/D5865 llvm-svn: 224233
* [OPENMP] Additional processing of 'omp atomic write' directive.Alexey Bataev2014-11-281-12/+61
| | | | | | According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic write' is allowed to be used only for expression statements of form 'x = expr;', where x is a lvalue expression and expr is an expression with scalar type. Patch adds checks for it. llvm-svn: 222913
* [OPENMP] Disable CapturedStmt generation for standalone directives.Alexey Bataev2014-11-211-32/+4
| | | | | | No functional changes, just code improvement. llvm-svn: 222523
* [OPENMP] Additional processing of 'omp atomic read' directive.Alexey Bataev2014-11-181-5/+87
| | | | | | According to OpenMP standard, Section 2.12.6, atomic Construct, '#pragma omp atomic read' is allowed to be used only for expression statements of form 'v = x;', where x and v (as applicable) are both l-value expressions with scalar type. Patch adds checks for it. llvm-svn: 222231
* [OPENMP] Temporary fix for processing of global variables in loops.Alexey Bataev2014-11-141-1/+12
| | | | | | Currently there is a bug in processing of global variables used as loop control variables in 'omp for/simd' constructs: these globals must be captured as private variables, but currently they are nor. This is a temporary bug fix for this problem until the correct solution is prepared. If a global var used as lcv without explicit mark as a private/linear/lastprivate the error message is emitted. llvm-svn: 221970
* [OPENMP] Codegen for threadprivate variablesAlexey Bataev2014-11-111-0/+5
| | | | | | | | | For all threadprivate variables which have constructor/destructor emit call to void __kmpc_threadprivate_register(ident_t * <Current Location>, void *<Original Global Addr>, kmpc_ctor <Constructor>, kmpc_cctor NULL, kmpc_dtor <Destructor>); In expressions all references to such variables are replaced by calls to void *__kmpc_threadprivate_cached(ident_t *<Current Location>, kmp_int32 <Current Thread Id>, void *<Original Global Addr>, size_t <Size of Data>, void ***<Pointer to autogenerated cache – array of private copies of threadprivate variable>); Test test/OpenMP/threadprivate_codegen.cpp checks that codegen is correct. Also it checks that codegen is correct after serialization/deserialization and one of passes verifies debug info. Differential Revision: http://reviews.llvm.org/D4002 llvm-svn: 221663
* Pass around CorrectionCandidateCallbacks as unique_ptrs soKaelyn Takata2014-10-271-4/+3
| | | | | | TypoCorrectionConsumer can keep the callback around as long as needed. llvm-svn: 220693
* [OPENMP] Codegen for 'private' clause in 'parallel' directive.Alexey Bataev2014-10-211-49/+27
| | | | | | | This patch generates some helper variables which used as a private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by default (with the default constructor, if any). In outlined function references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables and implicit barier is set by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D4752 llvm-svn: 220262
* [OPENMP] Codegen for 'num_threads' clause in 'parallel' directive.Alexey Bataev2014-10-131-1/+0
| | | | | | | This patch generates call to "kmpc_push_num_threads(ident_t *loc, kmp_int32 global_tid, kmp_int32 num_threads);" library function before calling "kmpc_fork_call" each time there is an associated "num_threads" clause in the "omp parallel" directive. Differential Revision: http://reviews.llvm.org/D5145 llvm-svn: 219599
* Reduce double set lookups. NFC.Benjamin Kramer2014-10-101-2/+1
| | | | llvm-svn: 219504
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-091-6/+144
| | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. llvm-svn: 219385
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-081-62/+84
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219306
* Revert commit r219297.Alexey Bataev2014-10-081-84/+62
| | | | | | Still troubles with OpenMP/parallel_firstprivate_codegen.cpp (now in ARM buildbots). llvm-svn: 219298
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-081-62/+84
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219297
* Revert back r219295.Alexey Bataev2014-10-081-84/+62
| | | | | | To fix issues with test OpenMP/parallel_firstprivate_codegen.cpp llvm-svn: 219296
* [OPENMP] Codegen for 'firstprivate' clause.Alexey Bataev2014-10-081-62/+84
| | | | | | | | This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy. In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables. Differential Revision: http://reviews.llvm.org/D5140 llvm-svn: 219295
* Revert "[OPENMP] 'omp teams' directive basic support. Includes parsing and ↵Renato Golin2014-10-081-144/+6
| | | | | | | | | semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive." This reverts commit r219197 because it broke ARM self-hosting buildbots with segmentation fault errors in many tests. llvm-svn: 219289
* [OPENMP] 'omp teams' directive basic support.Alexey Bataev2014-10-071-6/+144
| | | | | | Includes parsing and semantic analysis for 'omp teams' directive support from OpenMP 4.0. Adds additional analysis to 'omp target' directive with 'omp teams' directive. llvm-svn: 219197
* [OPENMP] Limit the loop counters to 64 bits for the worksharing loopsAlexander Musman2014-10-061-3/+26
| | | | llvm-svn: 219113
* [OPENMP] Loop collapsing and codegen for 'omp simd' directive.Alexander Musman2014-10-011-49/+527
| | | | | | | | | | | | | This patch implements collapsing of the loops (in particular, in presense of clause 'collapse'). It calculates number of iterations N and expressions nesessary to calculate the nested loops counters values based on new iteration variable (that goes from 0 to N-1) in Sema. It also adds Codegen for 'omp simd', which uses (and tests) this feature. Differential Revision: http://reviews.llvm.org/D5184 llvm-svn: 218743
* [OPENMP] Codegen of the ‘aligned’ clause for the ‘omp simd’ directive.Alexander Musman2014-09-301-0/+5
| | | | | | Differential Revision: http://reviews.llvm.org/D5499 llvm-svn: 218660
* [OPENMP] Parsing/Sema of directive omp parallel for simdAlexander Musman2014-09-231-0/+77
| | | | llvm-svn: 218299
* [OPENMP] Initial parsing/sema analysis of 'target' directive.Alexey Bataev2014-09-191-0/+76
| | | | llvm-svn: 218110
* Parsing/Sema of directive omp for simdAlexander Musman2014-09-181-6/+64
| | | | llvm-svn: 218029
* [OPENMP] Improved DSA processing of the loop control variables for loop ↵Alexey Bataev2014-07-251-12/+24
| | | | | | directives. llvm-svn: 213925
* [OPENMP] Initial parsing and sema analysis for clause 'seq_cst' of 'atomic' ↵Alexey Bataev2014-07-241-0/+12
| | | | | | directive. llvm-svn: 213846
* [OPENMP] Initial parsing and sema analysis for clause 'capture' in 'atomic' ↵Alexey Bataev2014-07-241-7/+31
| | | | | | directive. llvm-svn: 213842
* [OPENMP] Fixed DSA detecting for function parameters: by default they must ↵Alexey Bataev2014-07-241-3/+5
| | | | | | be private. llvm-svn: 213835
* [OPENMP] Initial parsing and sema analysis for 'update' clause of 'atomic' ↵Alexey Bataev2014-07-231-1/+21
| | | | | | directive. llvm-svn: 213735
* [OPENMP] Initial parsing an sema analysis for 'write' clause of 'atomic' ↵Alexey Bataev2014-07-231-26/+39
| | | | | | directive. llvm-svn: 213728
* [OPENMP] Initial parsing and sema analysis for 'read' clause in 'atomic' ↵Alexey Bataev2014-07-231-4/+42
| | | | | | directive. llvm-svn: 213717
* [OPENMP] Initial parsing and sema analysis for 'atomic' directive.Alexey Bataev2014-07-221-4/+50
| | | | llvm-svn: 213639
* [OPENMP] Initial parsing and sema analysis for 'ordered' directive.Alexey Bataev2014-07-221-17/+99
| | | | llvm-svn: 213616
* [OPENMP] Initial parsing and sema analysis for 'flush' directive.Alexey Bataev2014-07-211-1/+48
| | | | llvm-svn: 213512
* [OPENMP] Parsing/Sema of the OpenMP directive 'critical'.Alexander Musman2014-07-211-7/+107
| | | | llvm-svn: 213510
* [OPENMP] Initial parsing and sema analysis for 'taskwait' directive.Alexey Bataev2014-07-181-0/+30
| | | | llvm-svn: 213363
* [OPENMP] Initial parsing and sema analysis for 'barrier' directive.Alexey Bataev2014-07-181-0/+38
| | | | llvm-svn: 213360
* [OPENMP] Initial parsing and sema analysis of 'taskyield' directive.Alexey Bataev2014-07-181-20/+53
| | | | llvm-svn: 213355
* [OPENMP] Initial parsing and sema analysis of 'mergeable' clause.Alexey Bataev2014-07-171-0/+12
| | | | llvm-svn: 213262
* [OPENMP] Initial support for parsing and sema analysis of 'untied' clause.Alexey Bataev2014-07-171-0/+12
| | | | llvm-svn: 213257
* [OPENMP] Parsing/Sema analysis of directive 'master'Alexander Musman2014-07-171-7/+57
| | | | llvm-svn: 213237
* [OPENMP] Initial parsing and sema analysis for 'final' clause.Alexey Bataev2014-07-171-0/+26
| | | | llvm-svn: 213232
* [OPENMP] Several cosmetic fixes in comments, tests and the code for '#pragma ↵Alexey Bataev2014-07-151-0/+3
| | | | | | omp single'. llvm-svn: 213040
* [OPENMP] Parsing and sema analysis for 'omp task' directive.Alexey Bataev2014-07-111-87/+211
| | | | llvm-svn: 212804
* [OPENMP] Parsing and sema analysis for 'omp parallel sections' directive.Alexey Bataev2014-07-081-1/+65
| | | | llvm-svn: 212516
* [OPENMP] Added initial support for 'omp parallel for'.Alexey Bataev2014-07-071-29/+122
| | | | llvm-svn: 212453
* [OPENMP] Fixed error message reporting for nesting of regionsAlexey Bataev2014-07-021-2/+2
| | | | llvm-svn: 212156
* [OPENMP] Added table with allowed nesting info for OpenMP regions (per ↵Alexey Bataev2014-06-301-0/+46
| | | | | | request from Samuel F Antao). llvm-svn: 212034
OpenPOWER on IntegriCloud