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 | ||
---|---|---|
52 | Move these comments to the header instead and remove them from the .cpp module. | |
clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp | ||
42 | Same, move these comments to the header. | |
clang/test/OpenMP/amdgcn_target_codegen.cpp | ||
14 | entry: not always exist in the LLVM IR functions, better not to check for it. | |
20–21 | 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 | ||
16–17 | 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.