summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Codegen for `distribute simd` directive.Alexey Bataev2017-12-041-2/+12
| | | | | | Initial codegen support for `distribute simd` directive. llvm-svn: 319661
* [OPENMP] Do not allow variables to be first|last-privates inAlexey Bataev2017-12-011-10/+5
| | | | | | | | distribute directives. OpenMP standard does not allow to mark the variables as firstprivate and lastprivate at the same time in distribute-based directives. Patch fixes this problem. llvm-svn: 319560
* [c++2a] P0515R3: Support for overloaded operator<=>.Richard Smith2017-12-011-0/+1
| | | | | | No CodeGen support for MSABI yet, we don't know how to mangle this there. llvm-svn: 319513
* [OpenMP] Diagnose undeclared variables on declare target clauseKelvin Li2017-11-301-1/+1
| | | | | | | | | | | | | Clang asserts on undeclared variables on the to or link clause in the declare target directive. The patch is to properly diagnose the error. // foo1 and foo2 are not declared #pragma omp declare target to(foo1) #pragma omp declare target link(foo2) Differential Revision: https://reviews.llvm.org/D40588 llvm-svn: 319458
* [OPENMP] Fix possible assert for target regions with incorrect innerAlexey Bataev2017-11-301-1/+14
| | | | | | | | | teams region. If the inner teams region is not correct, it may cause an assertion when processing outer target region. Patch fixes this problem. llvm-svn: 319450
* [OPENMP] Allow only loop control variables in distribute simdAlexey Bataev2017-11-291-33/+12
| | | | | | | | | directives. According to the OpenMP standard, only loop control variables can be used in linear clauses of distribute-based simd directives. llvm-svn: 319362
* [OPENMP] General improvement of handling of `teams distribute`Alexey Bataev2017-11-291-2/+12
| | | | | | | | directive, NFC. Some general improvements in support of `teams distribute` directive. llvm-svn: 319320
* [OPENMP] Generalize capturing of clauses expressions.Alexey Bataev2017-11-281-84/+153
| | | | | | | The handling and capturing of the non-constant expressions of some of the capturable clauses in combined directives is generalized. llvm-svn: 319227
* [OPENMP] Codegen for `distribute parallel for simd` directive.Alexey Bataev2017-11-271-2/+13
| | | | | | Added proper codegen for `distribute parallel for simd` directive. llvm-svn: 319078
* [OPENMP] Add support for cancel constructs in `target teams distributeAlexey Bataev2017-11-221-2/+4
| | | | | | | | | parallel for`. Add support for cancel/cancellation point directives inside `target teams distribute parallel for` directives. llvm-svn: 318881
* [OPENMP] Add support for cancel constructs in [teams] distributeAlexey Bataev2017-11-221-3/+7
| | | | | | | | | parallel for directives. Added codegen/sema support for cancel constructs in [teams] distribute parallel for directives. llvm-svn: 318872
* [OPENMP] Added missed checks for for [simd] based directives.Alexey Bataev2017-11-221-0/+52
| | | | | | | Added missed checks/analysis for safelen/simdlen clauses + linear clause in for [simd] based directives. llvm-svn: 318860
* [OPENMP] General improvement of code, NFC.Alexey Bataev2017-11-221-3/+16
| | | | llvm-svn: 318849
* [OPENMP] Codegen for `target teams` directive.Alexey Bataev2017-11-221-0/+10
| | | | | | Added codegen of the clauses for `target teams` directive. llvm-svn: 318834
* [OPENMP] Initial support for asynchronous data update, NFC.Alexey Bataev2017-11-211-16/+103
| | | | | | | | | OpenMP 5.0 introduces asynchronous data update/dependecies clauses on target data directives. Patch adds initial support for outer task regions to use task-based codegen for future async target data directives. llvm-svn: 318781
* [OpenMP] Initial implementation of code generation for pragma 'teams ↵Carlo Bertolli2017-11-201-5/+111
| | | | | | | | | | distribute parallel for' on host https://reviews.llvm.org/D40187 This patch implements code gen for 'teams distribute parallel for' on the host, including all its clauses and related regression tests. llvm-svn: 318692
* [OpenMP] Show error if VLAs are not supportedJonas Hahnfeld2017-11-181-12/+19
| | | | | | | | | | | | | | Some target devices (e.g. Nvidia GPUs) don't support dynamic stack allocation and hence no VLAs. Print errors with description instead of failing in the backend or generating code that doesn't work. This patch handles explicit uses of VLAs (local variable in target or declare target region) or implicitly generated (private) VLAs for reductions on VLAs or on array sections with non-constant size. Differential Revision: https://reviews.llvm.org/D39505 llvm-svn: 318601
* [OPENMP] Codegen for `target simd` construct.Alexey Bataev2017-11-171-1/+12
| | | | | | Added codegen support for `target simd` directive. llvm-svn: 318536
* [OPENMP] Fix DSA analysis for threadprivates after deserialization.Alexey Bataev2017-11-141-0/+6
| | | | | | | If threadprivate vaible is deserialized, it is not marked as threadprivate in DSAStack. llvm-svn: 318194
* [OPENMP] Codegen for `#pragma omp target parallel for simd`.Alexey Bataev2017-11-091-6/+16
| | | | | | Added codegen for `#pragma omp target parallel for simd` and clauses. llvm-svn: 317813
* [OPENMP] Codegen for `#pragma omp target parallel for`.Alexey Bataev2017-11-081-5/+77
| | | | llvm-svn: 317719
* [OpenMP] Extend "Avoid VLAs for reduction" optimization to VLAs as baseJonas Hahnfeld2017-11-021-1/+1
| | | | | | | | | We can generate constant sized arrays whenever the array section has constant length, even if the base expression itself is a VLA. Differential Revision: https://reviews.llvm.org/D39504 llvm-svn: 317207
* [OPENMP] Improve debug info for taskgroup implicitly generatedAlexey Bataev2017-10-251-15/+13
| | | | | | expressions. llvm-svn: 316585
* [OPENMP] Constify function parameters, NFC.Alexey Bataev2017-10-251-3/+4
| | | | llvm-svn: 316584
* [OpenMP] Avoid VLAs for some reductions on array sectionsJonas Hahnfeld2017-10-231-1/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases the compiler can deduce the length of an array section as constants. With this information, VLAs can be avoided in place of a constant sized array or even a scalar value if the length is 1. Example: int a[4], b[2]; pragma omp parallel reduction(+: a[1:2], b[1:1]) { } For chained array sections, this optimization is restricted to cases where all array sections except the last have a constant length 1. This trivially guarantees that there are no holes in the memory region that needs to be privatized. Example: int c[3][4]; pragma omp parallel reduction(+: c[1:1][1:2]) { } This relands commit r316229 that I reverted in r316235 because it failed on some bots. During investigation I found that this was because Clang and GCC evaluate the two arguments to emplace_back() in ReductionCodeGen::emitSharedLValue() in a different order, hence leading to a different order of generated instructions in the final LLVM IR. Fix this by passing in the arguments from temporary variables that are evaluated in a defined order. Differential Revision: https://reviews.llvm.org/D39136 llvm-svn: 316362
* Revert "[OpenMP] Avoid VLAs for some reductions on array sections"Jonas Hahnfeld2017-10-201-82/+1
| | | | | | | | | | This breaks at least two buildbots: http://lab.llvm.org:8011/builders/clang-cmake-x86_64-avx2-linux/builds/1175 http://lab.llvm.org:8011/builders/clang-atom-d525-fedora-rel/builds/10478 This reverts commit r316229 during local investigation. llvm-svn: 316235
* [OpenMP] Avoid VLAs for some reductions on array sectionsJonas Hahnfeld2017-10-201-1/+82
| | | | | | | | | | | | | | | | | | | | | | | In some cases the compiler can deduce the length of an array section as constants. With this information, VLAs can be avoided in place of a constant sized array or even a scalar value if the length is 1. Example: int a[4], b[2]; pragma omp parallel reduction(+: a[1:2], b[1:1]) { } For chained array sections, this optimization is restricted to cases where all array sections except the last have a constant length 1. This trivially guarantees that there are no holes in the memory region that needs to be privatized. Example: int c[3][4]; pragma omp parallel reduction(+: c[1:1][1:2]) { } Differential Revision: https://reviews.llvm.org/D39136 llvm-svn: 316229
* [Modules TS] Module ownership semantics for redeclarations.Richard Smith2017-10-101-1/+1
| | | | | | | | | | | | | | | | | When declaring an entity in the "purview" of a module, it's never a redeclaration of an entity in the purview of a default module or in no module ("in the global module"). Don't consider those other declarations as possible redeclaration targets if they're not visible, and reject any cases where we pick a prior visible declaration that violates this rule. This reinstates r315251 and r315256, reverted in r315309 and r315308 respectively, tweaked to avoid triggering a linkage calculation when declaring implicit special members (this exposed our pre-existing issue with typedef names for linkage changing the linkage of types whose linkage has already been computed and cached in more cases). A testcase for that regression has been added in r315366. llvm-svn: 315379
* Revert "[Modules TS] Module ownership semantics for redeclarations."Eric Liu2017-10-101-1/+1
| | | | | | This reverts commit r315251. See the original commit thread for reason. llvm-svn: 315309
* [Modules TS] Module ownership semantics for redeclarations.Richard Smith2017-10-091-1/+1
| | | | | | | | | | When declaring an entity in the "purview" of a module, it's never a redeclaration of an entity in the purview of a default module or in no module ("in the global module"). Don't consider those other declarations as possible redeclaration targets if they're not visible, and reject any cases where we pick a prior visible declaration that violates this rule. llvm-svn: 315251
* [OPENMP] Do not capture local static variables.Alexey Bataev2017-10-061-0/+4
| | | | | | | | Previously we may erroneously try to capture locally declared static variables, which will lead to crash for target-based constructs. Patch fixes this problem. llvm-svn: 315076
* [OPENMP] Fix mapping|privatization of implicitly captured variables.Alexey Bataev2017-10-051-14/+37
| | | | | | | | If the `defaultmap(tofrom:scalar)` clause is specified, the scalars must be mapped with 'tofrom' modifiers, otherwise they must be captured as firstprivates. llvm-svn: 314995
* [OpenMP] Initial implementation of teams distribute code generationCarlo Bertolli2017-10-041-2/+2
| | | | | | | | https://reviews.llvm.org/D38371 This patch implements codegen for the combined 'teams distribute" OpenMP pragma and adds regression tests for all its clauses. llvm-svn: 314905
* [OPENMP] Allow use of declare target directive inside structAlexey Bataev2017-10-031-1/+5
| | | | | | | | | | declaration. Patch allows using of the `#pragma omp declare target`| `#pragma omp end declare target` directives inside the structures if we need to mark as declare target only some static members. llvm-svn: 314833
* [OPENMP] Capture argument of `device` clause for target-basedAlexey Bataev2017-10-021-1/+11
| | | | | | | | | | directives. The argument of the `device` clause in target-based executable directives must be captured to support codegen for the `target` directives with the `depend` clauses. llvm-svn: 314686
* [OPENMP] Fix handling of implicit mapping of array sections.Alexey Bataev2017-09-261-2/+3
| | | | llvm-svn: 314220
* [OPENMP] Generate implicit map|firstprivate clauses for target-basedAlexey Bataev2017-09-261-32/+166
| | | | | | | | | | 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. llvm-svn: 314205
* [OPENMP] Use canonical declarations for redeclarations checks.Alexey Bataev2017-09-211-3/+6
| | | | | | | | | If the captured variable has some redeclarations we may run into the situation where the redeclaration is used instead of the canonical declaration and we may consider this variable as one not captured before. llvm-svn: 313880
* [OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) valuesRachel Craik2017-09-191-5/+11
| | | | | | | | | | | When the value specified for n in ordered(n) is larger than the number of loops a segmentation fault can occur in one of two ways when attempting to print out a diagnostic for an associated depend(sink : vec): 1) The iteration vector vec contains less than n items 2) The iteration vector vec contains a variable that is not a loop control variable This patch addresses both of these issues. Differential Revision: https://reviews.llvm.org/D38049 llvm-svn: 313675
* [OPENMP] Allow all classes as mappable types.Alexey Bataev2017-09-131-44/+0
| | | | | | | According to upcoming OpenMP 5.0 all classes/structs are now considered as mappable, even polymorphic and with static members. llvm-svn: 313141
* [OPENMP] Fix for PR34445: Reduction initializer segfaults at runtime inAlexey Bataev2017-09-061-6/+13
| | | | | | | | | | move constructor. Previously user-defined reduction initializer was considered as an assignment expression, not as initializer. Fixed this by treating the initializer expression as an initializer. llvm-svn: 312638
* [OPENMP] Fix for PR34398: assert with random access iterator if theAlexey Bataev2017-08-311-2/+2
| | | | | | | | | | | | step>1. If the loop is a loot with random access iterators and the iteration construct is represented it += n, then the compiler crashed because of reusing of the same MaterializedTemporaryExpr around N. Patch fixes it by using the expression as written, without any special kind of wrappings. llvm-svn: 312292
* [OPENMP] Capture global variables in all target executable regions.Alexey Bataev2017-08-291-1/+1
| | | | | | | | Capturing of the global variables occurs only in target regions. Patch fixes it and allows capturing of globals in all target executable directives. llvm-svn: 312024
* [OPENMP] Remove unused header files, NFC.Alexey Bataev2017-08-281-3/+0
| | | | llvm-svn: 311908
* [OPENMP] Fix for PR34321: ustom OpenMP reduction in C++ template causesAlexey Bataev2017-08-251-1/+2
| | | | | | | | | SEGFAULT at compile time Compiler crashed when tried to rebuild non-template expression in dependent context. llvm-svn: 311777
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-081-0/+33
| | | | | | | | | | | Arguments, passed to the outlined function, must have correct address space info for proper Debug info support. Patch sets global address space for arguments that are mapped and passed by reference. Also, cuda-gdb does not handle reference types correctly, so reference arguments are represented as pointers. llvm-svn: 310387
* Revert "[OPENMP][DEBUG] Set proper address space info if required by target."Alexey Bataev2017-08-081-33/+0
| | | | | | This reverts commit r310377. llvm-svn: 310379
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-081-0/+33
| | | | | | | | | | | Arguments, passed to the outlined function, must have correct address space info for proper Debug info support. Patch sets global address space for arguments that are mapped and passed by reference. Also, cuda-gdb does not handle reference types correctly, so reference arguments are represented as pointers. llvm-svn: 310377
* Revert "[OPENMP][DEBUG] Set proper address space info if required by target."Alexey Bataev2017-08-081-33/+0
| | | | | | This reverts commit r310360. llvm-svn: 310364
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-081-0/+33
| | | | | | | | | | | Arguments, passed to the outlined function, must have correct address space info for proper Debug info support. Patch sets global address space for arguments that are mapped and passed by reference. Also, cuda-gdb does not handle reference types correctly, so reference arguments are represented as pointers. llvm-svn: 310360
OpenPOWER on IntegriCloud