Commit Graph

23 Commits

Author SHA1 Message Date
Alexey Bataev 8eb6a2dbe7 [OPENMP] Analyze the type of the mapped entity instead of its base.
If the mapped entity is a data member, we erroneously checked the type
of its base rather than the type of the mapped entity itself.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@331385 91177308-0d34-0410-b5e6-96231b3b80d8
2018-05-02 18:44:10 +00:00
Alexey Bataev e273bc1916 [OPENMP] Emit warning for non-trivial types in map clauses.
If the mapped type is non-trivial, the warning message is emitted for
better user experience.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326251 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27 21:31:11 +00:00
Alexey Bataev c55b070633 [OPENMP] Allow multiple mappings for member expressions for pointers.
If several member expressions are mapped and they reference the same
address as a base, but access different members, this must be allowed.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@326212 91177308-0d34-0410-b5e6-96231b3b80d8
2018-02-27 17:42:00 +00:00
Alexey Bataev 68d230359a [OPENMP] Support for -fopenmp-simd option with compilation of simd loops
only.

Added support for -fopenmp-simd option that allows compilation of
simd-based constructs without emission of OpenMP runtime calls.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321560 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-29 18:07:07 +00:00
Alexey Bataev 330ea9e419 [OPENMP] Improve error message for mapping union members.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319897 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-06 15:04:36 +00:00
Alexey Bataev b3d5240383 [OPENMP] Fix implicit mapping analysis.
Fixed processing of implicitly mapped objects in target-based executable
directives.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319814 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 19:20:09 +00:00
Alexey Bataev 6dee2d7289 [OPENMP] Fix assert fail after target implicit map checks.
If the error is generated during analysis of implicitly or explicitly
mapped variables, it may cause compiler crash because of incorrect
analysis.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@319774 91177308-0d34-0410-b5e6-96231b3b80d8
2017-12-05 15:22:49 +00:00
Alexey Bataev 1cb203aa36 [OPENMP] Fix handling of implicit mapping of array sections.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314220 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-26 16:19:04 +00:00
Alexey Bataev bd9a973c97 [OPENMP] Generate implicit map|firstprivate clauses for target-based
directives.

If the variable is used in the target-based region but is not found in
any private|mapping clause, then generate implicit firstprivate|map
clauses for these implicitly mapped variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@314205 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-26 13:47:31 +00:00
Alexey Bataev ec9c00261b [OPENMP] Allow all classes as mappable types.
According to upcoming OpenMP 5.0 all classes/structs are now considered
as mappable, even polymorphic and with static members.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@313141 91177308-0d34-0410-b5e6-96231b3b80d8
2017-09-13 11:12:35 +00:00
Alexey Bataev 1c50ce32c7 [OPENMP] Allow 'use_device_ptr' clause in 'target data' alone.
According to OpenMP 5.0 at least one 'map' or 'use_device_ptr' clause
must be specified for 'target data' construct. Patch adds support for
this feature.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@304216 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-30 16:00:04 +00:00
Carlo Bertolli 1a4fbda71e [OpenMP] Extended parse for 'always' map modifier
https://reviews.llvm.org/D32807

This patch allows the map modifier 'always' to be separated by the map type (to, from, tofrom) only by a whitespace, rather than strictly by a comma as in current trunk.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@302031 91177308-0d34-0410-b5e6-96231b3b80d8
2017-05-03 15:28:48 +00:00
David Sheinkman ba7b135011 [OpenMP] Check if the template specialization is mappable instead of specialized template Differential Revision: https://reviews.llvm.org/D25252
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@283460 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-06 15:47:36 +00:00
Kelvin Li 7a77c15ec6 [OpenMP] Allow negative lower bound in array sections based on pointers
OpenMP 4.5 removed the restriction that array section lower bound must be non negative.
This change is to allow negative values for array section based on pointers.
For array section based on array type there is still a restriction: "The array section must be a subset of the original array."

Patch by David S.

Differential Revision: https://reviews.llvm.org/D22481


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@276177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-20 20:45:29 +00:00
Kelvin Li 3c6458e714 [OpenMP] Fix incorrect diagnostics in map clause
Having the following code pattern will result in incorrect diagnostic

int main() {
  int arr[10];
#pragma omp target data map(arr[:])
#pragma omp target map(arr)
  {}
}

t.cpp:4:24: error: original storage of expression in data environment is shared
      but data environment do not fully contain mapped expression storage
#pragma omp target map(arr)
                       ^~~
t.cpp:3:29: note: used here
#pragma omp target data map(arr[:])
                            ^~~~~~
1 error generated.


Patch by David S.

Differential Revision: https://reviews.llvm.org/D22075


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@275926 91177308-0d34-0410-b5e6-96231b3b80d8
2016-07-18 22:49:16 +00:00
Samuel Antao 0a889a035d [OpenMP] Parsing and sema support for the to clause
Summary:
The patch contains the parsing and sema support for the `to` clause. 

Patch based on the original post by Kelvin Li.

Reviewers: carlo.bertolli, hfinkel, kkwli0, arpith-jacob, ABataev

Subscribers: caomhin, cfe-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@270880 91177308-0d34-0410-b5e6-96231b3b80d8
2016-05-26 17:39:58 +00:00
Alexey Bataev 695440e304 Revert "[OPENMP] Allow skip expression after comma in clauses with lists."
This reverts commit http://reviews.llvm.org/rL265003. After some
thoughts decided to emit errors here.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265119 91177308-0d34-0410-b5e6-96231b3b80d8
2016-04-01 08:43:42 +00:00
Alexey Bataev 01680934f1 [OPENMP] Allow skip expression after comma in clauses with lists.
Compatibility fix for better compatibility with the existing software.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265003 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-31 09:13:44 +00:00
Carlo Bertolli 4bbdb724f0 [OPENMP] Implementation of codegen for firstprivate clause of target directive
This patch implements the following aspects:

It extends sema to check that a variable is not reference in both a map clause and firstprivate or private. This is needed to ensure correct functioning at codegen level, apart from being useful for the user.
It implements firstprivate for target in codegen. The implementation applies to both host and nvptx devices.
It adds regression tests for codegen of firstprivate, host and device side when using the host as device, and nvptx side.
Please note that the regression test for nvptx codegen is missing VLAs. This is because VLAs currently require saving and restoring the stack which appears not to be a supported operation by nvptx backend.

It adds a check in sema regression tests for target map, firstprivate, and private clauses.

http://reviews.llvm.org/D18203




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-18 21:43:32 +00:00
Samuel Antao c527fb5d2d [OpenMP] Add support for multidimensional array sections in map clause SEMA.
Summary: In some cases it can be proved statically that multidimensional array section refer to contiguous storage and can therefore be allowed in a map clause. This patch adds support for those cases in SEMA.

Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@263019 91177308-0d34-0410-b5e6-96231b3b80d8
2016-03-09 15:46:05 +00:00
Samuel Antao 6b055c1055 [OpenMP] Remove '#if 1' hanging in target_map_messages.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 20:52:54 +00:00
Samuel Antao d70617d208 [OpenMP] Update map clause SEMA to support OpenMP 4.5 possible list items.
Summary:
Extend support in the map clause SEMA for the expressions supported in the OpenMP 4.5 specification, namely member expressions.  

Fix some bugs in the previous implementation of SEMA related with expressions that do not consist of single variable references.

Fix bug in parsing when the expression in the map clause do not start with an identifier: accept any expression in the map clause and check for validity in SEMA instead of just ignoring it.

Reviewers: hfinkel, kkwli0, arpith-jacob, carlo.bertolli, ABataev

Subscribers: cfe-commits, fraggamuffin, caomhin

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@258543 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-22 20:21:36 +00:00
Kelvin Li c9ecf6a82d [OpenMP] Parsing and sema support for map clause - add test case
http://reviews.llvm.org/D14134 



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@253850 91177308-0d34-0410-b5e6-96231b3b80d8
2015-11-23 05:36:37 +00:00