]> granicus.if.org Git - clang/commit
[OPENMP][NVPTX]Improve emission of the globalized variables for
authorAlexey Bataev <a.bataev@hotmail.com>
Fri, 2 Nov 2018 14:54:07 +0000 (14:54 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Fri, 2 Nov 2018 14:54:07 +0000 (14:54 +0000)
commit40a12dcd50f1ff99c81616b47662a85c60d8d54d
treed5ef76ad6c9c77e6280e75a39bd5cf6e3dc63989
parent9a556415ec611527466d8eb3b8953e56575e954a
[OPENMP][NVPTX]Improve emission of the globalized variables for
target/teams/distribute regions.

Target/teams/distribute regions exist for all the time the kernel is
executed. Thus, if the variable is declared in their context and then
escape it, we can allocate global memory statically instead of
allocating it dynamically.
Patch captures all the globalized variables in target/teams/distribute
contexts, merges them into the records, one per each target region.
Those records are then joined into the union, one per compilation unit
(to save the global memory). Those units are organized into
2 x dimensional arrays, where the first dimension is
the number of blocks per SM and the second one is the number of SMs.
Runtime functions manage this global memory space between the executing
teams.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@345978 91177308-0d34-0410-b5e6-96231b3b80d8
13 files changed:
include/clang/Basic/LangOptions.def
include/clang/Driver/Options.td
lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
lib/CodeGen/CGOpenMPRuntimeNVPTX.h
lib/Driver/ToolChains/Clang.cpp
lib/Frontend/CompilerInvocation.cpp
test/OpenMP/nvptx_data_sharing.cpp
test/OpenMP/nvptx_distribute_parallel_generic_mode_codegen.cpp
test/OpenMP/nvptx_parallel_codegen.cpp
test/OpenMP/nvptx_parallel_for_codegen.cpp
test/OpenMP/nvptx_target_teams_distribute_parallel_for_codegen.cpp
test/OpenMP/nvptx_target_teams_distribute_parallel_for_simd_codegen.cpp
test/OpenMP/nvptx_teams_codegen.cpp