summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Do not crash on codegen for CXX member functions.Alexey Bataev2018-04-301-0/+3
| | | | | | | Non-static member functions should not be emitted as a standalone functions, this leads to compiler crash. llvm-svn: 331206
* [OPENMP] Do not crash on incorrect input data.Alexey Bataev2018-04-301-11/+36
| | | | | | | | Emit error messages instead of compiler crashing when the target region does not exist in the device code + fix crash when the location comes from macros. llvm-svn: 331195
* [OPENMP] Allow to use declare target variables in map clausesAlexey Bataev2018-04-161-10/+7
| | | | | | | | Global variables marked as declare target are allowed to be used in map clauses. Patch fixes the crash of the compiler on the declare target variables in map clauses. llvm-svn: 330156
* [OPENMP] General code improvements.Alexey Bataev2018-04-161-717/+859
| | | | llvm-svn: 330140
* [OPENMP] Replace push_back by emplace_back, NFC.Alexey Bataev2018-04-131-9/+9
| | | | llvm-svn: 330042
* [OPENMP] Additional attributes for the pointer parameters.Alexey Bataev2018-04-101-0/+8
| | | | | | Added attributes for better optimization of the OpenMP code. llvm-svn: 329751
* Fix typos in clangAlexander Kornienko2018-04-061-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found via codespell -q 3 -I ../clang-whitelist.txt Where whitelist consists of: archtype cas classs checkk compres definit frome iff inteval ith lod methode nd optin ot pres statics te thru Patch by luzpaz! (This is a subset of D44188 that applies cleanly with a few files that have dubious fixes reverted.) Differential revision: https://reviews.llvm.org/D44188 llvm-svn: 329399
* PR36992: do not store beyond the dsize of a class object unless we knowRichard Smith2018-04-051-1/+1
| | | | | | | | | | | | | | the tail padding is not reused. We track on the AggValueSlot (and through a couple of other initialization actions) whether we're dealing with an object that might share its tail padding with some other object, so that we can avoid emitting stores into the tail padding if that's the case. We still widen stores into tail padding when we can do so. Differential Revision: https://reviews.llvm.org/D45306 llvm-svn: 329342
* [OPENMP] Added emission of offloading data sections for declare targetAlexey Bataev2018-03-301-105/+227
| | | | | | | | | | variables. Added emission of the offloading data sections for the variables within declare target regions + fixes emission of the declare target variables marked as declare target not within the declare target region. llvm-svn: 328888
* [OPENMP] Codegen for ctor|dtor of declare target variables.Alexey Bataev2018-03-281-49/+164
| | | | | | | | When the declare target variables are emitted for the device, constructors|destructors for these variables must emitted and registered by the runtime in the offloading sections. llvm-svn: 328705
* [OPENMP] Codegen for declare target with link clause.Alexey Bataev2018-03-261-67/+121
| | | | | | | | If the link clause is used on the declare target directive, the object should be linked on target or target data directives, not during the codegen. Patch adds support for this clause. llvm-svn: 328544
* [OPENMP] Codegen for `omp declare target` construct.Alexey Bataev2018-03-151-5/+49
| | | | | | | | Added initial codegen for device side of declarations inside `omp declare target` construct + codegen for implicit `declare target` functions, which are used in the target regions. llvm-svn: 327636
* [OpenMP] Add OpenMP data sharing infrastructure using global memoryGheorghe-Teodor Bercea2018-03-141-0/+5
| | | | | | | | | | | | | | | | | Summary: This patch handles the Clang code generation phase for the OpenMP data sharing infrastructure. TODO: add a more detailed description. Reviewers: ABataev, carlo.bertolli, caomhin, hfinkel, Hahnfeld Reviewed By: ABataev Subscribers: jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D43660 llvm-svn: 327513
* [OPENMP] Fix the address of the original variable in task reductions.Alexey Bataev2018-03-091-0/+3
| | | | | | | | If initialization of the task reductions requires pointer to original variable, which is stored in the threadprivate storage, we used the address of this pointer instead. llvm-svn: 327136
* [OPENMP] Fix generation of the unique names for task reductionAlexey Bataev2018-03-061-16/+27
| | | | | | | | | | | variables. If the task has reduction construct and this construct for some variable requires unique threadprivate storage, we may generate different names for variables used in taskgroup task_reduction clause and in task in_reduction clause. Patch fixes this problem. llvm-svn: 326827
* [OPENMP] Scan all redeclarations looking for `declare simd` attribute.Alexey Bataev2018-03-021-65/+69
| | | | | | | | | Patch fixes the problem with the functions marked as `declare simd`. If the canonical declaration does not have associated `declare simd` construct, we may not generate required code even if other redeclarations are marked as `declare simd`. llvm-svn: 326594
* Remove redundant casts. NFCGeorge Burgess IV2018-03-011-4/+2
| | | | | | | | | | | | | | | | | | | So I wrote a clang-tidy check to lint out redundant `isa`, `cast`, and `dyn_cast`s for fun. This is a portion of what it found for clang; I plan to do similar cleanups in LLVM and other subprojects when I find time. Because of the volume of changes, I explicitly avoided making any change that wasn't highly local and obviously correct to me (e.g. we still have a number of foo(cast<Bar>(baz)) that I didn't touch, since overloading is a thing and the cast<Bar> did actually change the type -- just up the class hierarchy). I also tried to leave the types we were cast<>ing to somewhere nearby, in cases where it wasn't locally obvious what we were dealing with before. llvm-svn: 326416
* Pass a GlobalDecl to SetInternalFunctionAttributes. NFC.Rafael Espindola2018-02-281-10/+10
| | | | | | | | This just reduces the noise in a followup patch. Part of D43900. llvm-svn: 326385
* [OPENMP] Require valid SourceLocation in function call, NFC.Alexey Bataev2018-02-221-5/+5
| | | | | | | Removed default empty SourceLocation argument from `emitCall` function and require valid location. llvm-svn: 325812
* Recommit rL323952: [DebugInfo] Enable debug information for C99 VLA types.Sander de Smalen2018-02-031-1/+1
| | | | | | Fixed build issue when building with g++-4.8 (specialization after instantiation). llvm-svn: 324173
* Reverting patch rL323952 due to build errors that ISander de Smalen2018-02-011-1/+1
| | | | | | haven't encountered in local builds. llvm-svn: 323956
* [DebugInfo] Enable debug information for C99 VLA typesSander de Smalen2018-02-011-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: This patch enables debugging of C99 VLA types by generating more precise LLVM Debug metadata, using the extended DISubrange 'count' field that takes a DIVariable. This should implement: Bug 30553: Debug info generated for arrays is not what GDB expects (not as good as GCC's) https://bugs.llvm.org/show_bug.cgi?id=30553 Reviewers: echristo, aprantl, dexonsmith, clayborg, pcc, kristof.beyls, dblaikie Reviewed By: aprantl Subscribers: jholewinski, schweitz, davide, fhahn, JDevlieghere, cfe-commits Differential Revision: https://reviews.llvm.org/D41698 llvm-svn: 323952
* [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
OpenPOWER on IntegriCloud