summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntime.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP] Do not create offloading entry for declare target variablesAlexey Bataev2018-08-291-1/+9
| | | | | | | | | declarations. We should not create offloading entries for declare target var declarations as it causes compiler crash. llvm-svn: 340968
* [OPENMP] Create non-const ident_t objects.Mike Rice2018-08-291-12/+13
| | | | | | | | | | | Currently ident_t objects are created const when debug info is not enabled, but the libittnotify libray in the OpenMP runtime writes to the reserved_2 field (See __kmp_itt_region_forking in openmp/runtime/src/kmp_itt.inl). Now create ident_t objects non-const. Differential Revision: https://reviews.llvm.org/D51331 llvm-svn: 340934
* [OPENMP] FIx processing of declare target variables.Alexey Bataev2018-08-151-6/+9
| | | | | | | | The compiler may produce unexpected error messages/crashes when declare target variables were used. Patch fixes problems with the declarations marked as declare target to or link. llvm-svn: 339805
* [OPENMP] Fix processing of declare target construct.Alexey Bataev2018-08-141-28/+10
| | | | | | | The attribute marked as inheritable since OpenMP 5.0 supports it + additional fixes to support new functionality. llvm-svn: 339704
* [OPENMP] Fix emission of the loop doacross constructs.Alexey Bataev2018-08-131-32/+60
| | | | | | | The number of loops associated with the OpenMP loop constructs should not be considered as the number loops to collapse. llvm-svn: 339603
* Revert "[OPENMP] Fix emission of the loop doacross constructs."Alexey Bataev2018-08-131-60/+32
| | | | | | This reverts commit r339568 because of the problems with the buildbots. llvm-svn: 339574
* [OPENMP] Fix emission of the loop doacross constructs.Alexey Bataev2018-08-131-32/+60
| | | | | | | The number of loops associated with the OpenMP loop constructs should not be considered as the number loops to collapse. llvm-svn: 339568
* Port getLocEnd -> getEndLocStephen Kelly2018-08-091-1/+1
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 llvm-svn: 339386
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-12/+12
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 llvm-svn: 339385
* [OPENMP] Mark variables captured in declare target region as implicitlyAlexey Bataev2018-08-071-1/+18
| | | | | | | | | declare target. According to OpenMP 5.0, variables captured in lambdas in declare target regions must be considered as implicitly declare target. llvm-svn: 339152
* [OpenMP] Encode offload target triples into comdat key for offload ↵Sergey Dmitriev2018-08-031-1/+13
| | | | | | | | | | | | initialization code Encoding offload target triples onto comdat group key for offload initialization code guarantees that it will be executed once per each unique combination of offload targets. Differential Revision: https://reviews.llvm.org/D50218 llvm-svn: 338916
* [OPENMP] Change linkage of offloading symbols to support droppingAlexey Bataev2018-07-311-2/+4
| | | | | | | | offload targets. Changed the linkage of omp_offloading.img_start.<triple> and omp_offloading.img_end.<triple> symbols from external to external weak to allow dropping of some targets during linking. llvm-svn: 338413
* [OPENMP] Prevent problems with linking of the static variables.Alexey Bataev2018-07-311-0/+13
| | | | | | No need to change the linkage, we can avoid the problem using special variable. That points to the original variable and, thus, prevent some of the optimizations that might break the compilation. llvm-svn: 338399
* [OPENMP] ThreadId in serialized parallel regions is 0.Alexey Bataev2018-07-251-2/+2
| | | | | | | | The first argument for the parallel outlined functions, called as serialized parallel regions, should be a pointer to the global thread id that always is 0. llvm-svn: 337957
* Fix unused variable warning.Erich Keane2018-07-191-1/+1
| | | | llvm-svn: 337473
* The patch adds support for the new map interface between clang and ↵Alexey Bataev2018-07-191-293/+492
| | | | | | | | | | | libomptarget. The changes in the interface are the following: device IDs are now 64-bit integers (as opposed to 32-bit) map flags are 64-bit long (used to be 32-bit) mappings for partially mapped structs are now calculated at compile time and members of partially mapped structs are flagged using the MEMBER_OF field Support for is_device_ptr on struct members was dropped - this functionality is not supported by the OpenMP standard and its implementation is technically infeasible (however, use_device_ptr on struct members works as a non-standard extension of the compiler) llvm-svn: 337468
* [OPENMP] Fix checks for declare target link entries.Alexey Bataev2018-07-161-13/+37
| | | | | | | | If the declare target link entries are created but not used, the compiler will produce an error message. Patch improves handling of such situations + improves checks for possibly lost declare target variables. llvm-svn: 337207
* [OPENMP] Fix syntactic errors in error messages.Alexey Bataev2018-07-161-2/+2
| | | | | | Fixed spelling of the offloading error messages. llvm-svn: 337196
* Diagnose missing 'template' keywords in more cases.Richard Smith2018-06-261-1/+1
| | | | | | | | | | | | | | | | | | | | We track when we see a name-shaped expression followed by a '<' token and parse the '<' as a comparison. Then: * if we see a token sequence that cannot possibly be an expression but can be a template argument (in particular, a type-id) that follows either a ',' or the '<', diagnose that the '<' was supposed to start a template argument list, and * if we see '>()', diagnose that the '<' was supposed to start a template argument list. This only changes the diagnostic for error cases, and in practice appears to catch the most common cases where a missing 'template' keyword leads to parse errors within a template. Differential Revision: https://reviews.llvm.org/D48571 llvm-svn: 335687
* Move helper classes into anonymous namespaces. NFCI.Benjamin Kramer2018-05-151-3/+4
| | | | llvm-svn: 332400
* [OPENMP] Generate unique names for offloading regions id.Alexey Bataev2018-05-091-1/+1
| | | | | | | It is required to emit unique names for offloading regions ids. Required to support compilation and linking of several compilation units. llvm-svn: 331899
* [OPENMP] Mark global tors/dtors as used.Alexey Bataev2018-05-091-0/+2
| | | | | | | | | | | If the global variables are marked as declare target and they need ctors/dtors, these ctors/dtors are emitted and then invoked by the offloading runtime library. They are not explicitly used in the emitted code and thus can be optimized out. Patch marks these functions as used, so the optimizer cannot remove these function during the optimization phase. llvm-svn: 331879
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-94/+94
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* [OPENMP, NVPTX] Fix linkage of the global entries.Alexey Bataev2018-05-081-5/+5
| | | | | | | The linkage of the global entries must be weak to enable support of redefinition of the same target regions in multiple compilation units. llvm-svn: 331768
* [OPENMP, NVPTX] Added support for L2 parallelism.Alexey Bataev2018-05-071-7/+0
| | | | | | | Added initial codegen for level 2, 3 etc. parallelism. Currently, all the second, the third etc. parallel regions will run sequentially. llvm-svn: 331642
* [OPENMP] Support C++ member functions in the device constructs.Alexey Bataev2018-05-021-10/+3
| | | | | | | Added correct emission of the C++ member functions for the device function when they are used in the device constructs. llvm-svn: 331365
* [OPENMP] Emit names of the globals depending on target.Alexey Bataev2018-05-021-72/+118
| | | | | | | | Some symbols are not allowed to be used as names on some targets. Patch ries to unify the emission of the names of LLVM globals so they could be used on different targets. llvm-svn: 331358
* [OPENMP] Emit template instatiation|specialization functions forAlexey Bataev2018-05-011-1/+10
| | | | | | | | | | devices. If the function is an instantiation|specialization of the template and is used in the device code, the definitions of such functions should be emitted for the device. llvm-svn: 331261
* [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
OpenPOWER on IntegriCloud