summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGStmtOpenMP.cpp
Commit message (Collapse)AuthorAgeFilesLines
* [OPENMP] Fix emission of the loop doacross constructs.Alexey Bataev2018-08-131-1/+32
| | | | | | | 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-15/+1
| | | | | | 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-1/+15
| | | | | | | 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-4/+4
| | | | | | | | | | Reviewers: teemperor! Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D50351 llvm-svn: 339386
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-82/+81
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 llvm-svn: 339385
* [OPENMP] DO not crash on combined constructs in declare targetAlexey Bataev2018-05-161-1/+1
| | | | | | | | | | | functions. If the combined construct is specified in the declare target function and the device code is emitted, the compiler crashes because of the incorrectly chosen captured stmt. We should choose the innermost captured statement, not the outermost. llvm-svn: 332477
* [OPENMP] Replace push_back by emplace_back, NFC.Alexey Bataev2018-04-131-2/+2
| | | | llvm-svn: 330042
* [OPENMP] Code cleanup + formatting, NFC.Alexey Bataev2018-04-131-469/+484
| | | | llvm-svn: 330040
* [OPENMP] Additional attributes for the pointer parameters.Alexey Bataev2018-04-101-1/+2
| | | | | | Added attributes for better optimization of the OpenMP code. llvm-svn: 329751
* Fix typos in clangAlexander Kornienko2018-04-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* [OPENMP, NVPTX] Globalization of the private redeclarations.Alexey Bataev2018-03-201-13/+13
| | | | | | | | If the generic codegen is enabled and private copy of the original variable escapes the declaration context, this private copy should be globalized just like it was the original variable. llvm-svn: 327985
* [OPENMP, NVPTX] Improve globalization of the variables captured by value.Alexey Bataev2018-03-151-17/+34
| | | | | | | | | | | | | If the variable is captured by value and the corresponding parameter in the outlined function escapes its declaration context, this parameter must be globalized. To globalize it we need to get the address of the original parameter, load the value, store it to the global address and use this global address instead of the original. Patch improves globalization for parallel|teams regions + functions in declare target regions. llvm-svn: 327654
* [OPENMP] Codegen for `omp declare target` construct.Alexey Bataev2018-03-151-0/+10
| | | | | | | | 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/+1
| | | | | | | | | | | | | | | | | 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] Emit sizes/init ptrs etc. data for task reductions beforeAlexey Bataev2018-03-081-10/+10
| | | | | | | | | | | using. We may emit the code in wrong order because of incorrect implementation of the runtime functions for task reductions. Threadprivate storages may be initialized after real initialization of the reduction items. Patch fixes this problem. llvm-svn: 327008
* [OPENMP] Fix lifetime of the loop counters.Alexey Bataev2018-03-071-18/+18
| | | | | | | | We may emit incorrect lifetime info during codegen for loop counters in OpenMP constructs because of automatic scope cleanup when we needed temporarily locations for private loop counters. llvm-svn: 326922
* Remove redundant casts. NFCGeorge Burgess IV2018-03-011-5/+3
| | | | | | | | | | | | | | | | | | | 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
* [OpenMP] Extend NVPTX SPMD implementation of combined constructsCarlo Bertolli2018-02-281-0/+2
| | | | | | | | Differential Revision: https://reviews.llvm.org/D43852 This patch extends the SPMD implementation to all target constructs and guards this implementation under a new flag. llvm-svn: 326368
* [OpenMP] Limit reduction support for pragma 'distribute' when combined with ↵Carlo Bertolli2018-02-221-19/+23
| | | | | | | | | | | pragma 'simd' Differential Revision: https://reviews.llvm.org/D43513 This is a bug fix that removes the emission of reduction support for pragma 'distribute' when found alone or in combinations without simd. Pragma 'distribute' does not have a reduction clause, but when combined with pragma 'simd' we need to emit the support for simd's reduction clause as part of code generation for distribute. This guard is similar to the one used for reduction support earlier in the same code gen function. llvm-svn: 325822
* [OPENMP] Fix PR36399: Crash on C code with ordered doacross construct.Alexey Bataev2018-02-151-0/+2
| | | | | | | | | Codegen for ordered with doacross construct might produce incorrect code because of missing cleanup scope for the construct. Without this scope the final runtime function call could be emitted in the wrong order that leads to incorrect codegen. llvm-svn: 325304
* Recommit rL323952: [DebugInfo] Enable debug information for C99 VLA types.Sander de Smalen2018-02-031-3/+4
| | | | | | 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-4/+3
| | | | | | haven't encountered in local builds. llvm-svn: 323956
* [DebugInfo] Enable debug information for C99 VLA typesSander de Smalen2018-02-011-3/+4
| | | | | | | | | | | | | | | | | | | | | 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-4/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D41539 llvm-svn: 323421
* [OPENMP] Replace call of EmitLoadOfLValue() by EmitLoadOfScalar(), NFC.Alexey Bataev2018-01-231-7/+4
| | | | | | | 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-61/+65
| | | | | | | Removed more empty SourceLocations() from the OpenMP code and replaced with the correct locations for better debug info emission. llvm-svn: 323232
* [OPENMP] Initial codegen for `target teams distribute parallel forAlexey Bataev2018-01-151-10/+50
| | | | | | | | | 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-12/+10
| | | | | | | Added basic support for codegen of `depend` clauses on `target` directive. llvm-svn: 322501
* [OPENMP] Replace calls of getAssociatedStmt().Alexey Bataev2018-01-121-92/+91
| | | | | | | | | | | | | 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
* Track in the AST whether the operand to a UnaryOperator can overflow and ↵Aaron Ballman2018-01-091-1/+1
| | | | | | then use that logic when evaluating constant expressions and emitting codegen. llvm-svn: 322074
* [OpenMP] Initial implementation of code generation for pragma 'target teams ↵Carlo Bertolli2018-01-031-11/+49
| | | | | | | | | | 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-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
OpenPOWER on IntegriCloud