summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenMP] Sema and parsing for 'target teams distribute' pragmaKelvin Li2016-12-251-4/+47
| | | | | | | | This patch is to implement sema and parsing for 'target teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D28015 llvm-svn: 290508
* [OPENMP] Fix for PR31416: Clang crashes on OMPCapturedExpr during sourceAlexey Bataev2016-12-201-7/+11
| | | | | | | | | based coverage compilation Added source location info to captured expression declaration + fixed source location info for loop based directives. llvm-svn: 290181
* [OpenMP] Sema and parsing for 'target teams' pragmaKelvin Li2016-12-171-12/+46
| | | | | | | | This patch is to implement sema and parsing for 'target teams' pragma. Differential Revision: https://reviews.llvm.org/D27818 llvm-svn: 290038
* [OpenMP] support the 'is_device_ptr' clause with 'target parallel' pragmaKelvin Li2016-12-161-2/+3
| | | | | | | | This patch is to add support of the 'is_device_ptr' clause in the 'target parallel' pragma. Differential Revision: https://reviews.llvm.org/D27821 llvm-svn: 289989
* Fix assert message. NFC.Kelvin Li2016-12-141-1/+1
| | | | llvm-svn: 289657
* Fix format and a few typos in comments.Samuel Antao2016-12-121-11/+10
| | | | llvm-svn: 289450
* [OpenMP] Sema and parsing for 'teams distribute parallel for' pragmaKelvin Li2016-12-091-1/+52
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute parallel for' pragma. Differential Revision: https://reviews.llvm.org/D27345 llvm-svn: 289179
* [OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragmaKelvin Li2016-11-301-5/+63
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute parallel for simd' pragma. Differential Revision: https://reviews.llvm.org/D27084 llvm-svn: 288294
* [OPENMP] Fix for PR31137: Wrong DSA for members in struct.Alexey Bataev2016-11-281-1/+2
| | | | | | | | | If member expression is used in the task region and the base expression is a DeclRefExp and the variable used in this ref expression is private, it should be marked as implicitly firstprivate inside this region. Patch fixes this issue. llvm-svn: 288039
* Remove comments (NFC)Kelvin Li2016-11-241-1509/+0
| | | | | | Differential Revision: https://reviews.llvm.org/D27006 llvm-svn: 287852
* Re-apply patch r279045.Kelvin Li2016-10-251-1/+186
| | | | llvm-svn: 285066
* [OpenMP] Check if the template specialization is mappable instead of ↵David Sheinkman2016-10-061-3/+0
| | | | | | specialized template Differential Revision: https://reviews.llvm.org/D25252 llvm-svn: 283460
* [OpenMP] fix segfault when a variable referenced in reduction clause is a ↵David Sheinkman2016-10-041-1/+1
| | | | | | reference parameter\nDifferential Revision: http://reviews.llvm.org/D24524 llvm-svn: 283223
* Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"Diana Picus2016-08-181-186/+1
| | | | | | | | | | | | | | | | | This reverts commit r279003 as it breaks some of our buildbots (e.g. clang-cmake-aarch64-quick, clang-x86_64-linux-selfhost-modules). The error is in OpenMP/teams_distribute_simd_ast_print.cpp: clang: /home/buildslave/buildslave/clang-cmake-aarch64-quick/llvm/include/llvm/ADT/DenseMap.h:527: bool llvm::DenseMapBase<DerivedT, KeyT, ValueT, KeyInfoT, BucketT>::LookupBucketFor(const LookupKeyT&, const BucketT*&) const [with LookupKeyT = clang::Stmt*; DerivedT = llvm::DenseMap<clang::Stmt*, long unsigned int>; KeyT = clang::Stmt*; ValueT = long unsigned int; KeyInfoT = llvm::DenseMapInfo<clang::Stmt*>; BucketT = llvm::detail::DenseMapPair<clang::Stmt*, long unsigned int>]: Assertion `!KeyInfoT::isEqual(Val, EmptyKey) && !KeyInfoT::isEqual(Val, TombstoneKey) && "Empty/Tombstone value shouldn't be inserted into map!"' failed. llvm-svn: 279045
* [OpenMP] Sema and parsing for 'teams distribute simd’ pragmaKelvin Li2016-08-171-1/+186
| | | | | | | | | | This patch is to implement sema and parsing for 'teams distribute simd’ pragma. This patch is originated by Carlo Bertolli. Differential Revision: https://reviews.llvm.org/D23528 llvm-svn: 279003
* [SemaOpenMP] Some miscellaneous cleanupsDavid Majnemer2016-08-051-142/+139
| | | | | | | | Clean up some typos, follow the coding style a little more rigorously. No functionality change is intended. llvm-svn: 277840
* [OpenMP] Sema and parsing for 'teams distribute' pragmaKelvin Li2016-08-051-4/+119
| | | | | | | | This patch is to implement sema and parsing for 'teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D23189 llvm-svn: 277818
* [OpenMP] Code generation for the is_device_ptr clauseSamuel Antao2016-07-281-25/+99
| | | | | | | | | | | | Summary: This patch adds support for the is_device_ptr clause. It expands SEMA to use the mappable expression logic that can only be tested with code generation in place and check conflicts with other data sharing related clauses using the mappable expressions infrastructure. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22788 llvm-svn: 276978
* [OpenMP] Codegen for use_device_ptr clause.Samuel Antao2016-07-281-8/+57
| | | | | | | | | | | | Summary: This patch adds support for the use_device_ptr clause. It includes changes in SEMA that could not be tested without codegen, namely, the use of the first private logic and mappable expressions support. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: https://reviews.llvm.org/D22691 llvm-svn: 276977
* [OpenMP] diagnose orphaned teams constructKelvin Li2016-07-261-6/+14
| | | | | | | | | | The OpenMP spec mandates that 'a teams construct must be contained within a target construct'. Currently, this scenario is not diagnosed. This patch is to add check for orphaned teams construct and issue an error message. Differential Revision: https://reviews.llvm.org/D22785 llvm-svn: 276726
* [OpenMP] Sema and parsing for 'target simd' pragmaKelvin Li2016-07-201-1/+128
| | | | | | | | This patch is to implement sema and parsing for 'target simd' pragma. Differential Revision: https://reviews.llvm.org/D22479 llvm-svn: 276203
* [OpenMP] Ignore parens in atomic captureKelvin Li2016-07-201-2/+2
| | | | | | | | | | | | | | | Clang misdiagnoses atomic captures cases that contains parens. i.e. int v, int *p; #pragma omp atomic capture { v = (*p); (*p)++; } Patch by David S. Differential Revision: https://reviews.llvm.org/D22487 llvm-svn: 276167
* [OPENMP] Removed loop statement as its body executes at most once, NFC.Alexey Bataev2016-07-191-10/+4
| | | | | | | Removed not required loop statement, addressing comments from Richard Smith. llvm-svn: 275947
* [OpenMP] Remove dead code in conditional of mappable expressions SEMA. Samuel Antao2016-07-181-4/+4
| | | | llvm-svn: 275930
* [OpenMP] Fix incorrect diagnostics in map clauseKelvin Li2016-07-181-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 llvm-svn: 275926
* [OpenMP] add check for both simdlen and safelen clauses specifiedKelvin Li2016-07-151-85/+48
| | | | | | | | This patch adds the check for specifying both simdlen and safelen clauses on the 'distribute simd' or 'distribute parallel for simd' constructs. Differential Revision: https://reviews.llvm.org/D22384 llvm-svn: 275529
* [OpenMP] Sema and parsing for 'target parallel for simd' pragmaKelvin Li2016-07-141-3/+189
| | | | | | | | This patch is to implement sema and parsing for 'target parallel for simd' pragma. Differential Revision: http://reviews.llvm.org/D22096 llvm-svn: 275365
* [OpenMP] remove duplicate code in ActOnOpenMPRegionStartKelvin Li2016-07-131-153/+21
| | | | | | | | This patch is to remove duplicate code in ActOnOpenMPRegionStart. (NFC) Differential Revision: http://reviews.llvm.org/D22177 llvm-svn: 275323
* [OpenMP] Initial implementation of parse+sema for OpenMP clause ↵Carlo Bertolli2016-07-131-0/+44
| | | | | | | | 'is_device_ptr' of target http://reviews.llvm.org/D22070 llvm-svn: 275282
* [OpenMP] Initial implementation of parse+sema for clause use_device_ptr of ↵Carlo Bertolli2016-07-131-0/+43
| | | | | | | | | | | | | | 'target data' http://reviews.llvm.org/D21904 This patch is similar to the implementation of 'private' clause: it adds a list of private pointers to be used within the target data region to store the device pointers returned by the runtime. Please refer to the following document for a full description of what the runtime witll return in this case (page 10 and 11): https://github.com/clang-omp/OffloadingDesign I am happy to answer any question related to the runtime interface to help reviewing this patch. llvm-svn: 275271
* [OPENMP] Do not create helper expressions in dependent contexts, NFC.Alexey Bataev2016-07-071-11/+23
| | | | | | | | | OpenMP relies on some helper expressions generated during semantic analysis. But they are required only for codegen and not required in dependent contexts. Patch removes generation of some of helper expressions. llvm-svn: 274745
* [OpenMP] Sema and parsing for 'distribute simd' pragmaKelvin Li2016-07-061-2/+109
| | | | | | | | Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute simd'. Differential Revision: http://reviews.llvm.org/D22007 llvm-svn: 274604
* [OpenMP] Sema and parse for 'distribute parallel for simd'Kelvin Li2016-07-051-0/+152
| | | | | | | | Summary: This patch is an implementation of sema and parsing for the OpenMP composite pragma 'distribute parallel for simd'. Differential Revision: http://reviews.llvm.org/D21977 llvm-svn: 274530
* [OpenMP] Issue warning if a simd construct nested inside another simdKelvin Li2016-07-011-6/+10
| | | | | | construct llvm-svn: 274352
* [OpenMP] Diagnose missing cases of statements between target and teams ↵Kelvin Li2016-06-271-0/+3
| | | | | | | | | | | | | | | directives Clang fails to diagnose cases such as #pragma omp target while(0) { #pragma omp teams {} } A patch by David Sheinkman. llvm-svn: 273908
* Resubmission of http://reviews.llvm.org/D21564 after fixes.Carlo Bertolli2016-06-271-14/+204
| | | | | | | | | | | | | [OpenMP] Initial implementation of parse and sema for composite pragma 'distribute parallel for' This patch is an initial implementation for #distribute parallel for. The main differences that affect other pragmas are: The implementation of 'distribute parallel for' requires blocking of the associated loop, where blocks are "distributed" to different teams and iterations within each block are scheduled to parallel threads within each team. To implement blocking, sema creates two additional worksharing directive fields that are used to pass the team assigned block lower and upper bounds through the outlined function resulting from 'parallel'. In this way, scheduling for 'for' to threads can use those bounds. As a consequence of blocking, the stride of 'distribute' is not 1 but it is equal to the blocking size. This is returned by the runtime and sema prepares a DistIncrExpr variable to hold that value. As a consequence of blocking, the global upper bound (EnsureUpperBound) expression of the 'for' is not the original loop upper bound (e.g. in for(i = 0 ; i < N; i++) this is 'N') but it is the team-assigned block upper bound. Sema creates a new expression holding the calculation of the actual upper bound for 'for' as UB = min(UB, PrevUB), where UB is the loop upper bound, and PrevUB is the team-assigned block upper bound. llvm-svn: 273884
* Revert r273705Carlo Bertolli2016-06-241-204/+14
| | | | | | [OpenMP] Initial implementation of parse and sema for composite pragma 'distribute parallel for' llvm-svn: 273709
* [OpenMP] Initial implementation of parse and sema for composite pragma ↵Carlo Bertolli2016-06-241-14/+204
| | | | | | | | | | | | | | | 'distribute parallel for' http://reviews.llvm.org/D21564 This patch is an initial implementation for #distribute parallel for. The main differences that affect other pragmas are: The implementation of 'distribute parallel for' requires blocking of the associated loop, where blocks are "distributed" to different teams and iterations within each block are scheduled to parallel threads within each team. To implement blocking, sema creates two additional worksharing directive fields that are used to pass the team assigned block lower and upper bounds through the outlined function resulting from 'parallel'. In this way, scheduling for 'for' to threads can use those bounds. As a consequence of blocking, the stride of 'distribute' is not 1 but it is equal to the blocking size. This is returned by the runtime and sema prepares a DistIncrExpr variable to hold that value. As a consequence of blocking, the global upper bound (EnsureUpperBound) expression of the 'for' is not the original loop upper bound (e.g. in for(i = 0 ; i < N; i++) this is 'N') but it is the team-assigned block upper bound. Sema creates a new expression holding the calculation of the actual upper bound for 'for' as UB = min(UB, PrevUB), where UB is the loop upper bound, and PrevUB is the team-assigned block upper bound. llvm-svn: 273705
* Re-commit r273548, reverted in r273589, with a fix to not produceRichard Smith2016-06-231-6/+4
| | | | | | | | | | | | | | | | -Wfor-loop-analysis warnings for a for-loop with a condition variable. In such a case, the loop condition variable is modified on each iteration of the loop by definition. Original commit message: Rearrange condition handling so that semantic checks on a condition variable are performed before the other substatements of the construct are parsed, rather than deferring them until the end. This allows better error recovery from semantic errors in the condition, improves diagnostic order, and is a prerequisite for C++17 constexpr if. llvm-svn: 273600
* Revert r273548, "Rearrange condition handling so that semantic checks on a ↵Peter Collingbourne2016-06-231-4/+6
| | | | | | | | condition variable" as it caused a regression in -Wfor-loop-analysis. llvm-svn: 273589
* Rearrange condition handling so that semantic checks on a condition variableRichard Smith2016-06-231-6/+4
| | | | | | | | | are performed before the other substatements of the construct are parsed, rather than deferring them until the end. This allows better error recovery from semantic errors in the condition, improves diagnostic order, and is a prerequisite for C++17 constexpr if. llvm-svn: 273548
* Re-commit "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-211-0/+8
| | | | | | | | | | MaterializeTemporaryExpr." Since D21243 fixes relative clang-tidy tests. This reverts commit a71d9fbd41e99def9159af2b01ef6509394eaeed. llvm-svn: 273312
* [OPENMP] Fix crash for 'schedule|dist_schedule' clauses duringAlexey Bataev2016-06-151-2/+4
| | | | | | | | | | instantiation. Added checks for non-dependent context when trygin to capture non-constant schedule chunk expression for proper codegen of outlined functions. llvm-svn: 272775
* Revert "[Temporary] Add an ExprWithCleanups for each C++ ↵Tim Shen2016-06-091-8/+0
| | | | | | | | | MaterializeTemporaryExpr." This reverts r272296, since there are clang-tidy failures that appear to be caused by this change. llvm-svn: 272310
* [Temporary] Add an ExprWithCleanups for each C++ MaterializeTemporaryExpr.Tim Shen2016-06-091-0/+8
| | | | | | | | | | | These ExprWithCleanups are added for holding a RunCleanupsScope not for destructor calls; rather, they are for lifetime marks. This requires ExprWithCleanups to keep a bit to indicate whether it have cleanups with side effects (e.g. dtor calls). Differential Revision: http://reviews.llvm.org/D20498 llvm-svn: 272296
* [OpenMP] Fix SEMA bug in the capture of global variables in template functions.Samuel Antao2016-05-271-2/+4
| | | | | | | | | | | | | | Summary: Target regions require globals to be captured. This patch fixes a bug exposed when that happens in a template function. Reviewers: hfinkel, arpith-jacob, kkwli0, carlo.bertolli, ABataev Subscribers: guansong, ABataev, cfe-commits, caomhin, fraggamuffin Differential Revision: http://reviews.llvm.org/D18110 llvm-svn: 271001
* [OpenMP] Parsing and sema support for the from clauseSamuel Antao2016-05-261-6/+27
| | | | | | | | | | | | | | | Summary: The patch contains the parsing and sema support for the `from` clause. Patch based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D18488 llvm-svn: 270882
* [OpenMP] Parsing and sema support for the to clauseSamuel Antao2016-05-261-97/+172
| | | | | | | | | | | | | | | 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 llvm-svn: 270880
* [OpenMP] Parsing and sema support for target update directiveSamuel Antao2016-05-261-1/+22
| | | | | | | | | | | | | | | Summary: This patch is to add parsing and sema support for `target update` directive. Support for the `to` and `from` clauses will be added by a different patch. This patch also adds support for other clauses that are already implemented upstream and apply to `target update`, e.g. `device` and `if`. This patch is based on the original post by Kelvin Li. Reviewers: hfinkel, carlo.bertolli, kkwli0, arpith-jacob, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D15944 llvm-svn: 270878
* [OPENMP 4.5] Codegen for dacross loop synchronization constructs.Alexey Bataev2016-05-251-62/+140
| | | | | | | OpenMP 4.5 adds support for doacross loop synchronization. Patch implements codegen for this construct. llvm-svn: 270690
OpenPOWER on IntegriCloud