summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP
Commit message (Collapse)AuthorAgeFilesLines
...
* [OpenMP] add check for both simdlen and safelen clauses specifiedKelvin Li2016-07-153-0/+215
| | | | | | | | 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-1424-0/+4098
| | | | | | | | 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] add more tests for 'distribute parallel for simd' pragmaKelvin Li2016-07-132-0/+1770
| | | | | | | | This patch is to add two additional tests for testing 'distribute parallel for simd' pragma with disallowed clauses and loops. Differential Revision: http://reviews.llvm.org/D22169 llvm-svn: 275315
* [OpenMP] add more tests for 'distribute simd' pragmaKelvin Li2016-07-132-0/+1873
| | | | | | | | This patch is to add two additional tests for testing 'distribute simd' pragma with disallowed clauses and loops. Differential Revision: http://reviews.llvm.org/D22176 llvm-svn: 275306
* [OpenMP] Initial implementation of parse+sema for OpenMP clause ↵Carlo Bertolli2016-07-132-0/+528
| | | | | | | | '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-132-0/+360
| | | | | | | | | | | | | | '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] Sema and parsing for 'distribute simd' pragmaKelvin Li2016-07-0612-6/+3385
| | | | | | | | 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-0519-2/+4809
| | | | | | | | 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/+26
| | | | | | construct llvm-svn: 274352
* [OpenMP] Use fopenmp prefix for all options introduced by the offloading ↵Samuel Antao2016-06-3020-406/+406
| | | | | | | | | | | | | | implementation. Summary: This patch changes the options used by offloading to start with -fopenmp instead of -fomp. This makes the option naming more consistent and materializes a suggestion by Richard Smith in http://reviews.llvm.org/D9888. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, ABataev Subscribers: kkwli0, cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D21841 llvm-svn: 274283
* [OpenMP] Diagnose missing cases of statements between target and teams ↵Kelvin Li2016-06-271-0/+6
| | | | | | | | | | | | | | | 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-2715-3/+3810
| | | | | | | | | | | | | [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-2415-3810/+3
| | | | | | [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-2415-3/+3810
| | | | | | | | | | | | | | | '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
* [OpenMP] Add the depend clause to target update construct (sema and parsing)Kelvin Li2016-06-222-12/+124
| | | | | | Differential Revision: http://reviews.llvm.org/D21532 llvm-svn: 273369
* [OpenMP] Add the nowait clause to target update construct.Kelvin Li2016-06-202-11/+28
| | | | | | Differential Revision: http://reviews.llvm.org/D21477 llvm-svn: 273190
* Re-apply r272900 - [OpenMP] Cast captures by copy when passed to fork call ↵Samuel Antao2016-06-166-60/+150
| | | | | | | | so that they are compatible to what the runtime library expects. An issue in one of the regression tests was fixed for 32-bit hosts. llvm-svn: 272931
* Revert r272900 - [OpenMP] Cast captures by copy when passed to fork call so ↵Samuel Antao2016-06-166-119/+55
| | | | | | | | that they are compatible to what the runtime library expects. Was causing trouble in one of the regression tests for a 32-bit address space. llvm-svn: 272908
* [OpenMP] Cast captures by copy when passed to fork call so that they are ↵Samuel Antao2016-06-166-55/+119
| | | | | | | | | | | | | | | | | compatible to what the runtime library expects. Summary: This patch fixes an issue detected when firstprivate variables are passed to an OpenMP outlined function vararg list. Currently they are not compatible with what the runtime library expects causing malfunction in some targets. This patch fixes the issue by moving the casting logic already in place for offloading to the common code that creates the outline function and arguments and updates the regression tests accordingly. Reviewers: hfinkel, arpith-jacob, carlo.bertolli, kkwli0, ABataev Subscribers: cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D21150 llvm-svn: 272900
* [OPENMP] Fix crash for 'schedule|dist_schedule' clauses duringAlexey Bataev2016-06-152-0/+43
| | | | | | | | | | 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
* [OPENMP 4.5] Additional codegen for statically scheduled loops withAlexey Bataev2016-05-301-2/+3
| | | | | | | | 'simd' modifier. Runtime library defines new schedule constant kmp_sch_static_balanced_chunked = 45 for static loop-based directives static with chunk adjustment (e.g., simd). Added codegen for this kind of schedule. llvm-svn: 271204
* [OPENMP 4.5] Fixed codegen for 'priority' and destructors in task-basedAlexey Bataev2016-05-3012-170/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | directives. 'kmp_task_t' record type added a new field for 'priority' clause and changed the representation of pointer to destructors for privates used within loop-based directives. Old representation: typedef struct kmp_task { /* GEH: Shouldn't this be aligned somehow? */ void *shareds; /**< pointer to block of pointers to shared vars */ kmp_routine_entry_t routine; /**< pointer to routine to call for executing task */ kmp_int32 part_id; /**< part id for the task */ kmp_routine_entry_t destructors; /* pointer to function to invoke deconstructors of firstprivate C++ objects */ /* private vars */ } kmp_task_t; New representation: typedef struct kmp_task { /* GEH: Shouldn't this be aligned somehow? */ void *shareds; /**< pointer to block of pointers to shared vars */ kmp_routine_entry_t routine; /**< pointer to routine to call for executing task */ kmp_int32 part_id; /**< part id for the task */ kmp_cmplrdata_t data1; /* Two known optional additions: destructors and priority */ kmp_cmplrdata_t data2; /* Process destructors first, priority second */ /* future data */ /* private vars */ } kmp_task_t; Also excessive initialization of 'destructors' fields to 'null' was removed from codegen if it is known that no destructors shal be used. Currently a special bit is used in 'kmp_tasking_flags_t' bitfields ('destructors_thunk' bitfield). llvm-svn: 271201
* [OpenMP] Fix SEMA bug in the capture of global variables in template functions.Samuel Antao2016-05-271-12/+163
| | | | | | | | | | | | | | 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] Fixed processing of '-fopenmp-version=' option and test.Alexey Bataev2016-05-271-7/+7
| | | | llvm-svn: 270962
* [OpenMP] Codegen for target update directive.Samuel Antao2016-05-261-0/+245
| | | | | | | | | | | | Summary: This patch implements the code generation for the `target update` directive. The implemntation relies on the logic already in place for target data standalone directives, i.e. target enter/exit data. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D20650 llvm-svn: 270886
* [OpenMP] Parsing and sema support for the from clauseSamuel Antao2016-05-266-33/+216
| | | | | | | | | | | | | | | 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-269-84/+304
| | | | | | | | | | | | | | | 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-264-0/+346
| | | | | | | | | | | | | | | 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] Add support for the 'private pointer' flag to signal variables ↵Samuel Antao2016-05-262-7/+103
| | | | | | | | | | | | | | captured in target regions and used in first-private clauses. Summary: If a variable is implicitly mapped (doesn't show in a map clause), the runtime library has to be informed if the corresponding capture shows up in first-private clause, so that the storage previously allocated in the device is used. This patch adds the support for that. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D20112 llvm-svn: 270870
* [OpenMP] Adjust map type bits according to latest spec and use zero size ↵Samuel Antao2016-05-267-194/+308
| | | | | | | | | | | | | | array sections for pointers. Summary: This patch changes the bits used to specify the map types according to the latest version of the libomptarget document and add the support for zero size array section when pointers are being implicitly mapped. This completes the missing new 4.5 map semantics. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: caomhin, cfe-commits Differential Revision: http://reviews.llvm.org/D20111 llvm-svn: 270868
* [OPENMP] Add option '-fopenmp-version=[31|40|45]' allowing choosingAlexey Bataev2016-05-262-1/+20
| | | | | | | | | | OpenMP version. If '-fopenmp' option is provided '-fopenmp-version=' allows to control, which version of OpenMP must be supported. Currently it affects only the value of _OPENMP define. llvm-svn: 270838
* [OPENMP] Set '_OPENMP' macro to '201511' value to reflect support forAlexey Bataev2016-05-261-1/+1
| | | | | | | | OpenMP 4.5. According to OpenMP 4.5 the _OPENMP macro name is defined to have the decimal value yyyymm where yyyy and mm are the year and month designations of the version of the OpenMP API that the implementation supports. Clang supports OpenMP 4.5 so updated value of _OPENMP macro to 201511. llvm-svn: 270822
* [OPENMP 4.5] Codegen for dacross loop synchronization constructs.Alexey Bataev2016-05-251-0/+124
| | | | | | | OpenMP 4.5 adds support for doacross loop synchronization. Patch implements codegen for this construct. llvm-svn: 270690
* [OPENMP] Fixed codegen for firstprivate vars in standalone worksharingAlexey Bataev2016-05-242-3/+9
| | | | | | | | directives. If firstprivate variable is is captured by value in outlined region and then used as firstprivate variable in inner worksharing directive, the copy for this firstprivate variable was not created. Fixed this bug. llvm-svn: 270536
* [OPENMP] Pass scalar firstprivate vars by value.Alexey Bataev2016-05-1713-245/+185
| | | | | | | | For better performance and to unify code with offloading part we pass scalar firstprivate values by value, instead of by reference. It will remove some extra copying operations. llvm-svn: 269751
* [OPENMP 4.5] Initial codegen for 'priority' clause in task-basedAlexey Bataev2016-05-103-3/+3
| | | | | | | | | directives. OpenMP 4.5 supports clause 'priority' in task-based directives. Patch adds initial codegen support for this clause in codegen. llvm-svn: 269050
* [OPENMP 4.0] Fixed codegen for destructors in task-based directives.Alexey Bataev2016-05-1011-51/+19
| | | | | | | | If private variables require destructors call at the deletion of the task, additional flag in task flags must be set. Patch fixes this problem. llvm-svn: 269039
* [OPENMP 4.5] Add codegen support in runtime for '[non]monotonic'Alexey Bataev2016-05-102-6/+6
| | | | | | | | | | schedule modifiers. Runtime library expects some additional data in schedule argument for loop-based directives, that have additional schedule modifiers 'monotonic|nonmonotonic'. llvm-svn: 269035
* [OpenMP] Parse+Sema for '#pragma omp declare target' syntax version 4.5Dmitry Polukhin2016-05-092-1/+58
| | | | | | | | | | | | | | | | | Support OpenMP version 4.5 syntax for #pragma omp declare target. Syntax: #pragma omp declare target (extended-list) new-line or #pragma omp declare target clause[ [,] clause ... ] new-line Where clause is one of the following: to(extended-list) link(list) Differential Revision: http://reviews.llvm.org/D20011 llvm-svn: 268925
* [OpenMP] Check for associated statements with hasAssociatedStmt() when ↵Samuel Antao2016-05-081-0/+28
| | | | | | | | | | | | | | scanning for device code. Summary: `getAssociatedStmt()` contains an assertion that assumes the statement always exists. In device code scanning, we need to look into the associated statement therefore we check its existence. This patch replaces `getAssociatedStmt` by `hasAssociatedStmt` so that we do not trigger the assertion for directives that happen not to have an associated statement (e.g target enter/exit data). Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, caomhin Differential Revision: http://reviews.llvm.org/D19812 llvm-svn: 268870
* [OPENMP 4.5] Tests for 'private|firstprivates' clauses in 'taskloop' directive.Alexey Bataev2016-05-064-0/+1870
| | | | | | Added tests for codegen for private|firstprivate clauses in taskloop-based directives. llvm-svn: 268729
* [OPENMP 4.0] Codegen for 'declare simd' directive.Alexey Bataev2016-05-061-0/+288
| | | | | | | | | OpenMP 4.0 adds support for elemental functions using declarative directive '#pragma omp declare simd'. Patch adds mangling for simd functions in accordance with https://sourceware.org/glibc/wiki/libmvec?action=AttachFile&do=view&target=VectorABI.txt llvm-svn: 268721
* [OPENMP 4.5] Codegen for 'lastprivate' clauses in 'taskloop' directives.Alexey Bataev2016-05-052-0/+1054
| | | | | | | OpenMP 4.5 adds taskloop/taskloop simd directives. These directives allow to use lastprivate clause. Patch adds codegen for this clause. llvm-svn: 268618
* [OPENMP] Fix detection of explicit data-sharing attributes in templates.Alexey Bataev2016-04-291-0/+11
| | | | | | Fixes a bug with analysis of data-sharing attributes in templates. llvm-svn: 268020
* [OPENMP] Enable correct generation of runtime call when target directive is ↵Carlo Bertolli2016-04-291-0/+10
| | | | | | | | | | separated from teams directive by multiple curly brackets http://reviews.llvm.org/D18474 This patch fixes a bug in code generation of the correct OpenMP runtime library call in presence of target and teams, when target is separated by teams with multiple curly brackets. The current implementation will not be able to see the teams directive inside target and issue a call to tgt_target instead of the correct one tgt_target_teams. llvm-svn: 267972
* [OPENMP 4.5] Initial codegen for 'taskloop simd' directive.Alexey Bataev2016-04-281-0/+211
| | | | | | | | | OpenMP 4.5 defines 'taskloop simd' directive, which is combined directive for 'taskloop' and 'simd' directives. Patch adds initial codegen support for this directive and its 2 basic clauses 'safelen' and 'simdlen'. llvm-svn: 267872
* [OPENMP 4.5] Codegen for 'grainsize/num_tasks' clauses of 'taskloop'Alexey Bataev2016-04-281-6/+8
| | | | | | | | | | | | | | | | | | | | | | | directive. OpenMP 4.5 defines 'taskloop' directive and 2 additional clauses 'grainsize' and 'num_tasks' for this directive. Patch adds codegen for these clauses. These clauses are generated as arguments of the '__kmpc_taskloop' libcall and are encoded the following way: void __kmpc_taskloop(ident_t *loc, int gtid, kmp_task_t *task, int if_val, kmp_uint64 *lb, kmp_uint64 *ub, kmp_int64 st, int nogroup, int sched, kmp_uint64 grainsize, void *task_dup); If 'grainsize' is specified, 'sched' argument must be set to '1' and 'grainsize' argument must be set to the value of the 'grainsize' clause. If 'num_tasks' is specified, 'sched' argument must be set to '2' and 'grainsize' argument must be set to the value of the 'num_tasks' clause. It is possible because these 2 clauses are mutually exclusive and can't be used at the same time on the same directive. If none of these clauses is specified, 'sched' argument must be set to '0'. llvm-svn: 267862
* [OpenMP] Code generation for target exit data directiveSamuel Antao2016-04-271-0/+221
| | | | | | | | | | | | | | | Summary: This patch adds support for the target exit data directive code generation. Given that, apart from the employed runtime call, target exit data requires the same code generation pattern as target enter data, the OpenMP codegen entry point was renamed and reused for both. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, fraggamuffin, caomhin Differential Revision: http://reviews.llvm.org/D17369 llvm-svn: 267814
* [OpenMP] Code generation for target enter data directiveSamuel Antao2016-04-271-0/+221
| | | | | | | | | | | | Summary: This patch adds support for the target enter data directive code generation. Reviewers: hfinkel, carlo.bertolli, arpith-jacob, kkwli0, ABataev Subscribers: cfe-commits, fraggamuffin, caomhin Differential Revision: http://reviews.llvm.org/D17368 llvm-svn: 267812
* [OpenMP] Code generation for target data directiveSamuel Antao2016-04-271-0/+248
| | | | | | | | | | | | | | | 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
OpenPOWER on IntegriCloud