Provides AMDGCN and NVPTX specific specialization of getGPUWarpSize,
getGPUThreadID, and getGPUNumThreads methods. Adds tests for AMDGCN
codegen for these methods in generic and simd modes. Also changes the
precondition in InitTempAlloca to be slightly more permissive. Useful for
AMDGCN OpenMP codegen where allocas are created with a cast to an
address space.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
clang/lib/CodeGen/CGOpenMPRuntimeAMDGCN.cpp | ||
---|---|---|
51 | Move these comments to the header instead and remove them from the .cpp module. | |
clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | ||
43 | Same, move these comments to the header. | |
clang/test/OpenMP/amdgcn_target_codegen.cpp | ||
13 | entry: not always exist in the LLVM IR functions, better not to check for it. | |
19–20 | Do not rely on names for the locals, some release builds do not generate them. Use regexps instead. | |
clang/test/OpenMP/amdgcn_target_init_temp_alloca.cpp | ||
15–16 | same, use regexps instead of %-like names |
clang/lib/CodeGen/CGOpenMPRuntimeGPU.h | ||
---|---|---|
201–206 | Add these notes to the specialized functions too. It is required for better doxygen docs | |
clang/test/OpenMP/amdgcn_target_codegen.cpp | ||
18–20 | Same, the order of these checks should be strict | |
35–36 | It should not be CHECK-DAG, the order of these 2 instructions is defined and the second one should definitely follow the first one | |
clang/test/OpenMP/amdgcn_target_init_temp_alloca.cpp | ||
12 | entry: again | |
16–18 | Do not rely on the names again. Even as part of regexps | |
18 | Just CHECK |
@arsenm , it wasn't possible to post D78495 and this patch separately due to their interdependence. Test "clang/test/OpenMP/amdgcn_target_init_temp_alloca.cpp" below checks for this change.