summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [CodeGen] Decorate aggregate accesses with TBAA tagsIvan A. Kosarev2018-01-251-3/+4
| | | | | | Differential Revision: https://reviews.llvm.org/D41539 llvm-svn: 323421
* [OPENMP] Replace call of EmitLoadOfLValue() by EmitLoadOfScalar(), NFC.Alexey Bataev2018-01-231-11/+9
| | | | | | | Replace calls of EmitLoadOfLValue() by EmitLoadOfScalar() functions if it is known that the value is scalar. llvm-svn: 323236
* [OPENMP] Remove more empty SourceLocations() from the code.Alexey Bataev2018-01-231-16/+13
| | | | | | | Removed more empty SourceLocations() from the OpenMP code and replaced with the correct locations for better debug info emission. llvm-svn: 323232
* [OpenMP] Correct generation of offloading entriesJonas Hahnfeld2018-01-181-5/+4
| | | | | | | | | | | Firstly, each offloading entry must have a unique name or the linker will complain if there are multiple files with target regions. Secondly, the compiler must not introduce padding so mark the struct with a PackedAttr. Differential Revision: https://reviews.llvm.org/D42168 llvm-svn: 322858
* [OPENMP] Initial codegen for `target teams distribute parallel forAlexey Bataev2018-01-151-0/+6
| | | | | | | | | simd`. Added host codegen + codegen for devices with default codegen for `#pragma omp target teams distribute parallel for simd` directive. llvm-svn: 322515
* [OPENMP] Add codegen for `depend` clauses on `target` directive.Alexey Bataev2018-01-151-115/+161
| | | | | | | Added basic support for codegen of `depend` clauses on `target` directive. llvm-svn: 322501
* [OPENMP] Replace calls of getAssociatedStmt().Alexey Bataev2018-01-121-8/+10
| | | | | | | | | | | | | getAssociatedStmt() returns the outermost captured statement for the OpenMP directive. It may return incorrect region in case of combined constructs. Reworked the code to reduce the number of calls of getAssociatedStmt() and used getInnermostCapturedStmt() and getCapturedStmt() functions instead. In case of firstprivate variables it may lead to an extra allocas generation for private copies even if the variable is passed by value into outlined function and could be used directly as private copy. llvm-svn: 322393
* Make internal/private GVs implicitly dso_local.Rafael Espindola2018-01-111-0/+1
| | | | | | | | | | | | | | | | While updating clang tests for having clang set dso_local I noticed that: - There are *a lot* of tests to update. - Many of the updates are redundant. They are redundant because a GV is "obviously dso_local". This patch starts formalizing that a bit by requiring that internal and private GVs be dso_local too. Since they all are, we don't have to print dso_local to the textual representation, making it a bit more compact and easier to read. llvm-svn: 322318
* [OPENMP] Fix directive kind on stand-alone target data directives, NFC.Alexey Bataev2018-01-091-1/+1
| | | | llvm-svn: 322112
* [OPENMP] Add debug info for generated functions.Alexey Bataev2018-01-041-42/+51
| | | | | | | Most of the generated functions for the OpenMP were generated with disabled debug info. Patch fixes this for better user experience. llvm-svn: 321816
* [OpenMP] Initial implementation of code generation for pragma 'target teams ↵Carlo Bertolli2018-01-031-0/+5
| | | | | | | | | | distribute parallel for' on host https://reviews.llvm.org/D41709 This patch includes code generation and testing for offloading when target device is host. llvm-svn: 321759
* [OPENMP] Support for -fopenmp-simd option with compilation of simd loopsAlexey Bataev2017-12-291-0/+300
| | | | | | | | | 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-51/+92
| | | | | | Added codegen for `depend` clauses on `target data update` directives. llvm-svn: 321493
* [OPENMP] Add codegen for target data constructs with `nowait` clause.Alexey Bataev2017-12-141-3/+64
| | | | | | Added codegen for the `nowait` clause in target data constructs. llvm-svn: 320717
* [OPENMP] Add codegen for `nowait` clause in target directives.Alexey Bataev2017-12-131-3/+50
| | | | | | Added basic codegen for `nowait` clauses in target-based directives. llvm-svn: 320613
* [OPENMP] Initial codegen for `target teams distribute simd` directive.Alexey Bataev2017-12-131-0/+4
| | | | | | | Host + generic device codegen for `target teams distribute simd` directive. llvm-svn: 320608
* [OPENMP] Support `reduction` clause on target-based directives.Alexey Bataev2017-12-131-9/+17
| | | | | | | OpenMP 5.0 added support for `reduction` clause in target-based directives. Patch adds this support to clang. llvm-svn: 320596
* [OPENMP] Initial codegen for `target teams distribute` directive.Alexey Bataev2017-12-081-0/+4
| | | | | | Host + default devices codegen for `target teams distribute` directive. llvm-svn: 320149
* Fix PR35542: Correct adjusting of private reduction variableJonas Hahnfeld2017-12-061-3/+6
| | | | | | | | | | | | The adjustment is calculated with CreatePtrDiff() which returns the difference in (base) elements. This is passed to CreateGEP() so make sure that the GEP base has the correct pointer type: It needs to be a pointer to the base type, not a pointer to a constant sized array. Differential Revision: https://reviews.llvm.org/D40911 llvm-svn: 319931
* [OPENMP] Emit `__tgt_target_teams` for all teams directives.Alexey Bataev2017-12-011-26/+26
| | | | | | | | Previously we emitted `__tgt_target_teams` only for standalone teams directives. This patch allows emit this function for all teams-based directives. llvm-svn: 319585
* [OpenMP] Stable sort Privates to remove non-deterministic orderingMandeep Singh Grang2017-11-281-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes the following failures uncovered by D39245: Clang :: OpenMP/task_firstprivate_codegen.cpp Clang :: OpenMP/task_private_codegen.cpp Clang :: OpenMP/taskloop_firstprivate_codegen.cpp Clang :: OpenMP/taskloop_lastprivate_codegen.cpp Clang :: OpenMP/taskloop_private_codegen.cpp Clang :: OpenMP/taskloop_simd_firstprivate_codegen.cpp Clang :: OpenMP/taskloop_simd_lastprivate_codegen.cpp Clang :: OpenMP/taskloop_simd_private_codegen.cpp Reviewers: rjmccall, ABataev, AndreyChurbanov Reviewed By: rjmccall, ABataev Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D39947 llvm-svn: 319222
* [OPENMP] Improve handling of cancel directives in target-basedAlexey Bataev2017-11-271-0/+7
| | | | | | | | | constructs, NFC. Improved handling of cancel|cancellation point directives inside target-based for directives. llvm-svn: 319046
* [Clang][OpenMP] New clang/libomptarget map interface: new function ↵George Rokos2017-11-211-53/+57
| | | | | | | | | | | signatures, clang-side This clang patch changes the __tgt_* API function signatures in preparation for the new map interface. Changes are: Device IDs 32bits --> 64bits, Flags 32bits --> 64bits Differential revision: https://reviews.llvm.org/D40281 llvm-svn: 318789
* Fix some -Wunused-variable warningsHans Wennborg2017-11-181-1/+0
| | | | llvm-svn: 318578
* [OPENMP] Codegen for `target simd` construct.Alexey Bataev2017-11-171-0/+4
| | | | | | Added codegen support for `target simd` directive. llvm-svn: 318536
* [OPENMP] Add support for cancelling inside target parallel forAlexey Bataev2017-11-161-0/+2
| | | | | | | | 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-0/+4
| | | | | | 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-0/+4
| | | | llvm-svn: 317719
* Clang/libomptarget map interface flag renaming - NFC patchGeorge Rokos2017-11-071-41/+38
| | | | | | | | | | This patch renames some of the flag names of the clang/libomptarget map interface. The old names are slightly misleading, whereas the new ones describe in a better way what each flag is about. Only the macros within the enumeration are renamed, there is no change in functionality therefore there are no updated regression tests. Differential Revision: https://reviews.llvm.org/D39745 llvm-svn: 317598
* [OPENMP] Fix PR35152: Do not use getInvokeDest() function for EH checks.Alexey Bataev2017-11-021-1/+2
| | | | | | | The compiler may crash under some conditions if the getInvokeDest() is used, but later it is not used. Fixed this problem in OpenMP. llvm-svn: 317227
* [OPENMP] Fix PR35156: Get correct thread id with windows exceptions.Alexey Bataev2017-11-021-6/+8
| | | | | | | If the thread id is requested in windows mode within funclets, we may generate incorrect function call that could lead to broken codegen. llvm-svn: 317208
* [CodeGen] Propagate may-alias'ness of lvalues with TBAA infoIvan A. Kosarev2017-10-311-5/+4
| | | | | | | | | | | | | This patch fixes various places in clang to propagate may-alias TBAA access descriptors during construction of lvalues, thus eliminating the need for the LValueBaseInfo::MayAlias flag. This is part of D38126 reworked to be a separate patch to simplify review. Differential Revision: https://reviews.llvm.org/D39008 llvm-svn: 316988
* [CodeGen] Generate TBAA info for reference loadsIvan A. Kosarev2017-10-301-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D39177 llvm-svn: 316896
* [OpenMP] Avoid VLAs for some reductions on array sectionsJonas Hahnfeld2017-10-231-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-4/+6
| | | | | | | | | | 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-6/+4
| | | | | | | | | | | | | | | | | | | | | | | 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 PR34927: Emit initializer for reduction array with declareAlexey Bataev2017-10-121-3/+8
| | | | | | | | | reduction. If the reduction is an array or an array section and reduction operation is declare reduction without initializer, it may lead to crash. llvm-svn: 315611
* [OPENMP] Fix PR34925: Fix getting thread_id lvalue for inlined regionsAlexey Bataev2017-10-121-0/+7
| | | | | | | | | | | in C. If we try to get the lvalue for thread_id variables in inlined regions, we did not use the correct version of function. Fixed this bug by adding overrided version of the function getThreadIDVariableLValue for inlined regions. llvm-svn: 315578
* [CodeGen] Generate TBAA info along with LValue base infoIvan A. Kosarev2017-10-121-3/+6
| | | | | | | | | | | | | | | | | | This patch enables explicit generation of TBAA information in all cases where LValue base info is propagated or constructed in non-trivial ways. Eventually, we will consider each of these cases to make sure the TBAA information is correct and not too conservative. For now, we just fall back to generating TBAA info from the access type. This patch should not bring in any functional changes. This is part of D38126 reworked to be a separate patch to simplify review. Differential Revision: https://reviews.llvm.org/D38733 llvm-svn: 315575
* [OPENMP] Remove extra if, NFC.Alexey Bataev2017-10-111-1/+1
| | | | llvm-svn: 315467
* [OPENMP] Fix PR34916: Crash on mixing taskloop|tasks directives.Alexey Bataev2017-10-111-3/+14
| | | | | | | | If both taskloop and task directives are used at the same time in one program, we may ran into the situation when the particular type for task directive is reused for taskloop directives. Patch fixes this problem. llvm-svn: 315464
* [CodeGen] Do not construct complete LValue base info in trivial casesIvan A. Kosarev2017-10-101-1/+1
| | | | | | | | | | | | | 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
* Remove unused variables. No functionality change.Benjamin Kramer2017-10-081-2/+0
| | | | llvm-svn: 315196
* Remove unused variables. No functionality change.Benjamin Kramer2017-10-081-1/+0
| | | | llvm-svn: 315185
* [OPENMP] Simplify codegen for non-offloading code.Alexey Bataev2017-10-021-31/+20
| | | | | | | Simplified and generalized codegen for non-offloading part that works if offloading is failed or condition of the `if` clause is `false`. llvm-svn: 314670
* [OPENMP] Generate implicit map|firstprivate clauses for target-basedAlexey Bataev2017-09-261-46/+43
| | | | | | | | | | 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-2/+10
| | | | | | | | | | | | __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 PR34445: Reduction initializer segfaults at runtime inAlexey Bataev2017-09-061-2/+12
| | | | | | | | | | 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
* [OPRNMP] Fix for PR33445: ICE: OpenMP target containing ordered for.Alexey Bataev2017-08-161-12/+15
| | | | | | | | | | | If exceptions are enabled, there may be a problem with the codegen of the finalization functions from OpenMP runtime. It happens because of the problem with the getting of thread identifier value. Patch tries to fix it by using the result of the call of function __kmpc_global_thread_num() rather than loading of value of outlined function parameter. llvm-svn: 311007
* [OPENMP] Fix for PR33922: New ident_t flags forAlexey Bataev2017-08-141-60/+74
| | | | | | | | | | | | | __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
OpenPOWER on IntegriCloud