summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/DwarfEHPrepare.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-04-10 10:43:45 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-04-10 10:43:45 +0000
commit794ba0dcb7baf17371445b788bf245441d1bbc3d (patch)
tree46c092f1660597a696f87baa74067755f42514bb /llvm/lib/CodeGen/DwarfEHPrepare.cpp
parent8ad3627e194c9da8f748df8abaa4c0e469a953a8 (diff)
downloadbcm5719-llvm-794ba0dcb7baf17371445b788bf245441d1bbc3d.tar.gz
bcm5719-llvm-794ba0dcb7baf17371445b788bf245441d1bbc3d.zip
[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
Diffstat (limited to 'llvm/lib/CodeGen/DwarfEHPrepare.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud