summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP]Remove not used check line from the test, NFC.Alexey Bataev2019-07-101-1/+0
| | | | llvm-svn: 365691
* [OPENMP]Fix the float point semantics handling on the device.Alexey Bataev2019-07-092-7/+7
| | | | | | | | | | The device should use the same float point representation as the host. Previous patch fixed the handling of the sizes of the float point types, but did not fixed the fp semantics. This patch makes target device to use the host fp semantics. this is required for the correct data transfer between host and device and correct codegen. llvm-svn: 365485
* [OPENMP]Improve error message for device unsupported types.Alexey Bataev2019-07-081-2/+2
| | | | | | | Provide more data to the user in the error message about unsupported type for device compilation. llvm-svn: 365374
* [OPENMP]Add -Wunintialized to the erroneous tests for future fix PR42392,Alexey Bataev2019-07-08484-1954/+2074
| | | | | | NFC. llvm-svn: 365334
* [OPENMP]Fix handling of lambda captures in target regions.Alexey Bataev2019-07-011-5/+5
| | | | | | | | 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-2824-40/+40
| | | | | | | | | 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-0/+5
| | | | | | | | | 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-2/+14
| | | | | | | | | | | | 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-1/+10
| | | | | | | | 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]Generate correctly implicit flags for mapped data.Alexey Bataev2019-06-2711-46/+46
| | | | | | | Implicit flag must not be emitted for explicitly specified firstprivate variables, but for implicitly captured sizes of the VLAs. llvm-svn: 364575
* [OPENMP]Fix PR41966: type mismatch in runtime functions.Alexey Bataev2019-06-2536-1045/+1221
| | | | | | | Target-based runtime functions use int64_t type for sizes, while the compiler uses size_t type. It leads to miscompilation in 32 bit mode. llvm-svn: 364327
* [OPENMP]Relax the test checks to pacify 32bit buildbots, NFC.Alexey Bataev2019-06-241-2/+2
| | | | llvm-svn: 364189
* [OPENMP]Fix PR42068: Vla type is not captured.Alexey Bataev2019-06-211-9/+13
| | | | | | | | If the variably modified type is declared outside of the captured region and then used in the cast expression along with array subscript expression, the type is not captured and it leads to the compiler crash. llvm-svn: 364080
* [OPENMP]Fix PR42159: do not capture threadprivate variables.Alexey Bataev2019-06-211-2/+3
| | | | | | | The threadprivate variables should not be captured in the outlined regions, otherwise it leads to the compiler crash. llvm-svn: 364061
* [OpenMP] Add support for handling declare target to clause when unified ↵Gheorghe-Teodor Bercea2019-06-203-40/+66
| | | | | | | | | | | | | | | | | | | | | memory is required Summary: This patch adds support for the handling of the variables under the declare target to clause. The variables in this case are handled like link variables are. A pointer is created on the host and then mapped to the device. The runtime will then copy the address of the host variable in the device pointer. Reviewers: ABataev, AlexEichenberger, caomhin Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63108 llvm-svn: 363959
* [OpenMP] Strengthen regression tests for task allocation under nowait depend ↵Gheorghe-Teodor Bercea2019-06-1914-23/+103
| | | | | | | | | | | | | | | | | | | | | clauses NFC Summary: This patch strengthens the tests introduced in D63009 by: - adding new test for default device ID. - modifying existing tests to pass device ID local variable to the task allocation function. Reviewers: ABataev, Hahnfeld, caomhin, jdoerfert Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63454 llvm-svn: 363809
* [OPENMP]Use host's mangling for 128 bit float types on the device.Alexey Bataev2019-06-181-4/+15
| | | | | | Device have to use the same mangling as the host for 128bit float types. Otherwise, the codegen for the device is unable to find the parent function when it tries to generate the outlined function for the target region and it leads to incorrect compilation and crash at the runtime. llvm-svn: 363734
* [OPENMP][NVPTX]Correct codegen for 128 bit long double.Alexey Bataev2019-06-181-1/+7
| | | | | | If the host uses 128 bit long doubles, the compiler should generate correct code for NVPTX devices. If the return type has 128 bit long doubles, in LLVM IR this type must be coerced to int array instead. llvm-svn: 363720
* [OPENMP]Use host's long double when compiling the code for device.Alexey Bataev2019-06-181-2/+13
| | | | | | | | | 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] Add target task alloc function with device IDGheorghe-Teodor Bercea2019-06-1413-23/+23
| | | | | | | | | | | | | | | | Summary: Add a new call to Clang to perform task allocation for the target. Reviewers: ABataev, AlexEichenberger, caomhin Reviewed By: ABataev, AlexEichenberger Subscribers: openmp-commits, Hahnfeld, guansong, jdoerfert, cfe-commits Tags: #clang, #openmp Differential Revision: https://reviews.llvm.org/D63009 llvm-svn: 363451
* [OpenMP] Avoid emitting maps for target link variables when unified memory ↵Gheorghe-Teodor Bercea2019-06-141-18/+11
| | | | | | | | | | | | | | | | | | 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
* LLVM IR: Generate new-style byval-with-Type from ClangTim Northover2019-06-051-2/+2
| | | | | | | | | | | LLVM IR recently added a Type parameter to the byval Attribute, so that when pointers become opaque and no longer have an element type the information will still be present in IR. For now the Type parameter is optional (which is why Clang didn't need this change at the time), but it will become mandatory soon. llvm-svn: 362652
* Defer capture initialization for captured regions until after we've leftRichard Smith2019-05-311-1/+4
| | | | | | | | | | | | | | | | the captured region scope. This removes a case where we would build expressions (and mark declarations odr-used) in the wrong scope. Remove the now-unused 'capture initializer' field on sema::Capture (except for 'this' captures, which still need to be cleaned up). No functionality change intended (except that we now very slightly more precisely determine whether we need to use a capture or not when another captured region encloses an OpenMP captured region). llvm-svn: 362179
* [OpenMP] Set pragma start loc to `#pragma` locJoel E. Denny2019-05-282-6/+6
| | | | | | | | | | | | | | | This patch adjusts `PragmaOpenMPHandler` to set the location of `tok::annot_pragma_openmp` to the `#pragma` location instead of the `omp` location so that the former becomes the start location of the OpenMP AST node. This can be useful when, for example, rewriting a directive using Clang's Rewrite facility. Most of this patch updates tests for changes to locations in diagnostics and `-ast-dump` output. Reviewed By: ABataev, lebedev.ri, Meinersbur, aaron.ballman Differential Revision: https://reviews.llvm.org/D61509 llvm-svn: 361867
* [OpenMP] Add test for requires and unified shared memory clause with declare ↵Gheorghe-Teodor Bercea2019-05-241-0/+67
| | | | | | | | | | | | | | | | | | | | | target link Summary: This patch adds a test for requires with unified share memory clause when a declare target link is present. This test needs to go in prior to changes to declare target link for comparison purposes. Reviewers: ABataev, caomhin Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62407 llvm-svn: 361658
* [OPENMP]Do not crash for const firstprivates.Alexey Bataev2019-05-231-2/+5
| | | | | | | | | If the variable is a firstprivate variable and it was not emitted beause this a constant variable with the constant initializer, we can use the initial value instead of the variable itself. It also fixes the problem with the compiler crash in this case. llvm-svn: 361564
* [OPENMP]Simplify codegen for the outlined regions.Alexey Bataev2019-05-2328-158/+269
| | | | | | | Simplified codegen for the outlined regions, excluding duplication code for handling variables with the reference types. llvm-svn: 361529
* [OpenMP] Add support for registering requires directives with the runtimeGheorghe-Teodor Bercea2019-05-2132-74/+134
| | | | | | | | | | | | | | | | | | | | | | | Summary: This patch adds support for the registration of the requires directives with the runtime. Each requires directive clause will enable a particular flag to be set. The set of flags is passed to the runtime to be checked for compatibility with other such flags coming from other object files. The registration function is called whenever OpenMP is present even if a requires directive is not present. This helps detect cases in which requires directives are used inconsistently. Reviewers: ABataev, AlexEichenberger, caomhin Reviewed By: ABataev, AlexEichenberger Subscribers: jholewinski, guansong, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60568 llvm-svn: 361298
* [OPENMP]Use the attributes for dso locality when building for device.Alexey Bataev2019-05-215-27/+27
| | | | | | | | | Currently, we ignore all dso locality attributes/info when building for the device and thus all symblos are externally visible and can be preemted at the runtime. It may lead to incorrect results. We need to follow the same logic, compiler uses for static/pie builds. llvm-svn: 361283
* [OPENMP][NVPTX]Mark more functions as always_inline for betterAlexey Bataev2019-05-2121-194/+279
| | | | | | | | | | | performance. Internally generated functions must be marked as always_inlines in most cases. Patch marks some extra reduction function + outlined parallel functions as always_inline for better performance, but only if the optimization is requested. llvm-svn: 361269
* [OPENMP]Fix PR41767: diagnose DSA for variables in clauses with default(none).Alexey Bataev2019-05-098-13/+17
| | | | | | | | | If the combined directive has default(none) clause and has clauses for inner directive that reference some variables, for which data-sharing attributes are not specified, the error messages should be emitted for such variables. llvm-svn: 360365
* [OPENMP]Fix PR41768: check DSA for globals with default(none) clauses.Alexey Bataev2019-05-0937-65/+91
| | | | | | | | If the default(none) was specified for the construct, we might miss diagnostic for the globals without explicitly specified data-sharing attributes. Patch fixes this problem. llvm-svn: 360362
* Revert "[OPENMP]Fix PR41768: check DSA for globals with `default(none)` ↵Roman Lebedev2019-05-0937-69/+65
| | | | | | | | | | | | clauses." This has introduced (exposed?) a crash in clang sema, that does not happen without this patch. I'll followup in the original bugreport and commit with reproducer. This reverts commit r360061. llvm-svn: 360327
* Revert "[OPENMP]Fix PR41767: diagnose DSA for variables in clauses with ↵Roman Lebedev2019-05-097-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | default(none)." This implementation isn't sound as per the standard. It erroneously diagnoses e.g. the following case: ``` $ cat test.cpp void f(int n) { #pragma omp parallel default(none) if(n) ; } ``` ``` $ ./bin/clang -fopenmp test.cpp test.cpp:2:40: error: variable 'n' must have explicitly specified data sharing attributes #pragma omp parallel default(none) if(n) ^ test.cpp:2:31: note: explicit data sharing attribute requested here #pragma omp parallel default(none) if(n) ^ 1 error generated. ``` As per OpenMP Application Programming Interface Version 5.0 November 2018: * 2.19.4.1default Clause The default clause explicitly determines the data-sharing attributes of variables that are referenced *in a parallel, teams, or task generating construct and would otherwise be implicitly determined (see Section 2.19.1.1 on page 270). * 2.6.1 Determining the Number of Threads for a parallel Region Using a variable in an if or num_threads clause expression of a parallel construct causes an implicit reference to the variable in all enclosing constructs. The if clause expression and the num_threads clause expression are evaluated in the context outside of the parallel construct, This reverts commit r360073. llvm-svn: 360326
* [OPENMP]Fix PR41767: diagnose DSA for variables in clauses withAlexey Bataev2019-05-067-12/+16
| | | | | | | | | | | default(none). If the combined directive has default(none) clause and has clauses for inner directive that reference some variables, for which data-sharing attributes are not specified, the error messages should be emitted for such variables. llvm-svn: 360073
* [OPENMP]Fix PR41768: check DSA for globals with `default(none)` clauses.Alexey Bataev2019-05-0637-65/+69
| | | | | | | | If the `default(none)` was specified for the construct, we might miss diagnostic for the globals without explicitly specified data-sharing attributes. Patch fixes this problem. llvm-svn: 360061
* [OPENMP]Fix PR41617: crash on template instantiation.Alexey Bataev2019-04-291-10/+28
| | | | | | | Fixed the crash on the template instantiation when trying to check the data locality in the current instantiation scope. llvm-svn: 359459
* [OPENMP]Added check for non-random access types for the dependent loopAlexey Bataev2019-04-261-1/+27
| | | | | | | | | | | counters. According to the OpenMP 5.0, For any associated loop where the b or lb expression is not loop invariant with respect to the outermost loop, the var-outer that appears in the expression may not have a random access iterator type. llvm-svn: 359340
* [OPENMP] Improved check for the linear dependency in the non-rectangularAlexey Bataev2019-04-251-1/+15
| | | | | | | | | loop nests. Added a checks that the initializer/condition expressions depend only only of the single previous loop iteration variable. llvm-svn: 359200
* [OPENMP][AARCH64]Fix the test for declare simd, NFC.Alexey Bataev2019-04-251-4/+4
| | | | | | | Renamed function a01 in the test to fix possible problems with the git hash match during testing. llvm-svn: 359193
* [OPENMP]Initial support for non-rectangular loop nest.Alexey Bataev2019-04-241-1/+16
| | | | | | | Added basic semantic analysis for the non-rectangular loop nests for OpenMP 5.0 support. llvm-svn: 359132
* [APSInt][OpenMP] Fix isNegative, etc. for unsigned typesJoel E. Denny2019-04-2359-124/+228
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Without this patch, APSInt inherits APInt::isNegative, which merely checks the sign bit without regard to whether the type is actually signed. isNonNegative and isStrictlyPositive call isNegative and so are also affected. This patch adjusts APSInt to override isNegative, isNonNegative, and isStrictlyPositive with implementations that consider whether the type is signed. A large set of Clang OpenMP tests are affected. Without this patch, these tests assume that `true` is not a valid argument for clauses like `collapse`. Indeed, `true` fails APInt::isStrictlyPositive but not APSInt::isStrictlyPositive. This patch adjusts those tests to assume `true` should be accepted. This patch also adds tests revealing various other similar fixes due to APSInt::isNegative calls in Clang's ExprConstant.cpp and SemaExpr.cpp: `++` and `--` overflow in `constexpr`, evaluated object size based on `alloc_size`, `<<` and `>>` shift count validation, and OpenMP array section validation. Reviewed By: lebedev.ri, ABataev, hfinkel Differential Revision: https://reviews.llvm.org/D59712 llvm-svn: 359012
* [OPENMP][NVPTX] target [teams distribute] simd maybe run withoutAlexey Bataev2019-04-192-16/+16
| | | | | | | | | runtime. target [teams distribute] simd costructs do not require full runtime for the correct execution, we can run them without full runtime. llvm-svn: 358766
* [OpenMP][NFC] Fix requires target test.Gheorghe-Teodor Bercea2019-04-181-5/+5
| | | | | | | | | | | | | | | | Summary: Fix requires target test. Reviewers: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60886 llvm-svn: 358711
* [OpenMP] Add checks for requires and target directives.Gheorghe-Teodor Bercea2019-04-182-4/+19
| | | | | | | | | | | | | | | | Summary: The requires directive containing target related clauses must appear before any target region in the compilation unit. Reviewers: ABataev, AlexEichenberger, caomhin Reviewed By: ABataev Subscribers: guansong, jfb, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D60875 llvm-svn: 358709
* [OPENMP][NVPTX]Run combined constructs with if clause in SPMD mode.Alexey Bataev2019-04-175-47/+43
| | | | | | | | All target-parallel-based constructs can be run in SPMD mode from now on. Even if num_threads clauses or if clauses are used, such constructs can be executed in SPMD mode. llvm-svn: 358595
* [OPENMP][NVPTX]Run combined constructs with if clause in SPMD mode.Alexey Bataev2019-04-161-3/+5
| | | | | | | | | Combined constructs with parallel and if clauses without modifiers may be executed in SPMD mode since if the condition is true for the target region, it is also true for parallel region and the threads must be run in parallel. llvm-svn: 358503
* [OPENMP]Require aarch arch for the tests, NFC.Alexey Bataev2019-04-167-0/+7
| | | | llvm-svn: 358493
* [AArch64] Implement Vector Funtion ABI name mangling.Alexey Bataev2019-04-168-0/+369
| | | | | | | | | | | | | | | | | | | Summary: The name mangling scheme is defined in section 3.5 of the "Vector function application binary interface specification for AArch64" [1]. [1] https://developer.arm.com/products/software-development-tools/hpc/arm-compiler-for-hpc/vector-function-abi Reviewers: rengolin, ABataev Reviewed By: ABataev Subscribers: sdesmalen, javed.absar, kristof.beyls, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D60583 llvm-svn: 358490
* [OPENMP][NVPTX]Run parallel regions with num_threads clauses in SPMDAlexey Bataev2019-04-152-56/+43
| | | | | | | | | | mode. After the previous patch with the more correct handling of the number of threads in parallel regions, the parallel regions with num_threads clauses can be executed in SPMD mode. llvm-svn: 358445
OpenPOWER on IntegriCloud