aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Basic/OpenMPKinds.cpp
AgeCommit message (Collapse)AuthorFilesLines
2017-04-20[OpenMP] Prepare sema to support combined constructs with omp distribute and ↵Carlo Bertolli1-5/+1
omp for https://reviews.llvm.org/D32237 This patch prepares sema with additional fields to support all those composite and combined constructs of OpenMP that include pragma 'distribute' and 'for', such as 'distribute parallel for'. It also extends the regression tests for 'distribute parallel for' and adds a new one. llvm-svn: 300802
2017-02-17[OpenMP] Prepare Sema for initial implementation for pragma 'distribute ↵Carlo Bertolli1-1/+1
parallel for' https://reviews.llvm.org/D29922 This patch adds two fields for use in the implementation of 'distribute parallel for': The increment expression for the distribute loop. As the chunk assigned to a team is executed by multiple threads within the 'parallel for' region, the increment expression has to correspond to the value returned by the related runtime call (for_static_init). The upper bound of the innermost loop ('for' in 'distribute parallel for') is not the globalUB expression normally used for pragma 'for' when found in isolation. It is instead the upper bound of the chunk assigned to the team ('distribute' loop). In this way, we prevent teams from executing chunks assigned to other teams. The use of these two fields can be see in a related explanatory patch: https://reviews.llvm.org/D29508 llvm-svn: 295497
2017-01-25[OpenMP] Codegen support for 'target teams' on the host.Arpith Chacko Jacob1-1/+4
This patch adds support for codegen of 'target teams' on the host. This combined directive has two captured statements, one for the 'teams' region, and the other for the 'parallel'. This target teams region is offloaded using the __tgt_target_teams() call. The patch sets the number of teams as an argument to this call. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D29084 llvm-svn: 293005
2017-01-25Reverting commit because an NVPTX patch sneaked in. Break up into twoArpith Chacko Jacob1-4/+1
patches. llvm-svn: 293003
2017-01-25[OpenMP] Codegen support for 'target teams' on the host.Arpith Chacko Jacob1-1/+4
This patch adds support for codegen of 'target teams' on the host. This combined directive has two captured statements, one for the 'teams' region, and the other for the 'parallel'. This target teams region is offloaded using the __tgt_target_teams() call. The patch sets the number of teams as an argument to this call. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D29084 llvm-svn: 293001
2017-01-18[OpenMP] Codegen support for 'target parallel' on the host.Arpith Chacko Jacob1-0/+70
This patch adds support for codegen of 'target parallel' on the host. It is also the first combined directive that requires two or more captured statements. Support for this functionality is included in the patch. A combined directive such as 'target parallel' has two captured statements, one for the 'target' and the other for the 'parallel' region. Two captured statements are required because each has different implicit parameters (see SemaOpenMP.cpp). For example, the 'parallel' has 'global_tid' and 'bound_tid' while the 'target' does not. The patch adds support for handling multiple captured statements based on the combined directive. When codegen'ing the 'target parallel' directive, the 'target' outlined function is created using the outer captured statement and the 'parallel' outlined function is created using the inner captured statement. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28753 llvm-svn: 292419
2017-01-18Revert r292374 to debug Windows buildbot failure.Arpith Chacko Jacob1-98/+0
llvm-svn: 292400
2017-01-18[OpenMP] Codegen support for 'target parallel' on the host.Arpith Chacko Jacob1-0/+98
This patch adds support for codegen of 'target parallel' on the host. It is also the first combined directive that requires two or more captured statements. Support for this functionality is included in the patch. A combined directive such as 'target parallel' has two captured statements, one for the 'target' and the other for the 'parallel' region. Two captured statements are required because each has different implicit parameters (see SemaOpenMP.cpp). For example, the 'parallel' has 'global_tid' and 'bound_tid' while the 'target' does not. The patch adds support for handling multiple captured statements based on the combined directive. When codegen'ing the 'target parallel' directive, the 'target' outlined function is created using the outer captured statement and the 'parallel' outlined function is created using the inner captured statement. Reviewers: ABataev Differential Revision: https://reviews.llvm.org/D28753 llvm-svn: 292374
2017-01-10[OpenMP] Sema and parsing for 'target teams distribute simd’ pragmaKelvin Li1-6/+22
This patch is to implement sema and parsing for 'target teams distribute simd’ pragma. Differential Revision: https://reviews.llvm.org/D28252 llvm-svn: 291579
2017-01-03[OpenMP] Sema and parsing for 'target teams distribute parallel for simd’ ↵Kelvin Li1-11/+26
pragma This patch is to implement sema and parsing for 'target teams distribute parallel for simd’ pragma. Differential Revision: https://reviews.llvm.org/D28202 llvm-svn: 290862
2016-12-29[OpenMP] Sema and parsing for 'target teams distribute parallel for’ pragmaKelvin Li1-7/+24
This patch is to implement sema and parsing for 'target teams distribute parallel for’ pragma. Differential Revision: https://reviews.llvm.org/D28160 llvm-svn: 290725
2016-12-25[OpenMP] Sema and parsing for 'target teams distribute' pragmaKelvin Li1-7/+18
This patch is to implement sema and parsing for 'target teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D28015 llvm-svn: 290508
2016-12-17[OpenMP] Sema and parsing for 'target teams' pragmaKelvin Li1-4/+18
This patch is to implement sema and parsing for 'target teams' pragma. Differential Revision: https://reviews.llvm.org/D27818 llvm-svn: 290038
2016-12-09[OpenMP] Sema and parsing for 'teams distribute parallel for' pragmaKelvin Li1-6/+23
This patch is to implement sema and parsing for 'teams distribute parallel for' pragma. Differential Revision: https://reviews.llvm.org/D27345 llvm-svn: 289179
2016-11-30[OpenMP] Sema and parsing for 'teams distribute parallel for simd' pragmaKelvin Li1-6/+23
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
2016-10-25Re-apply patch r279045.Kelvin Li1-5/+18
llvm-svn: 285066
2016-08-18Revert "[OpenMP] Sema and parsing for 'teams distribute simd’ pragma"Diana Picus1-18/+5
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
2016-08-17[OpenMP] Sema and parsing for 'teams distribute simd’ pragmaKelvin Li1-5/+18
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
2016-08-05[OpenMP] Sema and parsing for 'teams distribute' pragmaKelvin Li1-4/+22
This patch is to implement sema and parsing for 'teams distribute' pragma. Differential Revision: https://reviews.llvm.org/D23189 llvm-svn: 277818
2016-07-20[OpenMP] Sema and parsing for 'target simd' pragmaKelvin Li1-3/+13
This patch is to implement sema and parsing for 'target simd' pragma. Differential Revision: https://reviews.llvm.org/D22479 llvm-svn: 276203
2016-07-14[OpenMP] Sema and parsing for 'target parallel for simd' pragmaKelvin Li1-4/+18
This patch is to implement sema and parsing for 'target parallel for simd' pragma. Differential Revision: http://reviews.llvm.org/D22096 llvm-svn: 275365
2016-07-13[OpenMP] Initial implementation of parse+sema for OpenMP clause ↵Carlo Bertolli1-0/+2
'is_device_ptr' of target http://reviews.llvm.org/D22070 llvm-svn: 275282
2016-07-13[OpenMP] Initial implementation of parse+sema for clause use_device_ptr of ↵Carlo Bertolli1-0/+2
'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
2016-07-06[OpenMP] Sema and parsing for 'distribute simd' pragmaKelvin Li1-4/+18
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
2016-07-05[OpenMP] remove outdated comment (NFC)Kelvin Li1-1/+0
llvm-svn: 274577
2016-07-05[OpenMP] Sema and parse for 'distribute parallel for simd'Kelvin Li1-8/+26
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
2016-06-27Resubmission of http://reviews.llvm.org/D21564 after fixes.Carlo Bertolli1-5/+22
[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
2016-06-24Revert r273705Carlo Bertolli1-22/+5
[OpenMP] Initial implementation of parse and sema for composite pragma 'distribute parallel for' llvm-svn: 273709
2016-06-24[OpenMP] Initial implementation of parse and sema for composite pragma ↵Carlo Bertolli1-5/+22
'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
2016-05-26[OpenMP] Parsing and sema support for the from clauseSamuel Antao1-0/+2
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
2016-05-26[OpenMP] Parsing and sema support for the to clauseSamuel Antao1-0/+2
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
2016-05-26[OpenMP] Parsing and sema support for target update directiveSamuel Antao1-1/+11
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
2016-04-13[OPENMP 4.0] Fixed DSA analysis for taskloop directives.Alexey Bataev1-0/+3
Patch make clang to perform analysis for task-based directives also for taskloop-based directives. llvm-svn: 266198
2016-04-12[OPENMP 4.0] Support for 'uniform' clause in 'declare simd' directive.Alexey Bataev1-0/+5
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
2016-04-06[OPENMP] Parsing and Sema support for 'omp declare target' directiveDmitry Polukhin1-0/+2
Add parsing, sema analysis for 'declare target' construct for OpenMP 4.0 (4.5 support will be added in separate patch). The declare target directive specifies that variables, functions (C, C++ and Fortran), and subroutines (Fortran) are mapped to a device. The declare target directive is a declarative directive. In Clang declare target is implemented as implicit attribute for the declaration. The syntax of the declare target directive is as follows: #pragma omp declare target declarations-definition-seq #pragma omp end declare target Based on patch from Michael Wong http://reviews.llvm.org/D15321 llvm-svn: 265530
2016-03-30[OPENMP 4.0] Initial support for '#pragma omp declare simd' directive.Alexey Bataev1-0/+2
Initial parsing/sema/serialization/deserialization support for '#pragma omp declare simd' directive. The 'declare simd' construct can be applied to a function to enable the creation of one or more versions that can process multiple arguments using SIMD instructions from a single invocation from a SIMD loop. If the function has any declarations, then the declare simd construct for any declaration that has one must be equivalent to the one specified for the definition. Otherwise, the result is unspecified. This pragma can be applied many times to the same declaration. Internally this pragma is represented as an attribute. But we need special processing for this pragma because it must be used before function declaration, this directive is applied to. Differential Revision: http://reviews.llvm.org/D10599 llvm-svn: 264853
2016-03-03[OPENMP 4.0] Initial support for 'omp declare reduction' construct.Alexey Bataev1-0/+1
Add parsing, sema analysis and serialization/deserialization for 'declare reduction' construct. User-defined reductions are defined as #pragma omp declare reduction( reduction-identifier : typename-list : combiner ) [initializer ( initializer-expr )] These custom reductions may be used in 'reduction' clauses of OpenMP constructs. The combiner specifies how partial results can be combined into a single value. The combiner can use the special variable identifiers omp_in and omp_out that are of the type of the variables being reduced with this reduction-identifier. Each of them will denote one of the values to be combined before executing the combiner. It is assumed that the special omp_out identifier will refer to the storage that holds the resulting combined value after executing the combiner. As the initializer-expr value of a user-defined reduction is not known a priori the initializer-clause can be used to specify one. Then the contents of the initializer-clause will be used as the initializer for private copies of reduction list items where the omp_priv identifier will refer to the storage to be initialized. The special identifier omp_orig can also appear in the initializer-clause and it will refer to the storage of the original variable to be reduced. Differential Revision: http://reviews.llvm.org/D11182 llvm-svn: 262582
2016-02-03[OpenMP] Parsing + sema for target parallel for directive.Arpith Chacko Jacob1-9/+20
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
2016-02-02[OpenMP] Prevent nesting of target constructs within target code execution ↵Arpith Chacko Jacob1-2/+9
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 llvm-svn: 259464
2016-02-01Undoing commit r259366 to debug buildbot failure.Arpith Chacko Jacob1-9/+2
> http://reviews.llvm.org/D16758 llvm-svn: 259418
2016-02-01[OpenMP] Prevent nesting of target constructs within target code execution ↵Arpith Chacko Jacob1-2/+9
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 llvm-svn: 259366
2016-01-26[OpenMP] Parsing + sema for target parallel directive.Arpith Chacko Jacob1-1/+12
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
2016-01-26[OpenMP] Parsing + sema for defaultmap clause.Arpith Chacko Jacob1-0/+22
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
2016-01-19[OpenMP] Parsing + sema for "target exit data" directive.Samuel Antao1-0/+10
Patch by Arpith Jacob. Thanks! llvm-svn: 258177
2016-01-19[OpenMP] Parsing + sema for "target enter data" directive.Samuel Antao1-0/+10
Patch by Arpith Jacob. Thanks! llvm-svn: 258165
2016-01-15Add OpenMP dist_schedule clause to distribute directive and related ↵Carlo Bertolli1-0/+15
regression tests. llvm-svn: 257917
2015-12-28[OPENMP 4.5] Sema/parsing support for extended format of 'schedule' clause.Alexey Bataev1-5/+13
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’. llvm-svn: 256487
2015-12-15[OPENMP 4.5] Parsing/sema for 'hint' clause of 'critical' directive.Alexey Bataev1-1/+12
OpenMP 4.5 adds 'hint' clause to critical directive. Patch adds parsing/semantic analysis for this clause. llvm-svn: 255625
2015-12-14Add parse and sema of OpenMP distribute directive with all clauses except ↵Carlo Bertolli1-1/+16
dist_schedule llvm-svn: 255498
2015-12-09Revert r255001, "Add parse and sema for OpenMP distribute directive and all ↵NAKAMURA Takumi1-16/+1
its clauses excluding dist_schedule." It causes memory leak. Some tests in test/OpenMP would fail. llvm-svn: 255094