summaryrefslogtreecommitdiffstats
path: root/clang/test/OpenMP
Commit message (Collapse)AuthorAgeFilesLines
...
* [OPENMP] Capture references to global variables.Alexey Bataev2017-10-065-31/+65
| | | | | | | | In C++11 variable to global variables are considered as constant expressions and these variables are not captured in the outlined regions. Patch allows capturing of such variables in the OpenMP regions. llvm-svn: 315074
* [OPENMP] Fix mapping|privatization of implicitly captured variables.Alexey Bataev2017-10-052-5/+6
| | | | | | | | If the `defaultmap(tofrom:scalar)` clause is specified, the scalars must be mapped with 'tofrom' modifiers, otherwise they must be captured as firstprivates. llvm-svn: 314995
* [OpenMP] Initial implementation of teams distribute code generationCarlo Bertolli2017-10-047-0/+1722
| | | | | | | | https://reviews.llvm.org/D38371 This patch implements codegen for the combined 'teams distribute" OpenMP pragma and adds regression tests for all its clauses. llvm-svn: 314905
* [OPENMP] Allow use of declare target directive inside structAlexey Bataev2017-10-032-2/+29
| | | | | | | | | | declaration. Patch allows using of the `#pragma omp declare target`| `#pragma omp end declare target` directives inside the structures if we need to mark as declare target only some static members. llvm-svn: 314833
* [OPENMP] Capture argument of `device` clause for target-basedAlexey Bataev2017-10-021-2/+5
| | | | | | | | | | directives. The argument of the `device` clause in target-based executable directives must be captured to support codegen for the `target` directives with the `depend` clauses. llvm-svn: 314686
* [OPENMP] Fix test, NFC.Alexey Bataev2017-10-021-2/+2
| | | | llvm-svn: 314673
* [OPENMP] Simplify codegen for non-offloading code.Alexey Bataev2017-10-028-254/+128
| | | | | | | Simplified and generalized codegen for non-offloading part that works if offloading is failed or condition of the `if` clause is `false`. llvm-svn: 314670
* [OpenMP] Add an additional test for D34888Gheorghe-Teodor Bercea2017-09-271-0/+36
| | | | | | | | | | | | | | Summary: Test for checking if the mapping is performed correctly. This is a test initially included in Patch https://reviews.llvm.org/D29905 Reviewers: Hahnfeld, carlo.bertolli, caomhin, ABataev Reviewed By: Hahnfeld Subscribers: tra, cfe-commits Differential Revision: https://reviews.llvm.org/D38040 llvm-svn: 314303
* Revert commmit 314228.Gheorghe-Teodor Bercea2017-09-261-30/+0
| | | | llvm-svn: 314240
* [OpenMP] Add an additional test for D34888Gheorghe-Teodor Bercea2017-09-261-0/+30
| | | | | | | | | | | | | | Summary: Test for checking if the mapping is performed correctly. This is a test initially included in Patch https://reviews.llvm.org/D29905 Reviewers: Hahnfeld, carlo.bertolli, caomhin Reviewed By: Hahnfeld Subscribers: tra, cfe-commits Differential Revision: https://reviews.llvm.org/D38040 llvm-svn: 314228
* [OPENMP] Fix handling of implicit mapping of array sections.Alexey Bataev2017-09-261-0/+2
| | | | llvm-svn: 314220
* Revert commit 314210.Gheorghe-Teodor Bercea2017-09-261-30/+0
| | | | llvm-svn: 314215
* [OpenMP] Add an additional test for D34888Gheorghe-Teodor Bercea2017-09-261-0/+30
| | | | | | | | | | | | | | Summary: Test for checking if the mapping is performed correctly. This is a test initially included in Patch https://reviews.llvm.org/D29905 Reviewers: Hahnfeld, carlo.bertolli, caomhin Reviewed By: Hahnfeld Subscribers: tra, cfe-commits Differential Revision: https://reviews.llvm.org/D38040 llvm-svn: 314210
* [OPENMP] Generate implicit map|firstprivate clauses for target-basedAlexey Bataev2017-09-2611-394/+174
| | | | | | | | | | directives. If the variable is used in the target-based region but is not found in any private|mapping clause, then generate implicit firstprivate|map clauses for these implicitly mapped variables. llvm-svn: 314205
* [OPENMP] Handle re-declaration of captured variables in CodeGen.Alexey Bataev2017-09-221-1/+1
| | | | | | | | | If the captured variable has re-declaration we may end up with the situation where the captured variable is the re-declaration while the referenced variable is the canonical declaration (or vice versa). In this case we may generate wrong code. Patch fixes this situation. llvm-svn: 313995
* [Atomic][X8664] set max atomic inline width according to the targetWei Mi2017-09-224-12/+12
| | | | | | | | | | | This is to fix PR31620. MaxAtomicInlineWidth is set to 128 for x86_64. However for target without cx16 support, 128 atomic operation will generate __sync_* libcalls. The patch set MaxAtomicInlineWidth to 64 if the target doesn't support cx16. Differential Revision: https://reviews.llvm.org/D38046 llvm-svn: 313992
* [OPENMP] Use canonical declarations for redeclarations checks.Alexey Bataev2017-09-212-4/+4
| | | | | | | | | If the captured variable has some redeclarations we may run into the situation where the redeclaration is used instead of the canonical declaration and we may consider this variable as one not captured before. llvm-svn: 313880
* [OPENMP] Support for re-declarations when checking captured variables.Alexey Bataev2017-09-201-1/+4
| | | | | | | Need to check for variables re-declarations when checking that the variable was already captured in the captured region. llvm-svn: 313805
* [OpenMP] fix seg-faults printing diagnostics with invalid ordered(n) valuesRachel Craik2017-09-191-0/+8
| | | | | | | | | | | When the value specified for n in ordered(n) is larger than the number of loops a segmentation fault can occur in one of two ways when attempting to print out a diagnostic for an associated depend(sink : vec): 1) The iteration vector vec contains less than n items 2) The iteration vector vec contains a variable that is not a loop control variable This patch addresses both of these issues. Differential Revision: https://reviews.llvm.org/D38049 llvm-svn: 313675
* [OPENMP] Fix types for the target specific parameters in debug mode.Alexey Bataev2017-09-131-27/+34
| | | | | | | Used incorrect types for target specific parameters in debug mode, should use original pointers rather than the pointee types. llvm-svn: 313186
* [OPENMP] Allow all classes as mappable types.Alexey Bataev2017-09-1313-80/+80
| | | | | | | According to upcoming OpenMP 5.0 all classes/structs are now considered as mappable, even polymorphic and with static members. llvm-svn: 313141
* [OPENMP] Fix for PR33922: New ident_t flags forAlexey Bataev2017-09-064-11/+11
| | | | | | | | | | | | __kmpc_for_static_fini(). Added special flags for calls of __kmpc_for_static_fini(), like previous ly for __kmpc_for_static_init(). Added flag OMP_IDENT_WORK_DISTRIBUTE for distribute cnstruct, OMP_IDENT_WORK_SECTIONS for sections-based constructs and OMP_IDENT_WORK_LOOP for loop-based constructs in location flags. llvm-svn: 312642
* [OPENMP] Fix for PR34445: Reduction initializer segfaults at runtime inAlexey Bataev2017-09-061-0/+18
| | | | | | | | | | move constructor. Previously user-defined reduction initializer was considered as an assignment expression, not as initializer. Fixed this by treating the initializer expression as an initializer. llvm-svn: 312638
* [OPENMP] Fix the test, NFC.Alexey Bataev2017-08-311-1/+1
| | | | llvm-svn: 312296
* [OPENMP] Fix for PR34398: assert with random access iterator if theAlexey Bataev2017-08-3121-20/+32
| | | | | | | | | | | | step>1. If the loop is a loot with random access iterators and the iteration construct is represented it += n, then the compiler crashed because of reusing of the same MaterializedTemporaryExpr around N. Patch fixes it by using the expression as written, without any special kind of wrappings. llvm-svn: 312292
* [OPENMP] Capture global variables in all target executable regions.Alexey Bataev2017-08-291-2/+16
| | | | | | | | Capturing of the global variables occurs only in target regions. Patch fixes it and allows capturing of globals in all target executable directives. llvm-svn: 312024
* [OPENMP] Fix for PR34321: ustom OpenMP reduction in C++ template causesAlexey Bataev2017-08-251-0/+18
| | | | | | | | | SEGFAULT at compile time Compiler crashed when tried to rebuild non-template expression in dependent context. llvm-svn: 311777
* Parse and print DIExpressions inline to ease IR and MIR testingReid Kleckner2017-08-231-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Most DIExpressions are empty or very simple. When they are complex, they tend to be unique, so checking them inline is reasonable. This also avoids the need for CodeGen passes to append to the llvm.dbg.mir named md node. See also PR22780, for making DIExpression not be an MDNode. Reviewers: aprantl, dexonsmith, dblaikie Subscribers: qcolombet, javed.absar, eraman, hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D37075 llvm-svn: 311594
* [OPENMP] Fix for PR34014: OpenMP 4.5: Target construct in static methodAlexey Bataev2017-08-221-0/+18
| | | | | | | | | | of class fails to map class static variable. If the global variable is captured and it has several redeclarations, sometimes it may lead to a compiler crash. Patch fixes this by working only with canonical declarations. llvm-svn: 311479
* [OPENMP] Fix for PR28581: OpenMP linear clause - wrong results.Alexey Bataev2017-08-161-0/+1
| | | | | | | | | | If worksharing construct has at least one linear item, an implicit synchronization point must be emitted to avoid possible conflict with the loading/storing values to the original variables. Added implicit barrier if the linear item is found before actual start of the worksharing construct. llvm-svn: 311013
* [OPRNMP] Fix for PR33445: ICE: OpenMP target containing ordered for.Alexey Bataev2017-08-1610-36/+18
| | | | | | | | | | | If exceptions are enabled, there may be a problem with the codegen of the finalization functions from OpenMP runtime. It happens because of the problem with the getting of thread identifier value. Patch tries to fix it by using the result of the call of function __kmpc_global_thread_num() rather than loading of value of outlined function parameter. llvm-svn: 311007
* [OPENMP] Fix compiler crash on argument translate for NVPTX.Alexey Bataev2017-08-151-0/+19
| | | | | | | | When translating arguments for NVPTX target it is not taken into account that function may have variable number of arguments. Patch fixes this problem. llvm-svn: 310920
* [OPENMP] Fix for PR33922: New ident_t flags forAlexey Bataev2017-08-144-13/+17
| | | | | | | | | | | | | __kmpc_for_static_init(). OpenMP 5.0 will include OpenMP Tools interface that requires distinguishing different worksharing constructs. Since the same entry point (__kmp_for_static_init(ident_t *loc, kmp_int32 global_tid,........)) is called in case static loop/sections/distribute it is suggested using 'flags' field of the ident_t structure to pass the type of the construct. llvm-svn: 310865
* [OPENMP][DEBUG] Fix for PR33676: Debug info for OpenMP region is broken.Alexey Bataev2017-08-141-1/+2
| | | | | | | After some changes in clang/LLVM debug info for task-based regions was not generated at all. Patch fixes this problem. llvm-svn: 310850
* [OPENMP] Generalization of calls of the outlined functions.Alexey Bataev2017-08-141-1/+1
| | | | | | General improvement of the outlined functions calls. llvm-svn: 310840
* [OPENMP] Emit non-debug version of outlined functions with originalAlexey Bataev2017-08-094-11/+23
| | | | | | | | | | | name. If the host code is compiled with the debug info, while the target without, there is a problem that the compiler is unable to find the debug wrapper. Patch fixes this problem by emitting special name for the debug version of the code. llvm-svn: 310511
* Sema: disable implicit conversion from _Complex to real types in C++.Tim Northover2017-08-082-86/+0
| | | | | | | | | | | Converting a _Complex type to a real one simply discards the imaginary part. This can easily lead to loss of information so for safety (and GCC compatibility) this patch disallows that when the conversion would be implicit. The one exception is bool, which actually compares both real and imaginary parts and so is safe. llvm-svn: 310427
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-082-36/+131
| | | | | | | | | | | Arguments, passed to the outlined function, must have correct address space info for proper Debug info support. Patch sets global address space for arguments that are mapped and passed by reference. Also, cuda-gdb does not handle reference types correctly, so reference arguments are represented as pointers. llvm-svn: 310387
* Revert "[OPENMP][DEBUG] Set proper address space info if required by target."Alexey Bataev2017-08-082-131/+36
| | | | | | This reverts commit r310377. llvm-svn: 310379
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-082-36/+131
| | | | | | | | | | | Arguments, passed to the outlined function, must have correct address space info for proper Debug info support. Patch sets global address space for arguments that are mapped and passed by reference. Also, cuda-gdb does not handle reference types correctly, so reference arguments are represented as pointers. llvm-svn: 310377
* Revert "[OPENMP][DEBUG] Set proper address space info if required by target."Alexey Bataev2017-08-082-131/+36
| | | | | | This reverts commit r310360. llvm-svn: 310364
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-082-36/+131
| | | | | | | | | | | Arguments, passed to the outlined function, must have correct address space info for proper Debug info support. Patch sets global address space for arguments that are mapped and passed by reference. Also, cuda-gdb does not handle reference types correctly, so reference arguments are represented as pointers. llvm-svn: 310360
* [OpenMP] Error when trying to offload to an unsupported architectureGheorghe-Teodor Bercea2017-08-071-0/+2
| | | | | | | | | | | | | | Summary: Throw an error when offloading is unsupported for a particular target architecture. Reviewers: sfantao, caomhin, carlo.bertolli, ABataev, Hahnfeld Reviewed By: ABataev Subscribers: cfe-commits, rengolin Differential Revision: https://reviews.llvm.org/D32035 llvm-svn: 310307
* [OpenMP] Prevent emission of exception handling code when using OpenMP to ↵Gheorghe-Teodor Bercea2017-08-071-0/+18
| | | | | | | | | | | | | | | | offload to NVIDIA devices. Summary: For the OpenMP toolchain which offloads to NVIDIA GPUs make sure that no exception handling code is emitted. Reviewers: arpith-jacob, sfantao, caomhin, carlo.bertolli, ABataev, Hahnfeld, hfinkel, tstellar Reviewed By: ABataev, Hahnfeld Subscribers: rengolin, Hahnfeld, cfe-commits Differential Revision: https://reviews.llvm.org/D29904 llvm-svn: 310306
* Revert "[OPENMP][DEBUG] Set proper address space info if required by target."Alexey Bataev2017-08-042-113/+13
| | | | | | This reverts commit r310104. llvm-svn: 310135
* [OPENMP][DEBUG] Set proper address space info if required by target.Alexey Bataev2017-08-042-13/+113
| | | | | | | | | | | Arguments, passed to the outlined function, must have correct address space info for proper Debug info support. Patch sets global address space for arguments that are mapped and passed by reference. Also, cuda-gdb does not handle reference types correctly, so reference arguments are represented as pointers. llvm-svn: 310104
* [OPENMP] Unify generation of outlined function calls.Alexey Bataev2017-08-041-2/+2
| | | | llvm-svn: 310098
* Recommit r308327 3rd time: Add a warning for missingAlex Lorenz2017-07-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | '#pragma pack (pop)' and suspicious uses of '#pragma pack' in included files The second recommit (r309106) was reverted because the "non-default #pragma pack value chages the alignment of struct or union members in the included file" warning proved to be too aggressive for external projects like Chromium (https://bugs.chromium.org/p/chromium/issues/detail?id=749197). This recommit makes the problematic warning a non-default one, and gives it the -Wpragma-pack-suspicious-include warning option. The first recommit (r308441) caused a "non-default #pragma pack value might change the alignment of struct or union members in the included file" warning in LLVM itself. This recommit tweaks the added warning to avoid warnings for #includes that don't have any records that are affected by the non-default alignment. This tweak avoids the previously emitted warning in LLVM. Original message: This commit adds a new -Wpragma-pack warning. It warns in the following cases: - When a translation unit is missing terminating #pragma pack (pop) directives. - When entering an included file if the current alignment value as determined by '#pragma pack' directives is different from the default alignment value. - When leaving an included file that changed the state of the current alignment value. rdar://10184173 Differential Revision: https://reviews.llvm.org/D35484 llvm-svn: 309386
* [OPENMP] Allow all lvalues in 'depend' clause.Alexey Bataev2017-07-2714-85/+85
| | | | | | | According to upcoming OpenMP 5.0 all addressable lvalue expressions are allowed in deoend clause. llvm-svn: 309309
* Fix double destruction of objects when OpenMP construct is canceledErich Keane2017-07-271-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an omp for loop is canceled the constructed objects are being destructed twice. It looks like the desired code is: { Obj o; If (cancelled) branch-through-cleanups to cancel.exit. } [cleanups] cancel.exit: __kmpc_for_static_fini br cancel.cont (*) cancel.cont: __kmpc_barrier return The problem seems to be the branch to cancel.cont is currently also going through the cleanups calling them again. This change just does a direct branch instead. Patch By: michael.p.rice@intel.com Differential Revision: https://reviews.llvm.org/D35854 llvm-svn: 309288
OpenPOWER on IntegriCloud