]> granicus.if.org Git - clang/commit
[OPENMP][NVPTX]Reduce memory usage in orphaned functions.
authorAlexey Bataev <a.bataev@hotmail.com>
Fri, 12 Oct 2018 16:04:20 +0000 (16:04 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Fri, 12 Oct 2018 16:04:20 +0000 (16:04 +0000)
commitc82048c18628e68153419de751c71f909cfc7565
tree0ec5ff77ba73f1ae1d6e98ef562c7c4fd4316c79
parent5f4bbc3ec8c2a6c5a93beb16079e02cc2daa665e
[OPENMP][NVPTX]Reduce memory usage in orphaned functions.

if the function has globalized variables and called in context of
target/teams/distribute regions, it does not need to globalize 32
copies of the same variables for memory coalescing, it is enough to
have just one copy, because there is parallel region.
Patch does this by adding call for `__kmpc_parallel_level` function and
checking its return value. If the code sees that the parallel level is
0, then only one variable is allocated, not 32.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344356 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
lib/CodeGen/CGOpenMPRuntimeNVPTX.h
test/OpenMP/nvptx_target_codegen.cpp