summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaOpenMP.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP]Allow final clause in combined task-based directives.Alexey Bataev2019-10-151-3/+20
| | | | | | | The condition of the final clause must be captured in the combined task-based directives, like 'parallel master taskloop' directive. llvm-svn: 374942
* [OPNEMP]Allow num_tasks clause in combined task-based directives.Alexey Bataev2019-10-141-5/+14
| | | | | | | The expression of the num_tasks clause must be captured in the combined task-based directives, like 'parallel master taskloop' directive. llvm-svn: 374819
* [OPNEMP]Allow grainsize clause in combined task-based directives.Alexey Bataev2019-10-141-8/+97
| | | | | | | The expression of the grainsize clause must be captured in the combined task-based directives, like 'parallel master taskloop' directive. llvm-svn: 374810
* [OPENMP50]Add support for 'parallel master taskloop' construct.Alexey Bataev2019-10-141-1/+124
| | | | | | | | | Added parsing/sema/codegen support for 'parallel master taskloop' constructs. Some of the clauses, like 'grainsize', 'num_tasks', 'final' and 'priority' are not supported in full, only constant expressions can be used currently in these clauses. llvm-svn: 374791
* [OPENMP]Fix codegen for private variably length vars in combinedAlexey Bataev2019-10-141-0/+4
| | | | | | | | | | | constructs. If OpenMP construct includes several capturing regions and the variable is declared as private, the length of the inner variable length array is not captured in outer captured regions, only in the innermost region. Patch fixes this bug. llvm-svn: 374787
* [OPENMP50]Support for 'master taskloop' directive.Alexey Bataev2019-10-101-1/+51
| | | | | | Added full support for master taskloop directive. llvm-svn: 374437
* [CUDA][HIP] Fix host/device check with -fopenmpYaxun Liu2019-10-091-87/+59
| | | | | | | | | | | | | | | | CUDA/HIP program may be compiled with -fopenmp. In this case, -fopenmp is only passed to host compilation to take advantages of multi-threads computation. CUDA/HIP and OpenMP both use Sema::DeviceCallGraph to store functions to be analyzed and remove them once they decide the function is sure to be emitted. CUDA/HIP and OpenMP have different functions to determine if a function is sure to be emitted. To check host/device correctly for CUDA/HIP when -fopenmp is enabled, there needs a unified logic to determine whether a function is to be emitted. The logic needs to be aware of both CUDA and OpenMP logic. Differential Revision: https://reviews.llvm.org/D67837 llvm-svn: 374263
* [OPENMP50]Multiple vendors in vendor context must be treated as logicalAlexey Bataev2019-10-081-2/+2
| | | | | | | | | | | | | and of vendors, not or. If several vendors are provided in the same vendor context trait, the context shall match only if all vendors are matching, not one of them. This is per OpenMP 5.0, 2.3.3 Matching and Scoring Context Selectors, all selectors in the construct, device, and implementation sets of the context selector appear in the corresponding trait set of the OpenMP context. llvm-svn: 374107
* [OPENMP50]Allow functions in declare variant directive to have differentAlexey Bataev2019-10-081-1/+2
| | | | | | | | | | C linkage. After some discussion with OpenMP developers, it was decided that the functions with the different C linkage can be used in declare variant directive. llvm-svn: 374057
* [OPENMP50]Treat range-based for as canonical loop.Alexey Bataev2019-10-071-11/+38
| | | | | | | According to OpenMP 5.0, range-based for is also considered as a canonical form of loops. llvm-svn: 373939
* Properly handle instantiation-dependent array bounds.Richard Smith2019-10-041-2/+3
| | | | | | | | | We previously failed to treat an array with an instantiation-dependent but not value-dependent bound as being an instantiation-dependent type. We now track the array bound expression as part of a constant array type if it's an instantiation-dependent expression. llvm-svn: 373685
* [OPENMP50]Add parsing/sema analysis for declare variant score.Alexey Bataev2019-10-021-1/+16
| | | | | | | | Context selectors may include optional score clause in format `score(<expr>):`, where `<expr>` must be a constant integer expression. Added parsing/sema analysis only. llvm-svn: 373502
* [OPENMP]Fix PR43516: Compiler crash with collapse(2) on non-rectangularAlexey Bataev2019-10-011-5/+13
| | | | | | | | | loop. Missed check if the condition is also dependent when building final expressions for the collapsed loop directives. llvm-svn: 373348
* [OPENMP50]Do not emit warning for the function with the currentlyAlexey Bataev2019-09-301-2/+3
| | | | | | | | | defined body. If the function is currently defined, we should not emit a warning that it might be emitted already because it was not really emitted. llvm-svn: 373243
* [OPENMP] Fix comment, NFC.Alexey Bataev2019-09-301-1/+1
| | | | llvm-svn: 373210
* [OpenMP 5.0] Fix user-defined mapper lookup in semaMichael Kruse2019-09-261-3/+11
| | | | | | | | | | | | This patches fixes the case when a user-defined mapper is attached to the elements of an array, and to report error when a mapper is used for types other than struct, class, and union. Patch by Lingda Li <lildmh@gmail.com> Differential Revision: https://reviews.llvm.org/D67978 llvm-svn: 373023
* [OPENMP50]Emit warnings if the functions was defined/used before markedAlexey Bataev2019-09-261-4/+8
| | | | | | | | | declare variant. We can use the original function if it was used/emitted already. So, just use warnings for these cases, not errors. llvm-svn: 373010
* [OPENMP50]Parsing/sema support for 'implementation/vendor' contextAlexey Bataev2019-09-251-5/+8
| | | | | | | | | selector. Added basic parsing/semantic support for 'implementation={vendor(<vendor>)}' context selector. llvm-svn: 372917
* [OPENMP]Use standard parsing for 'match' clause, NFC.Alexey Bataev2019-09-231-0/+7
| | | | | | | Reused standard clauses parsing scheme for parsing/matching 'match' clause in 'declare variant' directive. llvm-svn: 372635
* [OPENMP5.0]Allow multiple context selectors in the context selectorAlexey Bataev2019-09-181-31/+32
| | | | | | | | | sets. According to OpenMP 5.0, context selector set might include several context selectors, separated with commas. Patch fixes this problem. llvm-svn: 372235
* [OPENMP5.0]Introduce attribute for declare variant directive.Alexey Bataev2019-09-171-1/+37
| | | | | | | | Added attribute for declare variant directive. It will allow to handle declare variant directive at the codegen and will allow to add extra checks. llvm-svn: 372147
* [OPENMP]Fix parsing/sema for function templates with declare simd.Alexey Bataev2019-09-161-1/+1
| | | | | | | | Need to return original declaration group with FunctionTemplateDecl, not the inner FunctionDecl, to correctly handle parsing of directives with the templates parameters. llvm-svn: 372011
* [OPENMP5.0]Add basic support for declare variant directive.Alexey Bataev2019-09-131-2/+211
| | | | | | | Added basic support for declare variant directive and its match clause with user context selector. llvm-svn: 371892
* [NFCI]Create CommonAttributeInfo Type as base type of *Attr and ParsedAttr.Erich Keane2019-09-131-6/+12
| | | | | | | | | | | | In order to enable future improvements to our attribute diagnostics, this moves info from ParsedAttr into CommonAttributeInfo, then makes this type the base of the *Attr and ParsedAttr types. Quite a bit of refactoring took place, including removing a bunch of redundant Spelling Index propogation. Differential Revision: https://reviews.llvm.org/D67368 llvm-svn: 371875
* [OPENMP] Update the diagnosis message for canonical loop form, by ChiAlexey Bataev2019-09-111-15/+16
| | | | | | | | | | | | | | | Chun Chen. The previous patch (https://reviews.llvm.org/D54441) support the relational-op != very well for openmp canonical loop form, however, it didn't update the diagnosis message. So this patch is simply update the diagnosis message by adding !=, update the test related to it, and update the section number for canonical loop form for OpenMP 5.0 in comment. Differential Revision: https://reviews.llvm.org/D66559 llvm-svn: 371631
* [OPENMP5.0]Allow teams directive outside of the target directives.Alexey Bataev2019-09-101-1/+4
| | | | | | | According to OpenMP 5.0, teams directives are allowed not only in the target context, but also in the implicit parallel regions. llvm-svn: 371553
* [OPENMP5.0]Add support for device_type clause in declare targetAlexey Bataev2019-08-231-41/+249
| | | | | | | | | | construct. OpenMP 5.0 introduced new clause for declare target directive, device_type clause, which may accept values host, nohost, and any. Host means that the function must be emitted only for the host, nohost - only for the device, and any - for both, device and the host. llvm-svn: 369775
* [OPENMP]Generalization of handling of declare target attribute.Alexey Bataev2019-08-221-1/+1
| | | | | | | Used OMPDeclareTargetDeclAttr::isDeclareTargetDeclaration instead of direct checking of the OMPDeclareTargetDeclAttr attribute. llvm-svn: 369668
* [OpenMP] Permit map with DSA on combined directiveJoel E. Denny2019-08-221-21/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | For `map`, the following restriction changed in OpenMP 5.0: * OpenMP 4.5 [2.15.5.1, Restrictions]: "A list item cannot appear in both a map clause and a data-sharing attribute clause on the same construct. * OpenMP 5.0 [2.19.7.1, Restrictions]: "A list item cannot appear in both a map clause and a data-sharing attribute clause on the same construct unless the construct is a combined construct." This patch removes this restriction in the case of combined constructs and OpenMP 5.0, and it updates Sema not to capture a scalar by copy in the target region when `firstprivate` and `map` appear for that scalar on a combined target construct. This patch also adds a fixme to a test that now reveals that a diagnostic about loop iteration variables is dropped in the case of OpenMP 5.0. That bug exists regardless of this patch's changes. Reviewed By: ABataev, jdoerfert, hfinkel, kkwli0 Differential Revision: https://reviews.llvm.org/D65835 llvm-svn: 369619
* [OPENMP]Fix delayed diagnostics for standalone declare target directive.Alexey Bataev2019-08-201-6/+13
| | | | | | | If the function is marked as declare target in a standalone directive, the delayed diagnostics is not emitted. Patch fixes this problem. llvm-svn: 369432
* Fix name of the error message, NFC.Alexey Bataev2019-08-201-1/+1
| | | | llvm-svn: 369418
* [OPENMP5.0]Diagnose global variables in lambda not marked as declareAlexey Bataev2019-08-161-2/+24
| | | | | | | | target. According to OpenMP 5.0, if a lambda declaration and definition appears between a declare target directive and the matching end declare target directive, all variables that are captured by the lambda expression must also appear in a to clause. llvm-svn: 369146
* Stop abusing SuppressAllDiagnostics when speculatively determiningRichard Smith2019-08-161-11/+11
| | | | | | whether an expression would be valid during error recovery. llvm-svn: 369145
* [Clang] Migrate llvm::make_unique to std::make_uniqueJonas Devlieghere2019-08-141-2/+2
| | | | | | | | | | Now that we've moved to C++14, we no longer need the llvm::make_unique implementation from STLExtras.h. This patch is a mechanical replacement of (hopefully) all the llvm::make_unique instances across the monorepo. Differential revision: https://reviews.llvm.org/D66259 llvm-svn: 368942
* [OPENMP]Support for non-rectangular loops.Alexey Bataev2019-08-141-84/+447
| | | | | | | | Added basic support for non-rectangular loops. It requires an additional analysis of min/max boundaries for non-rectangular loops. Since only linear dependency is allowed, we can do this analysis. llvm-svn: 368903
* [OPENMP]Add support for analysis of linear variables and step.Alexey Bataev2019-08-081-0/+9
| | | | | | | | | | | | | | | | | Summary: Added support for basic analysis of the linear variables and linear step expression. Linear loop iteration variables must be excluded from this analysis, only non-loop iteration variables must be analyzed. Reviewers: NoQ Subscribers: guansong, cfe-commits, caomhin, kkwli0 Tags: #clang Differential Revision: https://reviews.llvm.org/D65461 llvm-svn: 368295
* [OPENMP]Fix sharing of threadprivate variables with TLS support.Alexey Bataev2019-07-181-0/+7
| | | | | | | | | If the threadprivate variable is used in the copyin clause on inner parallel directive with TLS support, we capture this variable in all outer OpenMP scopes. It leads to the fact that in all scopes we're working with the original variable, not the threadprivate copies. llvm-svn: 366483
* [OPENMP]Provide correct data sharing attributes for loop controlAlexey Bataev2019-07-181-45/+55
| | | | | | | | | | | | variables. Loop control variables are private in loop-based constructs and we shall take this into account when generate the code for inner constructs. Currently, those variables are reported as shared in many cases. Moved the analysis of the data-sharing attributes of the loop control variable to an early semantic stage to correctly handle their attributes. llvm-svn: 366474
* [OPENMP]Fix crash in LoopCounterRefChecker when MemberExpr is not Var or FieldMike Rice2019-07-171-1/+2
| | | | | | | | | | checkDecl is only valid for VarDecls or FieldDecls, since getCanonicalDecl expects only these. Prevent other Decl kinds (such as CXXMethodDecls and EnumConstantDecls) from entering and asserting. Differential Revision: https://reviews.llvm.org/D64842 llvm-svn: 366336
* Fix parameter name comments using clang-tidy. NFC.Rui Ueyama2019-07-161-2/+2
| | | | | | | | | | | | | | | | | | | | | This patch applies clang-tidy's bugprone-argument-comment tool to LLVM, clang and lld source trees. Here is how I created this patch: $ git clone https://github.com/llvm/llvm-project.git $ cd llvm-project $ mkdir build $ cd build $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug \ -DLLVM_ENABLE_PROJECTS='clang;lld;clang-tools-extra' \ -DCMAKE_EXPORT_COMPILE_COMMANDS=On -DLLVM_ENABLE_LLD=On \ -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ../llvm $ ninja $ parallel clang-tidy -checks='-*,bugprone-argument-comment' \ -config='{CheckOptions: [{key: StrictMode, value: 1}]}' -fix \ ::: ../llvm/lib/**/*.{cpp,h} ../clang/lib/**/*.{cpp,h} ../lld/**/*.{cpp,h} llvm-svn: 366177
* [OPENMP]Improve handling of analysis of unsupported VLAs in reductions.Alexey Bataev2019-07-111-4/+8
| | | | | | | | | Fixed the processing of the unsupported VLAs in the reduction clauses. Used targetDiag if the diagnostics can be delayed and emit it immediately if the target does not support VLAs and we're parsing target directive with the reduction clauses. llvm-svn: 365821
* [OPENMP]Improve error message for device unsupported types.Alexey Bataev2019-07-081-2/+3
| | | | | | | Provide more data to the user in the error message about unsupported type for device compilation. llvm-svn: 365374
* [OPENMP]Fix handling of lambda captures in target regions.Alexey Bataev2019-07-011-53/+44
| | | | | | | | Previously, lambda captures were processed in the function called during capturing the variables. It leads to the recursive functions calls and may result in the compiler crash. llvm-svn: 364820
* [OPENMP]Improve analysis of implicit captures.Alexey Bataev2019-06-281-20/+38
| | | | | | | | | If the variable is used in the OpenMP region implicitly, we need to check the data-sharing attributes for such variables and generate implicit clauses for them. Patch improves analysis of such variables for better handling of data-sharing rules. llvm-svn: 364683
* [OPENMP]Fix top DSA for static members.Alexey Bataev2019-06-281-3/+15
| | | | | | | | | Fixed handling of the data-sharing attributes for static members when requesting top most attribute. Previously, it might return the incorrect attributes for static members if they were overriden in the outer constructs. llvm-svn: 364655
* [OPENMP]Fix DSA for loop iteration variables in simd loops.Alexey Bataev2019-06-281-1/+3
| | | | | | | | | | | | According to the OpenMP 5.0 standard, the loop iteration variable in the associated for-loop of a simd construct with just one associated for-loop may be listed in a private, lastprivate, or linear clause with a linear-step that is the increment of the associated for-loop. Also, the loop teration variables in the associated for-loops of a simd construct with multiple associated for-loops may be listed in a private or lastprivate clause. llvm-svn: 364650
* [OPENMP]Fix checks for DSA in simd constructs.Alexey Bataev2019-06-281-2/+2
| | | | | | | | The errors for incorrectly specified data-sharing attributes for simd constructs must be emitted only for the explicitly provided clauses, not the predetermined ones. llvm-svn: 364647
* [OPENMP]Fix PR42159: do not capture threadprivate variables.Alexey Bataev2019-06-211-2/+5
| | | | | | | The threadprivate variables should not be captured in the outlined regions, otherwise it leads to the compiler crash. llvm-svn: 364061
* [OPENMP]Use host's long double when compiling the code for device.Alexey Bataev2019-06-181-1/+3
| | | | | | | | | The device code must use the same long double type as the host. Otherwise the code cannot be linked and executed properly. Patch adds only basic support and checks for supporting of the host long double double on the device. llvm-svn: 363717
* [OpenMP] Avoid emitting maps for target link variables when unified memory ↵Gheorghe-Teodor Bercea2019-06-141-1/+2
| | | | | | | | | | | | | | | | | | is used Summary: This patch avoids the emission of maps for target link variables when unified memory is present. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60883 llvm-svn: 363435
OpenPOWER on IntegriCloud