diff options
author | Saiyedul Islam <Saiyedul.Islam@amd.com> | 2020-08-03 05:29:48 +0000 |
---|---|---|
committer | Saiyedul Islam <Saiyedul.Islam@amd.com> | 2020-08-03 05:38:39 +0000 |
commit | 160ff83765ac284f3c7dd7b25d4ef105b9952ac0 (patch) | |
tree | bafad248636a86742b0d58e335c539183ef10136 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 40da58a04bea6879e1b52a4ba35559f9d26bee07 (diff) | |
download | llvm-160ff83765ac284f3c7dd7b25d4ef105b9952ac0.zip llvm-160ff83765ac284f3c7dd7b25d4ef105b9952ac0.tar.gz llvm-160ff83765ac284f3c7dd7b25d4ef105b9952ac0.tar.bz2 |
[OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 3
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.
Reviewed By: ABataev
Differential Revision: https://reviews.llvm.org/D84260
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 48a1ddd..f3712ea 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -19,6 +19,7 @@ #include "CGObjCRuntime.h" #include "CGOpenCLRuntime.h" #include "CGOpenMPRuntime.h" +#include "CGOpenMPRuntimeAMDGCN.h" #include "CGOpenMPRuntimeNVPTX.h" #include "CodeGenFunction.h" #include "CodeGenPGO.h" @@ -215,6 +216,11 @@ void CodeGenModule::createOpenMPRuntime() { "OpenMP NVPTX is only prepared to deal with device code."); OpenMPRuntime.reset(new CGOpenMPRuntimeNVPTX(*this)); break; + case llvm::Triple::amdgcn: + assert(getLangOpts().OpenMPIsDevice && + "OpenMP AMDGCN is only prepared to deal with device code."); + OpenMPRuntime.reset(new CGOpenMPRuntimeAMDGCN(*this)); + break; default: if (LangOpts.OpenMPSimd) OpenMPRuntime.reset(new CGOpenMPSIMDRuntime(*this)); |