[OPENMP, NVPTX] Improve globalization of the variables captured by value.
authorAlexey Bataev <a.bataev@hotmail.com>
Thu, 15 Mar 2018 18:10:54 +0000 (18:10 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Thu, 15 Mar 2018 18:10:54 +0000 (18:10 +0000)
commitc99042ba973be37d9a5bcbb258f83251bf36b673
tree1a044cc4c4e89e1b16fe04cd607ad1c76ccb8578
parent3dbc362fe295d9c5855223abbd4c7f4e125be614
[OPENMP, NVPTX] Improve globalization of the variables captured by value.

If the variable is captured by value and the corresponding parameter in
the outlined function escapes its declaration context, this parameter
must be globalized. To globalize it we need to get the address of the
original parameter, load the value, store it to the global address and
use this global address instead of the original.

Patch improves globalization for parallel|teams regions + functions in
declare target regions.

llvm-svn: 327654
clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.h
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/test/OpenMP/declare_target_codegen_globalization.cpp [new file with mode: 0644]
clang/test/OpenMP/nvptx_teams_codegen.cpp