llvm-project/clang/test
Alexey Bataev 794ba0dcb7 [OPENMP] Codegen for 'reduction' clause in 'parallel' directive.
Emit a code for reduction clause. Next code should be emitted for reductions:

static kmp_critical_name lock = { 0 };

void reduce_func(void *lhs[<n>], void *rhs[<n>]) {
  ...
  *(Type<i> *)lhs[i] = RedOp<i>(*(Type<i> *)lhs[i], *(Type<i> *)rhs[i]);
  ...
}

... void *RedList[<n>] = {&<RHSExprs>[0], ..., &<RHSExprs>[<n> - 1]};
switch (__kmpc_reduce{_nowait}(<loc>, <gtid>, <n>, sizeof(RedList), RedList, reduce_func, &<lock>)) {
case 1:
  ...
  <LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]);
  ...
  __kmpc_end_reduce{_nowait}(<loc>, <gtid>, &<lock>);
  break;
case 2:
  ...
  Atomic(<LHSExprs>[i] = RedOp<i>(*<LHSExprs>[i], *<RHSExprs>[i]));
  ...
  break;
default:
  ;
}
Reduction variables are a kind of a private variables, they have private copies, but initial values are chosen in accordance with the reduction operation.

Differential Revision: http://reviews.llvm.org/D8915

llvm-svn: 234583
2015-04-10 10:43:45 +00:00
..
ARCMT [Objective-C SDK modernizer]. Patch to convert setter/getter 2015-04-02 21:36:03 +00:00
ASTMerge
Analysis [analyzer] Add test for previous commit. 2015-03-30 20:18:04 +00:00
CXX Generate a diagnostic when a catch handler cannot execute due to class hierarchy inversion with regards to other catch handlers for the same block. 2015-04-08 00:05:29 +00:00
CodeCompletion
CodeGen Remove threshold for inserting lifetime markers for named temporaries 2015-04-10 10:13:52 +00:00
CodeGenCUDA Fix addrspace when emitting constructors of static local variables 2015-03-25 20:06:28 +00:00
CodeGenCXX Remove threshold for inserting lifetime markers for named temporaries 2015-04-10 10:13:52 +00:00
CodeGenObjC Remove threshold for inserting lifetime markers for named temporaries 2015-04-10 10:13:52 +00:00
CodeGenObjCXX Remove threshold for inserting lifetime markers for named temporaries 2015-04-10 10:13:52 +00:00
CodeGenOpenCL Remove the cl-no-signed-zeros cc1 option 2015-04-04 14:54:24 +00:00
Coverage clang/test/Coverage/html-diagnostics.c: Use find(1) to avoid globbing. 2014-11-04 13:05:10 +00:00
CoverageMapping InstrProf: Handle whitespace and comments at the ends of macros 2015-03-25 04:13:49 +00:00
Driver Fix typo in test. There is no %clangcxx, but there is %clangxx. 2015-04-10 07:43:19 +00:00
FixIt Unify warnings/errors from "maybe you meant" to "did you mean". 2015-04-02 22:10:06 +00:00
Format
Frontend Fix typo in my last commit. 2015-03-03 00:12:08 +00:00
Headers Make this test not rely on a backend being registered. 2015-04-03 01:27:02 +00:00
Index [libclang] Fix crash when code-completing inside constructor initializer for a builtin type. 2015-03-13 07:39:30 +00:00
Integration
Layout PR6037 2015-01-19 01:44:02 +00:00
Lexer [lex] Don't read past the end of the buffer 2015-03-29 14:11:37 +00:00
Misc Generate a diagnostic when a catch handler cannot execute due to class hierarchy inversion with regards to other catch handlers for the same block. 2015-04-08 00:05:29 +00:00
Modules [modules] Allow a function template definition if we have a pre-existing but not visible definition of the same template. 2015-03-27 21:57:41 +00:00
OpenMP [OPENMP] Codegen for 'reduction' clause in 'parallel' directive. 2015-04-10 10:43:45 +00:00
PCH Run dos2unix on test/PCH/cxx1y-lambdas.mm 2015-04-01 20:21:34 +00:00
Parser [parse] Don't crash on alternative operator spellings from macros in c++11 attributes. 2015-03-29 19:25:07 +00:00
Preprocessor [ARM] add support for Cortex-R4/R4F 2015-04-09 14:12:10 +00:00
Profile Fix this test so it doesn't try to open a file to write to the source tree 2015-04-06 16:33:18 +00:00
Rewriter [Objective-C modern translation]. Patch to fix type of 2015-04-09 18:36:50 +00:00
Sema [Sema] Correctly recurse when looking for [*] in function definitions 2015-04-07 22:08:51 +00:00
SemaCUDA Ignore device-side asm constraint errors while compiling CUDA code for host and vice versa. 2015-03-19 18:40:25 +00:00
SemaCXX [Sema] Don't assume that an initializer list has an initializer 2015-04-10 04:52:06 +00:00
SemaObjC [Objective-C Sema] It is permissable to bridge cast to 'id' 2015-04-09 23:39:53 +00:00
SemaObjCXX Recognize objc_bridge(id) on bridged casts to CF types. 2015-03-10 18:41:23 +00:00
SemaOpenCL Restores r228382, which was reverted in r228406. 2015-02-25 05:48:23 +00:00
SemaTemplate Use the most recent previous decl to check if inline is added after a definition 2015-04-08 00:04:47 +00:00
TableGen
Tooling Remove "REQUIRES:shell" from tests. They work for me. 2014-11-04 13:41:33 +00:00
Unit
VFS DebugInfo: Move new hierarchy into place (clang) 2015-03-03 17:25:55 +00:00
.clang-format
CMakeLists.txt Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
Makefile Fix makefile for debuginfo-tests execution. 2014-10-17 23:50:47 +00:00
TestRunner.sh
cxx-sections.data
lit.cfg Check for backtraces in tests which are verifying pretty stack traces from a crashing clang. 2015-02-10 19:53:38 +00:00
lit.site.cfg.in Check for backtraces in tests which are verifying pretty stack traces from a crashing clang. 2015-02-10 19:53:38 +00:00
make_test_dirs.pl