summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenMP] Code generation for target data directiveSamuel Antao2016-04-271-7/+27
| | | | | | | | | | | | | | | Summary: This patch adds support for the target data directive code generation. Part of the already existent functionality related with data maps is moved to a new function so that it could be reused. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, fraggamuffin, caomhin Differential Revision: http://reviews.llvm.org/D17367 llvm-svn: 267811
* [OPENMP] Fix crash on initialization of classes with no init clause inAlexey Bataev2016-04-271-3/+3
| | | | | | | | | | declare reductions. If reduction clause is applied to instance of class with user-defined reduction operation without initialization clause, it may cause a crash. Patch fixes this issue. llvm-svn: 267695
* [OPENMP] Fix for codegen of captured variables in inlined directives.Alexey Bataev2016-04-271-17/+46
| | | | | | | | Currently there is a problem with codegen of inlined directives inside lambdas, it may cause a crash during codegen because of incorrect capturing of variables. Patch fixes this problem. llvm-svn: 267677
* [OPENMP 4.5] Codegen for 'taskloop' directive.Alexey Bataev2016-04-251-45/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The taskloop construct specifies that the iterations of one or more associated loops will be executed in parallel using OpenMP tasks. The iterations are distributed across tasks created by the construct and scheduled to be executed. The next code will be generated for the taskloop directive: #pragma omp taskloop num_tasks(N) lastprivate(j) for( i=0; i<N*GRAIN*STRIDE-1; i+=STRIDE ) { int th = omp_get_thread_num(); #pragma omp atomic counter++; #pragma omp atomic th_counter[th]++; j = i; } Generated code: task = __kmpc_omp_task_alloc(NULL,gtid,1,sizeof(struct task),sizeof(struct shar),&task_entry); psh = task->shareds; psh->pth_counter = &th_counter; psh->pcounter = &counter; psh->pj = &j; task->lb = 0; task->ub = N*GRAIN*STRIDE-2; task->st = STRIDE; __kmpc_taskloop( NULL, // location gtid, // gtid task, // task structure 1, // if clause value &task->lb, // lower bound &task->ub, // upper bound STRIDE, // loop increment 0, // 1 if nogroup specified 2, // schedule type: 0-none, 1-grainsize, 2-num_tasks N, // schedule value (ignored for type 0) (void*)&__task_dup_entry // tasks duplication routine ); llvm-svn: 267395
* [OPENMP] Fix for PR27463: Privatizing struct fields with array typeAlexey Bataev2016-04-221-1/+1
| | | | | | | | | | causes code generation failure. The codegen part of firstprivate clause for member decls used type of original variable without skipping reference type from OMPCapturedExprDecl. Patch fixes this problem. llvm-svn: 267125
* [OPENMP] Fix for LCV in simd directives in explicit clauses.Alexey Bataev2016-04-221-84/+125
| | | | | | | | 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
* [OPENMP] Codegen for untied tasks.Alexey Bataev2016-04-201-42/+42
| | | | | | | | If the untied clause is present on a task construct, any thread in the team can resume the task region after a suspension. Patch adds proper codegen for untied tasks. llvm-svn: 266853
* Revert "[OPENMP] Codegen for untied tasks."Alexey Bataev2016-04-191-42/+42
| | | | | | This reverts commit r266754. llvm-svn: 266755
* [OPENMP] Codegen for untied tasks.Alexey Bataev2016-04-191-42/+42
| | | | | | | | If the untied clause is present on a task construct, any thread in the team can resume the task region after a suspension. Patch adds proper codegen for untied tasks. llvm-svn: 266754
* Revert "[OPENMP] Codegen for untied tasks."Alexey Bataev2016-04-191-42/+42
| | | | | | This reverts commit 266722. llvm-svn: 266724
* [OPENMP] Codegen for untied tasks.Alexey Bataev2016-04-191-42/+42
| | | | | | If the untied clause is present on a task construct, any thread in the team can resume the task region after a suspension. Patch adds proper codegen for untied tasks. llvm-svn: 266722
* [OPENMP 4.0] Support for 'uniform' clause in 'declare simd' directive.Alexey Bataev2016-04-121-0/+1
| | | | | | | | | OpenMP 4.0 defines clause 'uniform' in 'declare simd' directive: 'uniform' '(' <argument-list> ')' The uniform clause declares one or more arguments to have an invariant value for all concurrent invocations of the function in the execution of a single SIMD loop. The special this pointer can be used as if was one of the arguments to the function in any of the linear, aligned, or uniform clauses. llvm-svn: 266041
* NFC: make AtomicOrdering an enum classJF Bastien2016-04-061-9/+12
| | | | | | | | | | | | Summary: See LLVM change D18775 for details, this change depends on it. Reviewers: jyknight, reames Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D18776 llvm-svn: 265569
* [OPENMP] Codegen for teams directive for NVPTXCarlo Bertolli2016-04-041-12/+5
| | | | | | | | | | | | This patch implements the teams directive for the NVPTX backend. It is different from the host code generation path as it: Does not call kmpc_fork_teams. All necessary teams and threads are started upon touching the target region, when launching a CUDA kernel, and their execution is coordinated through sequential and parallel regions within the target region. Does not call kmpc_push_num_teams even if a num_teams of thread_limit clause is present. Setting the number of teams and the thread limit is implemented by the nvptx-related runtime. Please note that I am now passing a Clang Expr * to emitPushNumTeams instead of the originally chosen llvm::Value * type. The reason for that is that I want to avoid emitting expressions for num_teams and thread_limit if they are not needed in the target region. http://reviews.llvm.org/D17963 llvm-svn: 265304
* [OPENMP] Remove extra code transformation.Alexey Bataev2016-03-291-0/+24
| | | | | | | | | For better support of some specific GNU extensions some extra transformation of AST nodes were introduced. These transformations are very hard to handle. The code is improved in handling of these extensions by using captured expressions construct. llvm-svn: 264709
* [OPENMP] Allow runtime insert its own code inside OpenMP regions.Alexey Bataev2016-03-291-102/+137
| | | | | | | | | | Solution unifies interface of RegionCodeGenTy type to allow insert runtime-specific code before/after main codegen action defined in CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy for general OpenMP directives, but must be allowed to insert its own (required) code to support target specific codegen. llvm-svn: 264700
* Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."Alexey Bataev2016-03-281-137/+102
| | | | | | Reverting because of failed tests. llvm-svn: 264577
* [OPENMP] Allow runtime insert its own code inside OpenMP regions.Alexey Bataev2016-03-281-102/+137
| | | | | | | | | | Solution unifies interface of RegionCodeGenTy type to allow insert runtime-specific code before/after main codegen action defined in CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy for general OpenMP directives, but must be allowed to insert its own (required) code to support target specific codegen. llvm-svn: 264576
* Revert "[OPENMP] Allow runtime insert its own code inside OpenMP regions."Alexey Bataev2016-03-281-137/+102
| | | | | | This reverts commit 3ee791165100607178073f14531a0dc90c622b36. llvm-svn: 264570
* [OPENMP] Allow runtime insert its own code inside OpenMP regions.Alexey Bataev2016-03-281-102/+137
| | | | | | | | | | Solution unifies interface of RegionCodeGenTy type to allow insert runtime-specific code before/after main codegen action defined in CGStmtOpenMP.cpp file. Runtime should not define its own RegionCodeGenTy for general OpenMP directives, but must be allowed to insert its own (required) code to support target specific codegen. llvm-svn: 264569
* [OPENMP 4.0] Use 'declare reduction' constructs in 'reduction' clauses.Alexey Bataev2016-03-171-19/+136
| | | | | | | | OpenMP 4.0 allows to define custom reduction operations using '#pragma omp declare reduction' construct. Patch allows to use this custom defined reduction operations in 'reduction' clauses. llvm-svn: 263701
* Preserve ExtParameterInfos into CGFunctionInfo.John McCall2016-03-111-2/+1
| | | | | | | | | As part of this, make the function-arrangement interfaces a little simpler and more semantic. NFC. llvm-svn: 263191
* [OPENMP 4.5] Codegen for data members in 'linear' clauseAlexey Bataev2016-03-091-28/+68
| | | | | | | | OpenMP 4.5 allows privatization of non-static data members in OpenMP constructs. Patch adds proper codegen support for data members in 'linear' clause llvm-svn: 263003
* [OPENMP 4.5] Codegen for data members in 'linear' clause.Alexey Bataev2016-03-091-15/+2
| | | | | | | OpenMP 4.5 allows to use data members in private clauses. Patch adds codegen support for 'linear' clause. llvm-svn: 263002
* [OPENMP] Codegen for distribute directive: fix bug in ordering of parameters.Carlo Bertolli2016-03-071-1/+1
| | | | llvm-svn: 262833
* Reapply r262741 [OPENMP] Codegen for distribute directiveCarlo Bertolli2016-03-071-69/+228
| | | | | | | | This patch provide basic implementation of codegen for teams directive, excluding all clauses except dist_schedule. It also fixes parts of AST reader/writer to enable correct pre-compiled header handling. http://reviews.llvm.org/D17170 llvm-svn: 262832
* Revert r262741 - [OPENMP] Codegen for distribute directiveSamuel Antao2016-03-041-228/+69
| | | | | | Was causing a failure in one of the buildbot slaves. llvm-svn: 262744
* [OPENMP] Codegen for distribute directiveCarlo Bertolli2016-03-041-69/+228
| | | | | | | | This patch provide basic implementation of codegen for teams directive, excluding all clauses except dist_schedule. It also fixes parts of AST reader/writer to enable correct pre-compiled header handling. http://reviews.llvm.org/D17170 llvm-svn: 262741
* [OPENMP] firstprivate and private clauses of teams, host codegenerationCarlo Bertolli2016-03-031-0/+17
| | | | | | | | Add code generation support for firstprivate and private clauses of teams on the host. Add extensive regression tests including lambda functions and vla testing. http://reviews.llvm.org/D17582 llvm-svn: 262663
* Add code generation for teams directive inside target regionCarlo Bertolli2016-03-031-7/+44
| | | | llvm-svn: 262652
* [OpenMP] Code generation for teams - kernel launchingSamuel Antao2016-03-031-2/+6
| | | | | | | | | | | | | | | Summary: This patch implements the launching of a target region in the presence of a nested teams region, i.e calls tgt_target_teams with the required arguments gathered from the enclosed teams directive. The actual codegen of the region enclosed by the teams construct will be contributed in a separate patch. Reviewers: hfinkel, arpith-jacob, kkwli0, carlo.bertolli, ABataev Subscribers: cfe-commits, caomhin, fraggamuffin Differential Revision: http://reviews.llvm.org/D17019 llvm-svn: 262625
* [OPENMP 4.5] Initial support for data members in 'linear' clause.Alexey Bataev2016-03-031-2/+10
| | | | | | | | OpenMP 4.5 allows to privatize data members of current class in member functions. Patch adds initial support for privatization of data members in 'linear' clause, no codegen support. llvm-svn: 262578
* [OPENMP 4.5] Codegen for data members in 'reduction' clause.Alexey Bataev2016-03-021-0/+41
| | | | | | | | OpenMP 4.5 allows to privatize non-static data members of current class in non-static member functions. Patch supports codegen for non-static data members in 'reduction' clauses. llvm-svn: 262460
* [OPENMP 4.5] Codegen for member decls in 'lastprivate' clause.Alexey Bataev2016-02-251-15/+2
| | | | | | | | | OpenMP 4.5 allows to privatize non-static member decls in non-static member functions. Patch captures such decls by reference in general (for bitfields, by value) and then operates with this capture. For bitfields, at the end of codegen for lastprivates original bitfield is updated with the value of captured copy. llvm-svn: 261824
* Remove use of builtin comma operator.Richard Trieu2016-02-181-6/+13
| | | | | | Cleanup for upcoming Clang warning -Wcomma. No functionality change intended. llvm-svn: 261271
* [OPENMP] Fix codegen for lastprivate loop counters.Alexey Bataev2016-02-181-60/+33
| | | | | | | Patch fixes bug with codegen for lastprivate loop counters. Also it may improve performance for lastprivates calculations in some cases. llvm-svn: 261209
* [OPENMP 4.5] Codegen support for data members in 'firstprivate' clause.Alexey Bataev2016-02-171-9/+4
| | | | | | Added codegen for captured data members in non-static member functions. llvm-svn: 261089
* [OPENMP] Improved handling of pseudo-captured expressions in OpenMP.Alexey Bataev2016-02-161-85/+110
| | | | | | | | Expressions inside 'schedule'|'dist_schedule' clause must be captured in combined directives to avoid possible crash during codegen. Patch improves handling of such constructs llvm-svn: 260954
* [OPENMP] Remove extra sync barriers for 'firstprivate' clause.Alexey Bataev2016-02-151-20/+26
| | | | | | | Sync barrier will be emitted after generation of firstprivate variables only if one of the firstprivate vars is used in lastprivate clause. llvm-svn: 260877
* [OPENMP] Rename OMPCapturedFieldDecl to OMPCapturedExprDecl, NFC.Alexey Bataev2016-02-111-9/+3
| | | | | | | | OMPCapturedExprDecl allows caopturing not only of fielddecls, but also other expressions. It also allows to simplify codegen for several clauses. llvm-svn: 260492
* [OPENMP 4.0] Fixed support of array sections/array subscripts.Alexey Bataev2016-02-041-39/+61
| | | | | | Codegen for array sections/array subscripts worked only for expressions with arrays as base. Patch fixes codegen for bases with pointer/reference types. llvm-svn: 259776
* [OpenMP] Parsing + sema for target parallel for directive.Arpith Chacko Jacob2016-02-031-0/+5
| | | | | | | | | | | Summary: This patch adds parsing + sema for the target parallel for directive along with testcases. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16759 llvm-svn: 259654
* [OpenMP] Parsing + sema for target parallel directive.Arpith Chacko Jacob2016-01-261-0/+5
| | | | | | | | | | | | | Summary: This patch adds parsing + sema for the target parallel directive and its clauses along with testcases. Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16553 Rebased to current trunk and updated test cases. llvm-svn: 258832
* [OpenMP] Parsing + sema for defaultmap clause.Arpith Chacko Jacob2016-01-261-0/+1
| | | | | | | | | | | Summary: This patch adds parsing + sema for the defaultmap clause associated with the target directive (among others). Reviewers: ABataev Differential Revision: http://reviews.llvm.org/D16527 llvm-svn: 258817
* [OPENMP 4.5] Allow arrays in 'reduction' clause.Alexey Bataev2016-01-261-20/+84
| | | | | | OpenMP 4.5, alogn with array sections, allows to use variables of array type in reductions. llvm-svn: 258804
* [OPENMP] Generalize codegen for 'sections'-based directive.Alexey Bataev2016-01-221-132/+101
| | | | | | If 'sections' directive has only one sub-section, the code for 'single'-based directive was emitted. Removed this codegen, because it causes crashes in different cases. llvm-svn: 258495
* [OPENMP] Fix crash on reduction for complex variables.Alexey Bataev2016-01-211-10/+10
| | | | | | reworked codegen for reduction operation for complex types to avoid crash llvm-svn: 258394
* [OPENMP 4.0] Fix for codegen of 'cancel' directive within 'sections' directive.Alexey Bataev2016-01-201-1/+6
| | | | | | Allow to emit code for 'cancel' directive within 'sections' directive with single sub-section. llvm-svn: 258307
* [OpenMP] Parsing + sema for "target exit data" directive.Samuel Antao2016-01-191-0/+5
| | | | | | Patch by Arpith Jacob. Thanks! llvm-svn: 258177
* [OpenMP] Parsing + sema for "target enter data" directive.Samuel Antao2016-01-191-0/+5
| | | | | | Patch by Arpith Jacob. Thanks! llvm-svn: 258165
OpenPOWER on IntegriCloud