Commit Graph

91 Commits

Author SHA1 Message Date
Arpith Chacko Jacob 334563d01d [OpenMP] Parsing + sema for target parallel for directive.
Summary:
This patch adds parsing + sema for the target parallel for directive along with testcases.

Reviewers: ABataev

Differential Revision: http://reviews.llvm.org/D16759



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259654 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-03 15:46:42 +00:00
Arpith Chacko Jacob 4bea19d675 [OpenMP] Prevent nesting of target constructs within target code execution regions.
Summary:
This patch enhances Sema to check for the following restriction:

OpenMP 4.5 [2.17 Nesting of Regions]
If a target, target update, target data, target enter data, or
target exit data construct is encountered during execution of a
target region, the behavior is unspecified.

Reviewers: ABataev

Differential Revision: http://reviews.llvm.org/D16758



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259464 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-02 04:00:47 +00:00
Arpith Chacko Jacob 5033bd84e7 Undoing commit r259366 to debug buildbot failure.
> http://reviews.llvm.org/D16758



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259418 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 22:02:05 +00:00
Arpith Chacko Jacob 3568e530bf [OpenMP] Prevent nesting of target constructs within target code execution regions.
Summary:
This patch enhances Sema to check for the following restriction:

OpenMP 4.5 [2.17 Nesting of Regions]
If a target, target update, target data, target enter data, or
target exit data construct is encountered during execution of a
target region, the behavior is unspecified.

Reviewers: ABataev

Differential Revision: http://reviews.llvm.org/D16758



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@259366 91177308-0d34-0410-b5e6-96231b3b80d8
2016-02-01 16:32:47 +00:00
Arpith Chacko Jacob ed30907f4a [OpenMP] Parsing + sema for target parallel directive.
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258832 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 18:48:41 +00:00
Arpith Chacko Jacob dc2fa0b050 [OpenMP] Parsing + sema for defaultmap clause.
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



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-26 16:37:23 +00:00
Samuel Antao 5243a6feb0 [OpenMP] Parsing + sema for "target exit data" directive.
Patch by Arpith Jacob. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 20:04:50 +00:00
Samuel Antao faeccf347c [OpenMP] Parsing + sema for "target enter data" directive.
Patch by Arpith Jacob. Thanks!



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258165 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-19 19:15:56 +00:00
Carlo Bertolli 53cb568a9e Add OpenMP dist_schedule clause to distribute directive and related regression tests.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@257917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-15 18:50:31 +00:00
Alexey Bataev d46899a2a4 [OPENMP 4.5] Sema/parsing support for extended format of 'schedule' clause.
OpenMP 4.0-3.1 supports the next format of ‘schedule’ clause: schedule(kind[, chunk_size])
Where kind can be one of ‘static’, ‘dynamic’, ‘guided’, ‘auto’ or ‘runtime’.
OpenMP 4.5 defines the format: schedule([modifier [, modifier]:]kind[, chunk_size])
Modifier can be one of ‘monotonic’, ‘nonmonotonic’ or ‘simd’.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@256487 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-28 07:25:51 +00:00
Alexey Bataev ae37251a16 [OPENMP 4.5] Parsing/sema for 'hint' clause of 'critical' directive.
OpenMP 4.5 adds 'hint' clause to critical directive. Patch adds parsing/semantic analysis for this clause.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255625 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-15 08:19:24 +00:00
Carlo Bertolli 9ea7936015 Add parse and sema of OpenMP distribute directive with all clauses except dist_schedule
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255498 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-14 14:51:25 +00:00
NAKAMURA Takumi 67398e8c8b Revert r255001, "Add parse and sema for OpenMP distribute directive and all its clauses excluding dist_schedule."
It causes memory leak. Some tests in test/OpenMP would fail.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255094 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-09 04:35:57 +00:00
Alexey Bataev b3e5ee986e [OPENMP 4.5] Parsing/sema for 'num_tasks' clause.
OpenMP 4.5 adds directives 'taskloop' and 'taskloop simd'. These directives support clause 'num_tasks'. Patch adds parsing/semantic analysis for this clause.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255008 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08 12:06:20 +00:00
Carlo Bertolli 44e9da2f11 Add parse and sema for OpenMP distribute directive and all its clauses excluding dist_schedule.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@255001 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-08 04:21:03 +00:00
Alexey Bataev 31fe4a856b [OPENMP 4.5] parsing/sema support for 'grainsize' clause.
OpenMP 4.5 adds 'taksloop' and 'taskloop simd' directives, which have 'grainsize' clause. Patch adds parsing/sema analysis of this clause.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254903 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-07 12:52:51 +00:00
Alexey Bataev 0daec58213 [OPENMP 4.5] parsing/sema support for 'nogroup' clause.
OpenMP 4.5 adds 'taskloop' and 'taskloop simd' directives. These directives have new 'nogroup' clause. Patch adds basic parsing/sema support for this clause.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254899 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-07 10:51:44 +00:00
Alexey Bataev d50b8b580d [OPENMP 4.5] Parsing/sema support for 'omp taskloop simd' directive.
OpenMP 4.5 adds directive 'taskloop simd'. Patch adds parsing/sema analysis for 'taskloop simd' directive and its clauses.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254597 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-03 09:40:15 +00:00
Alexey Bataev fb742cf95e [OPENMP 4.5] Parsing/sema analysis for 'priority' clause.
OpenMP 4.5 defines new clause 'priority' for 'task', 'taskloop' and 'taskloop simd' directives. Added parsing and sema analysis for 'priority' clause in 'task' and 'taskloop' directives.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254398 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 10:17:31 +00:00
Alexey Bataev 3cddbb56a1 [OPENMP 4.5] Parsing/sema analysis for 'taskloop' directive.
Adds initial parsing and semantic analysis for 'taskloop' directive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254367 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-01 04:18:41 +00:00
Kelvin Li 0fafce93c6 [OpenMP] Parsing and sema support for thread_limit clause.
http://reviews.llvm.org/D15029


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254207 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-27 18:47:36 +00:00
Kelvin Li 1854a566a3 [OpenMP] Parsing and sema support for num_teams clause
http://reviews.llvm.org/D14802


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@254019 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-24 20:50:12 +00:00
Kelvin Li e72003e211 [OpenMP] Parsing and sema support for map clause
http://reviews.llvm.org/D14134 


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253849 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 05:32:03 +00:00
Samuel Antao 9ab6fa52ec [OpenMP] Capture global variables in target regions.
All global variables that are not enclosed in a declare target region 
must be captured in the target region as local variables do. Currently, 
there is no support for declare target, so this patch adds support for 
capturing all the global variables used in a the target region.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@249154 91177308-0d34-0410-b5e6-96231b3b80d8
2015-10-02 17:14:03 +00:00
Alexey Bataev 552e1f3b9b [OPENMP 4.1] Add 'simd' clause for 'ordered' directive.
Parsing and sema analysis for 'simd' clause in 'ordered' directive.
Description
If the simd clause is specified, the ordered regions encountered by any thread will use only a single SIMD lane to execute the ordered
regions in the order of the loop iterations.
Restrictions
An ordered construct with the simd clause is the only OpenMP construct that can appear in the simd region



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248696 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-28 06:39:35 +00:00
Alexey Bataev b1fbc23058 [OPENMP 4.1] Add 'threads' clause for '#pragma omp ordered'.
OpenMP 4.1 extends format of '#pragma omp ordered'. It adds 3 additional clauses: 'threads', 'simd' and 'depend'.
If no clause is specified, the ordered construct behaves as if the threads clause had been specified. If the threads clause is specified, the threads in the team executing the loop region execute ordered regions sequentially in the order of the loop iterations.
The loop region to which an ordered region without any clause or with a threads clause binds must have an ordered clause without the parameter specified on the corresponding loop directive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@248569 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-25 10:37:12 +00:00
Alexey Bataev b43e1132f4 [OPENMP 4.0] Add 'if' clause for 'cancel' directive.
Add parsing, sema analysis and codegen for 'if' clause in 'cancel' directive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@247976 91177308-0d34-0410-b5e6-96231b3b80d8
2015-09-18 08:07:34 +00:00
Alexey Bataev 4a42987243 [OPENMP 4.1] Initial support for 'simdlen' clause.
Add parsing/sema analysis for 'simdlen' clause in simd directives. Also add check that if both 'safelen' and 'simdlen' clauses are specified, the value of 'simdlen' parameter is less than the value of 'safelen' parameter.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-21 11:14:16 +00:00
Alexey Bataev df06c42715 [OPENMP 4.1] Initial support for modifiers in 'linear' clause.
OpenMP 4.1 adds 3 optional modifiers to 'linear' clause.
Format of 'linear' clause has changed to:
```
linear(linear-list[ : linear-step])
```
where linear-list is one of the following
```
list
modifier(list)
```
where modifier is one of the following:
```
 ref (C++)
 val (C/C++)
 uval (C++)
```
Patch adds parsing and sema analysis for these modifiers.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@245550 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-20 10:54:39 +00:00
Michael Wong b6f1a49465 This patch commits OpenMP 4 target device clauses
This is committed on behalf of Kelvin Li
http://reviews.llvm.org/D11469?id=31227

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@244325 91177308-0d34-0410-b5e6-96231b3b80d8
2015-08-07 16:16:36 +00:00
Michael Wong a7bf44969b Commit for http://reviews.llvm.org/D10765
for OpenMP 4 target data directive parsing and sema.
This commit is on behalf of Kelvin Li.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@242785 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-21 13:44:28 +00:00
Alexey Bataev ce92dcef1e [OPENMP 4.0] Initial support for 'omp cancel' construct.
Implemented parsing/sema analysis + (de)serialization.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241253 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-02 11:25:17 +00:00
Alexey Bataev a4233e1014 [OPENMP 4.0] Initial support for 'omp cancellation point' construct.
Add parsing and sema analysis for 'omp cancellation point' directive.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@241145 91177308-0d34-0410-b5e6-96231b3b80d8
2015-07-01 06:57:41 +00:00
Alexey Bataev a2891f255b [OPENMP] Initial support for 'depend' clause (4.0).
Parsing and sema analysis (without support for array sections in arguments) for 'depend' clause (used in 'task' directive, OpenMP 4.0).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240409 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-23 14:25:19 +00:00
Alexey Bataev 9080c07f6d [OPENMP] Support for '#pragma omp taskgroup' directive.
Added parsing, sema analysis and codegen for '#pragma omp taskgroup' directive (OpenMP 4.0).
The code for directive is generated the following way:
#pragma omp taskgroup
<body>

void __kmpc_taskgroup(<loc>, thread_id);
<body>
void __kmpc_end_taskgroup(<loc>, thread_id);


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@240011 91177308-0d34-0410-b5e6-96231b3b80d8
2015-06-18 12:14:09 +00:00
Alexey Bataev 6ff3f69756 [OPENMP] Codegen for 'copyin' clause in 'parallel' directive.
Emits the following code for the clause at the beginning of the outlined function for implicit threads:

if (<not a master thread>) {
  ...
  <thread local copy of var> = <master thread local copy of var>;
  ...
}
<sync point>;
Checking for a non-master thread is performed by comparing of the address of the thread local variable with the address of the master's variable. Master thread always uses original variables, so you always know the address of the variable in the master thread.
Differential Revision: http://reviews.llvm.org/D9026


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235075 91177308-0d34-0410-b5e6-96231b3b80d8
2015-04-16 05:39:01 +00:00
Alexey Bataev 2b16d2796f [OPENMP] 'omp teams' directive basic support.
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.  


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219385 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-09 04:18:56 +00:00
Renato Golin 37d95eb570 Revert "[OPENMP] 'omp teams' directive basic support. 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."
This reverts commit r219197 because it broke ARM self-hosting buildbots with
segmentation fault errors in many tests.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219289 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08 09:06:45 +00:00
Alexey Bataev 95a2fbb946 [OPENMP] 'omp teams' directive basic support.
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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219197 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-07 10:13:33 +00:00
Alexander Musman 03bf4c157b [OPENMP] Parsing/Sema of directive omp parallel for simd
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218299 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-23 09:33:00 +00:00
Alexey Bataev bd7dfd35d3 [OPENMP] Initial parsing/sema analysis of 'target' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218110 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-19 08:19:49 +00:00
Alexander Musman f0388485cc Parsing/Sema of directive omp for simd
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@218029 91177308-0d34-0410-b5e6-96231b3b80d8
2014-09-18 05:12:34 +00:00
Alexey Bataev d90e02095a [OPENMP] Additional comments for implicit 'flush' clause + removed unused parameter from method classof().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@214172 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-29 09:17:39 +00:00
Alexey Bataev 22c2a00293 [OPENMP] Initial parsing and sema analysis for clause 'seq_cst' of 'atomic' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213846 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-24 08:55:34 +00:00
Alexey Bataev 419a459dd6 [OPENMP] Initial parsing and sema analysis for clause 'capture' in 'atomic' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213842 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-24 06:46:57 +00:00
Alexey Bataev d380fa4856 [OPENMP] Initial parsing and sema analysis for 'update' clause of 'atomic' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213735 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-23 10:25:33 +00:00
Alexey Bataev 298a81897b [OPENMP] Initial parsing an sema analysis for 'write' clause of 'atomic' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213728 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-23 07:46:59 +00:00
Alexey Bataev 73ef460beb [OPENMP] Initial parsing and sema analysis for 'read' clause in 'atomic' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213717 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-23 02:27:21 +00:00
Alexey Bataev a005babcca [OPENMP] Initial parsing and sema analysis for 'atomic' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213639 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-22 10:10:35 +00:00
Alexey Bataev 116c37cf11 [OPENMP] Initial parsing and sema analysis for 'ordered' directive.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@213616 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-22 06:45:04 +00:00