Commit Graph

14 Commits

Author SHA1 Message Date
Alexey Bataev a4fa0b880a [OPENMP] General code improvements.
llvm-svn: 330140
2018-04-16 17:59:34 +00:00
Alexey Bataev a8a9153a37 [OPENMP] Support for -fopenmp-simd option with compilation of simd loops
only.

Added support for -fopenmp-simd option that allows compilation of
simd-based constructs without emission of OpenMP runtime calls.

llvm-svn: 321560
2017-12-29 18:07:07 +00:00
Jonas Hahnfeld b07931f01d [OpenMP] Fix cancellation point in task with no cancel
With tasks, the cancel may happen in another task. This has a different
region info which means that we can't find it here.

Differential Revision: https://reviews.llvm.org/D30091

llvm-svn: 295474
2017-02-17 18:32:58 +00:00
Jonas Hahnfeld 20fce72f1b [OpenMP] Remove barriers at cancel and cancellation point
This resolves a deadlock with the cancel directive when there is no explicit
cancellation point. In that case, the implicit barrier acts as cancellation
point. After removing the barrier after cancel, the now unmatched barrier for
the explicit cancellation point has to go as well.

This has probably worked before rL255992: With the calls for the explicit
barrier, it was sure that all threads passed a barrier before exiting.

Reported by Simon Convent and Joachim Protze!

Differential Revision: https://reviews.llvm.org/D30088

llvm-svn: 295473
2017-02-17 18:32:51 +00:00
Reid Kleckner 7a2037151c Remove unnecessary x86 backend requirements from OpenMP tests
Clang can generate LLVM IR for x86 without a registered x86 backend.

llvm-svn: 284836
2016-10-21 16:09:20 +00:00
Alexey Bataev 3015bcc62a [OPENMP] Generalize codegen for 'sections'-based directive.
If 'sections' directive has only one sub-section, the code for 'single'-based directive was emitted. Removed this codegen, because it causes crashes in different cases.

llvm-svn: 258495
2016-01-22 08:56:50 +00:00
Alexey Bataev 6f531ec0a2 [OPENMP] Remove explicit call for implicit barrier
#pragma omp parallel needs an implicit barrier that is currently done by an explicit call to __kmpc_barrier. However, the runtime already ensures a barrier in __kmpc_fork_call which currently leads to two barriers per region per thread.
Differential Revision: http://reviews.llvm.org/D15561

llvm-svn: 255992
2015-12-18 10:24:53 +00:00
Alexey Bataev 25e5b44654 [OPENMP] Emit __kmpc_cancel_barrier() and code for 'cancellation point' only if 'cancel' is found.
Patch improves codegen for OpenMP constructs. If the OpenMP region does not have internal 'cancel' construct, a call to 'void __kmpc_barrier()' runtime function is generated for all implicit/explicit barriers. If the region has inner 'cancel' directive, then
```
if (__kmpc_cancel_barrier())
  exit from outer construct;
```
code is generated.
Also, the code for 'canellation point' directive is not generated if parent directive does not have 'cancel' directive.

llvm-svn: 247681
2015-09-15 12:52:43 +00:00
Adrian Prantl bc068586ac Revert "Revert r241620 and follow-up commits" and move the initialization
of the llvm targets from clang/CodeGen into ClangCheck.cpp and CIndex.cpp.

llvm-svn: 241653
2015-07-08 01:00:30 +00:00
Adrian Prantl 142ec39739 Revert r241620 and follow-up commits while investigating linux buildbot failures.
llvm-svn: 241642
2015-07-07 23:19:46 +00:00
Adrian Prantl 726855a8da Update testcases that use precompiled headers to require a target after
r241620.

llvm-svn: 241623
2015-07-07 20:31:18 +00:00
Alexey Bataev 81c7ea0ec3 [OPENMP 4.0] Fixed codegen for 'cancellation point' construct.
Generate the next code for 'cancellation point':
if (__kmpc_cancellationpoint()) {
  __kmpc_cancel_barrier();
  <exit construct>;
}

llvm-svn: 241336
2015-07-03 09:56:58 +00:00
Alexey Bataev bb045d412f [OPENMP 4.0] Fixed test for 'cancellation point' directive.
Added explicit target to pch test

llvm-svn: 241240
2015-07-02 04:36:13 +00:00
Alexey Bataev 0f34da12e4 [OPENMP 4.0] Codegen for 'cancellation point' directive.
The next code is generated for this construct:
```
if (__kmpc_cancellationpoint(ident_t *loc, kmp_int32 global_tid, kmp_int32 cncl_kind) != 0)
  <exit from outer innermost construct>;
```

llvm-svn: 241239
2015-07-02 04:17:07 +00:00