summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP] Support for -fopenmp-simd option with compilation of simd loopsAlexey Bataev2017-12-291-12/+115
| | | | | | | | | only. Added support for -fopenmp-simd option that allows compilation of simd-based constructs without emission of OpenMP runtime calls. llvm-svn: 321560
* [OPENMP] Support for `depend` clauses on `target data update`.Alexey Bataev2017-12-271-21/+148
| | | | | | Added codegen for `depend` clauses on `target data update` directives. llvm-svn: 321493
* [c++20] P0515R3: Parsing support and basic AST construction for operator <=>.Richard Smith2017-12-141-0/+1
| | | | | | | | | | | | | | | Adding the new enumerator forced a bunch more changes into this patch than I would have liked. The -Wtautological-compare warning was extended to properly check the new comparison operator, clang-format needed updating because it uses precedence levels as weights for determining where to break lines (and several operators increased their precedence levels with this change), thread-safety analysis needed changes to build its own IL properly for the new operator. All "real" semantic checking for this operator has been deferred to a future patch. For now, we use the relational comparison rules and arbitrarily give the builtin form of the operator a return type of 'void'. llvm-svn: 320707
* [OPENMP] Initial codegen for `target teams distribute simd` directive.Alexey Bataev2017-12-131-11/+45
| | | | | | | Host + generic device codegen for `target teams distribute simd` directive. llvm-svn: 320608
* [OPENMP] Simplify codegen for loop iteration variables in loop preamble.Alexey Bataev2017-12-081-1/+6
| | | | | | | Initial patch could cause trouble in the optimized code because of the incorrectly generated lifetime intrinsics. llvm-svn: 320191
* [OPENMP] Initial codegen for `target teams distribute` directive.Alexey Bataev2017-12-081-11/+45
| | | | | | Host + default devices codegen for `target teams distribute` directive. llvm-svn: 320149
* [OPENMP] Initial codegen for `teams distribute simd` directive.Alexey Bataev2017-12-061-13/+23
| | | | | | Host + default devices codegen for `teams distribute simd` directive. llvm-svn: 319896
* [OPENMP] Fix PR35486: crash when collapsing loops with dependent iteration ↵Alexey Bataev2017-12-041-0/+3
| | | | | | | | | | spaces. Though it is incorrect from point of view of OpenMP standard to have dependent iteration space in OpenMP loops, compiler should not crash. Patch fixes this problem. llvm-svn: 319700
* [OpenMP] Initial implementation of code generation for pragma 'teams ↵Carlo Bertolli2017-12-041-12/+22
| | | | | | | | | | distribute parallel for simd' on host https://reviews.llvm.org/D40795 This includes regression tests for all associated clauses. llvm-svn: 319696
* [OPENMP] Codegen for `distribute simd` directive.Alexey Bataev2017-12-041-21/+54
| | | | | | Initial codegen support for `distribute simd` directive. llvm-svn: 319661
* [OPENMP] General improvement of handling of `teams distribute`Alexey Bataev2017-11-291-1/+1
| | | | | | | | directive, NFC. Some general improvements in support of `teams distribute` directive. llvm-svn: 319320
* [OPENMP] Codegen for `distribute parallel for simd` directive.Alexey Bataev2017-11-271-7/+5
| | | | | | | Initial codegen for `#pragma omp distribute parallel for simd` directive and its clauses. llvm-svn: 319079
* [OPENMP] Improve handling of cancel directives in target-basedAlexey Bataev2017-11-271-6/+4
| | | | | | | | | constructs, NFC. Improved handling of cancel|cancellation point directives inside target-based for directives. llvm-svn: 319046
* [OPENMP] Add support for cancel constructs in `target teams distributeAlexey Bataev2017-11-221-1/+5
| | | | | | | | | 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-7/+17
| | | | | | | | | parallel for directives. Added codegen/sema support for cancel constructs in [teams] distribute parallel for directives. llvm-svn: 318872
* [OPENMP] Do not mark captured variables as artificial in debug info.Alexey Bataev2017-11-221-3/+21
| | | | | | | Captured variables should not be marked as artificial parameters in outlined functions in debug info. llvm-svn: 318843
* [OPENMP] Codegen for `target teams` directive.Alexey Bataev2017-11-221-2/+11
| | | | | | Added codegen of the clauses for `target teams` directive. llvm-svn: 318834
* [OPENMP] Initial support for asynchronous data update, NFC.Alexey Bataev2017-11-211-3/+24
| | | | | | | | | 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-12/+22
| | | | | | | | | | 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
* Fix some -Wunused-variable warningsHans Wennborg2017-11-181-1/+0
| | | | llvm-svn: 318578
* [OPENMP] Codegen for `target simd` construct.Alexey Bataev2017-11-171-78/+100
| | | | | | Added codegen support for `target simd` directive. llvm-svn: 318536
* [OPENMP] Add support for cancelling inside target parallel forAlexey Bataev2017-11-161-1/+3
| | | | | | | | directive. Added missed support for cancelling of target parallel for construct. llvm-svn: 318434
* [OPENMP] Codegen for `#pragma omp target parallel for simd`.Alexey Bataev2017-11-091-12/+38
| | | | | | 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-9/+34
| | | | llvm-svn: 317719
* [CodeGen] Generate TBAA info for reference loadsIvan A. Kosarev2017-10-301-2/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D39177 llvm-svn: 316896
* [OPENMP] Fix PR35013: Fix passing VLAs captures to outlined functions.Alexey Bataev2017-10-241-1/+7
| | | | | | | Fixed passing of VLAs and variably-modified types to outlined functions. Synchronized passing with the types codegen. llvm-svn: 316488
* [OpenMP] Avoid VLAs for some reductions on array sectionsJonas Hahnfeld2017-10-231-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-5/+2
| | | | | | | | | | 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-2/+5
| | | | | | | | | | | | | | | | | | | | | | | 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
* [OPENMP] Fix capturing of boolean variables in debug mode.Alexey Bataev2017-10-171-4/+5
| | | | | | | | If the variables is boolean and we generating inner function with real types, the codegen may crash because of not loading boolean value from memory. llvm-svn: 316011
* [OPENMP] Add default codegen|tests for 'target parallel for[ simd]'Alexey Bataev2017-10-101-1/+8
| | | | | | | | | constructs. Added default codegen for 'target parallel for' construct + tests for default codegen of 'target parallel for[ simd]' constructs. llvm-svn: 315315
* [CodeGen] Do not construct complete LValue base info in trivial casesIvan A. Kosarev2017-10-101-7/+7
| | | | | | | | | | | | | Besides obvious code simplification, avoiding explicit creation of LValueBaseInfo objects makes it easier to make TBAA information to be part of such objects. This is part of D38126 reworked to be a separate patch to simplify review. Differential Revision: https://reviews.llvm.org/D38695 llvm-svn: 315289
* [OpenMP] Initial implementation of teams distribute code generationCarlo Bertolli2017-10-041-12/+22
| | | | | | | | 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] Capture argument of `device` clause for target-basedAlexey Bataev2017-10-021-0/+4
| | | | | | | | | | 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] Generate implicit map|firstprivate clauses for target-basedAlexey Bataev2017-09-261-0/+16
| | | | | | | | | | 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] Fix for PR33922: New ident_t flags forAlexey Bataev2017-09-061-4/+7
| | | | | | | | | | | | __kmpc_for_static_fini(). Added special flags for calls of __kmpc_for_static_fini(), like previous ly for __kmpc_for_static_init(). Added flag OMP_IDENT_WORK_DISTRIBUTE for distribute cnstruct, OMP_IDENT_WORK_SECTIONS for sections-based constructs and OMP_IDENT_WORK_LOOP for loop-based constructs in location flags. llvm-svn: 312642
* [OPENMP] Fix for PR34014: OpenMP 4.5: Target construct in static methodAlexey Bataev2017-08-221-0/+2
| | | | | | | | | | of class fails to map class static variable. If the global variable is captured and it has several redeclarations, sometimes it may lead to a compiler crash. Patch fixes this by working only with canonical declarations. llvm-svn: 311479
* [OPENMP] Fix for PR28581: OpenMP linear clause - wrong results.Alexey Bataev2017-08-161-5/+8
| | | | | | | | | | If worksharing construct has at least one linear item, an implicit synchronization point must be emitted to avoid possible conflict with the loading/storing values to the original variables. Added implicit barrier if the linear item is found before actual start of the worksharing construct. llvm-svn: 311013
* [OPENMP] Fix for PR33922: New ident_t flags forAlexey Bataev2017-08-141-17/+22
| | | | | | | | | | | | | __kmpc_for_static_init(). OpenMP 5.0 will include OpenMP Tools interface that requires distinguishing different worksharing constructs. Since the same entry point (__kmp_for_static_init(ident_t *loc, kmp_int32 global_tid,........)) is called in case static loop/sections/distribute it is suggested using 'flags' field of the ident_t structure to pass the type of the construct. llvm-svn: 310865
* [OPENMP][DEBUG] Fix for PR33676: Debug info for OpenMP region is broken.Alexey Bataev2017-08-141-2/+2
| | | | | | | After some changes in clang/LLVM debug info for task-based regions was not generated at all. Patch fixes this problem. llvm-svn: 310850
* [OPENMP] Generalization of calls of the outlined functions.Alexey Bataev2017-08-141-5/+7
| | | | | | General improvement of the outlined functions calls. llvm-svn: 310840
* [OPENMP] Emit non-debug version of outlined functions with originalAlexey Bataev2017-08-091-16/+15
| | | | | | | | | | | name. If the host code is compiled with the debug info, while the target without, there is a problem that the compiler is unable to find the debug wrapper. Patch fixes this problem by emitting special name for the debug version of the code. llvm-svn: 310511
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-081-13/+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-51/+18
| | | | | | This reverts commit r310377. llvm-svn: 310379
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-081-18/+51
| | | | | | | | | | | 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-44/+13
| | | | | | This reverts commit r310360. llvm-svn: 310364
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-081-13/+44
| | | | | | | | | | | 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
* Revert "[OPENMP][DEBUG] Set proper address space info if required by target."Alexey Bataev2017-08-041-42/+13
| | | | | | This reverts commit r310104. llvm-svn: 310135
* Revert "[OPENMP] Fix for pacify buildbots, NFC."Alexey Bataev2017-08-041-12/+18
| | | | | | This reverts commit r310120. llvm-svn: 310134
* [OPENMP] Fix for pacify buildbots, NFC.Alexey Bataev2017-08-041-18/+12
| | | | llvm-svn: 310120
OpenPOWER on IntegriCloud