diff options
author | Nick Sarnie <nick.sarnie@intel.com> | 2025-02-11 01:16:40 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-02-10 16:16:40 +0000 |
commit | f3cd2238383f695c719e7eab6aebec828781ec91 (patch) | |
tree | f5ed41e9b08032995444d1f6f35ee022435966f9 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 8380b5c7494e5511dfdc944108ff316453a36061 (diff) | |
download | llvm-f3cd2238383f695c719e7eab6aebec828781ec91.zip llvm-f3cd2238383f695c719e7eab6aebec828781ec91.tar.gz llvm-f3cd2238383f695c719e7eab6aebec828781ec91.tar.bz2 |
[OpenMP][OpenMPIRBuilder] Add initial changes for SPIR-V target frontend support (#125920)
As Intel is working to add support for SPIR-V OpenMP device offloading
in upstream clang/liboffload, we need to modify the OpenMP frontend to
allow SPIR-V as well as generate valid IR for SPIR-V. For example, we
need the frontend to generate code to define and interact with device
globals used in the DeviceRTL.
This is the beginning of what I expect will be (many) other changes, but
let's get started with something simple.
---------
Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index c056d10..7924c32 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -486,8 +486,10 @@ void CodeGenModule::createOpenMPRuntime() { case llvm::Triple::nvptx: case llvm::Triple::nvptx64: case llvm::Triple::amdgcn: - assert(getLangOpts().OpenMPIsTargetDevice && - "OpenMP AMDGPU/NVPTX is only prepared to deal with device code."); + case llvm::Triple::spirv64: + assert( + getLangOpts().OpenMPIsTargetDevice && + "OpenMP AMDGPU/NVPTX/SPIRV is only prepared to deal with device code."); OpenMPRuntime.reset(new CGOpenMPRuntimeGPU(*this)); break; default: |