summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP]Fix PR39694: do not capture `this` in non-`this` region.Alexey Bataev2018-11-161-2/+9
| | | | | | | | | If lambda is used inside of the OpenMP region and captures `this`, we should recapture it in the OpenMP region also. But we should do this only if the OpenMP region is used in the context of the same class, just like the lambda. llvm-svn: 347096
* Add support for 'atomic_default_mem_order' clause on 'requires' directive. ↵Patrick Lyster2018-11-021-0/+25
| | | | | | Also renamed test files relating to 'requires'. Differntial review: https://reviews.llvm.org/D53513 llvm-svn: 345967
* Create ConstantExpr classBill Wendling2018-10-311-2/+2
| | | | | | | | | | | | | | | | A ConstantExpr class represents a full expression that's in a context where a constant expression is required. This class reflects the path the evaluator took to reach the expression rather than the syntactic context in which the expression occurs. In the future, the class will be expanded to cache the result of the evaluated expression so that it's not needlessly re-evaluated Reviewed By: rsmith Differential Revision: https://reviews.llvm.org/D53475 llvm-svn: 345692
* [OPENMP] Support for mapping of the lambdas in target regions.Alexey Bataev2018-10-301-4/+54
| | | | | | | | | | Added support for mapping of lambdas in the target regions. It scans all the captures by reference in the lambda, implicitly maps those variables in the target region and then later reinstate the addresses of references in lambda to the correct addresses of the captured|privatized variables. llvm-svn: 345609
* [OPENMP]Fix PR39372: Does not complain about loop bound variable notAlexey Bataev2018-10-291-0/+2
| | | | | | | | | | | being shared. According to the standard, the variables with unspecified data-sharing attributes in presence of `default(none)` clause must be reported to users. Compiler did not generate error reports for the variables used in other OpenMP regions. Patch fixes this. llvm-svn: 345533
* [OpenMP] Fix condition.Gheorghe-Teodor Bercea2018-10-291-1/+2
| | | | | | | | | | | | | | Summary: Iteration variable must be strictly less than the number of iterations. This fixes a bug introduced by previous patch D53448. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D53827 llvm-svn: 345527
* [OpenMP][NVPTX] Use single loops when generating code for distribute ↵Gheorghe-Teodor Bercea2018-10-291-2/+15
| | | | | | | | | | | | | | | | parallel for Summary: This patch adds a new code generation path for bound sharing directives containing distribute parallel for. The new code generation scheme applies to chunked schedules on distribute and parallel for directives. The scheme simplifies the code that is being generated by eliminating the need for an outer for loop over chunks for both distribute and parallel for directives. In the case of distribute it applies to any sized chunk while in the parallel for case it only applies when chunk size is 1. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: jholewinski, guansong, cfe-commits Differential Revision: https://reviews.llvm.org/D53448 llvm-svn: 345509
* [OPENMP] Do not capture private loop counters.Alexey Bataev2018-10-291-20/+86
| | | | | | | | If the loop counter is not declared in the context of the loop and it is private, such loop counters should not be captured in the outlined regions. llvm-svn: 345505
* [OPENMP]Fix PR39422: variables are not firstprivatized in task context.Alexey Bataev2018-10-251-2/+25
| | | | | | | | | | | According to the OpenMP standard, In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above is firstprivatized. Compiler tries to implement this, but if the variable is not directly used in the task context, this variable may not be firstprivatized. Patch fixes this problem. llvm-svn: 345277
* [OPENMP]Fix PR39366: do not try to private field if it is not captured.Alexey Bataev2018-10-241-2/+8
| | | | | | | | | The compiler is crashing if we trying to post-capture the fields implicitly captured inside of the task constructs. Seems, this kind of processing is not supported and such fields should not be firstprivatized. llvm-svn: 345177
* Add support for 'dynamic_allocators' clause on 'requires' directive. ↵Patrick Lyster2018-10-111-0/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D53079 llvm-svn: 344249
* [OPENMP] Add reverse_offload clause to requires directivePatrick Lyster2018-10-031-0/+13
| | | | llvm-svn: 343711
* Add support for unified_shared_memory clause on requires directivePatrick Lyster2018-10-011-0/+13
| | | | llvm-svn: 343472
* [OPENMP]Fix PR39084: Check datasharing attributes of reduction variables only.Alexey Bataev2018-09-281-60/+58
| | | | | | | | According to OpenMP, the reduction item must be shared in parent region. But the item can be an array section or array subscript. In this case, we should not check for the datasharing of the base declaration. llvm-svn: 343356
* [OPENMP] Add support for OMP5 requires directive + unified_address clauseKelvin Li2018-09-261-1/+77
| | | | | | | | | Add support for OMP5.0 requires directive and unified_address clause. Patches to follow will include support for additional clauses. Differential Revision: https://reviews.llvm.org/D52359 llvm-svn: 343063
* [OPENMP] Add support for mapping memory pointed by member pointer.Alexey Bataev2018-09-201-0/+20
| | | | | | Added support for map(s, s.ptr[0:1]) kind of mapping. llvm-svn: 342648
* [OPENMP] Fix PR38903: Crash on instantiation of the non-dependentAlexey Bataev2018-09-131-0/+10
| | | | | | | | | | | declare reduction. If the declare reduction construct with the non-dependent type is defined in the template construct, the compiler might crash on the template instantition. Reworked the whole instantiation scheme for the declare reduction constructs to fix this problem correctly. llvm-svn: 342151
* [OPENMP] Fix PR38902: support ADL for declare reduction constructs.Alexey Bataev2018-09-121-1/+106
| | | | | | | Added support for argument-dependent lookup when trying to find the required declare reduction decl. llvm-svn: 342062
* [OPENMP] Simplified checks for declarations in declare target regions.Alexey Bataev2018-09-111-106/+36
| | | | | | | | Sema analysis should not mark functions as an implicit declare target, it may break codegen. Simplified semantic analysis and removed extra code for implicit declare target functions. llvm-svn: 341939
* [OpenMP] Add support for nested 'declare target' directivesKelvin Li2018-09-101-8/+3
| | | | | | | | | | | Add the capability to nest multiple declare target directives - including header files within a declare target region. Differential Revision: https://reviews.llvm.org/D51378 Patch by Patrick Lyster llvm-svn: 341766
* [OPENMP] Fix processing of declare target construct.Alexey Bataev2018-08-141-24/+5
| | | | | | | 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-84/+185
| | | | | | | 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-179/+84
| | | | | | 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-84/+179
| | | | | | | 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-75/+75
| | | | | | | | | | 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-7/+16
| | | | | | | | | 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] Fix PR38256: Fix locations of the artificial conditional op.Alexey Bataev2018-07-251-1/+2
| | | | | | | Fixed the source locations of the conditional op so that they don'r crash coverage pass. llvm-svn: 337928
* [OPENMP] Do not mark local variables as declare target.Alexey Bataev2018-07-091-1/+5
| | | | | | | | | When the parsing of the functions happens inside of the declare target region, we may erroneously mark local variables as declare target thought they are not. This attribute can be applied only to global variables. llvm-svn: 336592
* [OPENMP] Fix incomplete type check for array reductionsJoel E. Denny2018-06-281-1/+1
| | | | | | | | | | | A reduction for an incomplete array type used to produce an assert fail during codegen. Now it produces a diagnostic. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D48735 llvm-svn: 335911
* Revert r335907: [OPENMP] Fix incomplete type check for array reductionsJoel E. Denny2018-06-281-1/+1
| | | | | | Sorry, forgot to add commit log attributes again. llvm-svn: 335910
* [OPENMP] Fix incomplete type check for array reductionsJoel E. Denny2018-06-281-1/+1
| | | | | | | A reduction for an incomplete array type used to produce an assert fail during codegen. Now it produces a diagnostic. llvm-svn: 335907
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-124/+124
| | | | | | | | | | | | | | | | | | | 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] Analyze the type of the mapped entity instead of its base.Alexey Bataev2018-05-021-1/+8
| | | | | | | If the mapped entity is a data member, we erroneously checked the type of its base rather than the type of the mapped entity itself. llvm-svn: 331385
* [OPENMP] Do not emit warning for implicitly declared target functions.Alexey Bataev2018-05-021-14/+16
| | | | | | | Since upcoming OpenMP 5.0 functions can be mapped implicitly as declare target and we should not emit warnings for such functions. llvm-svn: 331377
* [OPENMP] Do not emit warning about non-declared target function params.Alexey Bataev2018-04-301-1/+1
| | | | | | | | We should not emit warning that the parameters are not marked as declare target, these declaration are local and cannot be marked as declare target. llvm-svn: 331211
* [OPENMP] Fix -Wunused-lambda-capture. NFCFangrui Song2018-04-181-0/+1
| | | | llvm-svn: 330284
* [OPENMP] Code cleanup and code improvements.Alexey Bataev2018-04-181-997/+998
| | | | llvm-svn: 330270
* [OPENMP] Replace push_back by emplace_back, NFC.Alexey Bataev2018-04-131-2/+2
| | | | llvm-svn: 330042
* [OPENMP] Code cleanup, NFC.Alexey Bataev2018-04-111-29/+31
| | | | llvm-svn: 329843
* [OPENMP] Additional attributes for the pointer parameters.Alexey Bataev2018-04-101-57/+78
| | | | | | Added attributes for better optimization of the OpenMP code. llvm-svn: 329751
* [OPENMP] Codegen for declare target with link clause.Alexey Bataev2018-03-261-6/+18
| | | | | | | | 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, NVPTX] Globalization of the private redeclarations.Alexey Bataev2018-03-201-16/+38
| | | | | | | | 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] Codegen for `omp declare target` construct.Alexey Bataev2018-03-151-5/+9
| | | | | | | | 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
* Re-land "[Sema] Make getCurFunction() return null outside function parsing"Reid Kleckner2018-03-121-40/+40
| | | | | | | | | | | | | | This relands r326965. There was a null dereference in typo correction that was triggered in Sema/diagnose_if.c. We are not always in a function scope when doing typo correction. The fix is to add a null check. LLVM's optimizer made it hard to find this bug. I wrote it up in a not-very-well-editted blog post here: http://qinsb.blogspot.com/2018/03/ub-will-delete-your-null-checks.html llvm-svn: 327334
* Revert "[Sema] Make getCurFunction() return null outside function parsing"Reid Kleckner2018-03-081-40/+40
| | | | | | | | | | This reverts r326965. It seems to have caused repeating test failures in clang/test/Sema/diagnose_if.c on some buildbots. I cannot reproduce the problem, and it's not immediately obvious what the problem is, so let's revert to green. llvm-svn: 326974
* [Sema] Make getCurFunction() return null outside function parsingReid Kleckner2018-03-081-40/+40
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this patch, Sema pre-allocated a FunctionScopeInfo and kept it in the first, always present element of the FunctionScopes stack. This meant that Sema::getCurFunction would return a pointer to this pre-allocated object when parsing code outside a function body. This is pretty much always a bug, so this patch moves the pre-allocated object into a separate unique_ptr. This should make bugs like PR36536 a lot more obvious. As you can see from this patch, there were a number of places that unconditionally assumed they were always called inside a function. However, there are also many places that null checked the result of getCurFunction(), so I think this is a reasonable direction. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D44039 llvm-svn: 326965
* [OPENMP] Treat local variables in CUDA mode as thread local.Alexey Bataev2018-03-021-15/+59
| | | | | | | | In CUDA mode all local variables are actually thread local|threadprivate, not private, and, thus, they cannot be shared between threads|lanes. llvm-svn: 326590
* Remove redundant casts. NFCGeorge Burgess IV2018-03-011-1/+1
| | | | | | | | | | | | | | | | | | | 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] Emit warning for non-trivial types in map clauses.Alexey Bataev2018-02-271-2/+7
| | | | | | | If the mapped type is non-trivial, the warning message is emitted for better user experience. llvm-svn: 326251
OpenPOWER on IntegriCloud