aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/CodeGen/CodeGenModule.cpp
diff options
context:
space:
mode:
authorJoseph Huber <huberjn@outlook.com>2025-06-19 07:47:03 -0500
committerGitHub <noreply@github.com>2025-06-19 07:47:03 -0500
commit09e794c4bb138e14b3156d7dbdac0164d9c0327b (patch)
treee2d018ab889f60c5a7e48cebdb3334f1a9eba5f8 /clang/lib/CodeGen/CodeGenModule.cpp
parentc079040eea5ce75a97285003948d141ebaac69e6 (diff)
downloadllvm-09e794c4bb138e14b3156d7dbdac0164d9c0327b.zip
llvm-09e794c4bb138e14b3156d7dbdac0164d9c0327b.tar.gz
llvm-09e794c4bb138e14b3156d7dbdac0164d9c0327b.tar.bz2
[HIP] Emit the CUID value in the module with the new driver (#144570)
Summary: This is a weird point of divergence that was not updated when the new driver switched to using the CUID method, which is also apparently critical for SPIR-V compilation not failing? Somehow if we don't emit this global than the `llvm.compiler.used` global uses AS(0) which makes SPIR-V unhappy, but with this global it's AS(4) which makes it happy. Either way, this should be fixed.
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenModule.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index c27168e..1668881 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -969,7 +969,7 @@ void CodeGenModule::Release() {
llvm::ConstantArray::get(ATy, UsedArray), "__clang_gpu_used_external");
addCompilerUsedGlobal(GV);
}
- if (LangOpts.HIP && !getLangOpts().OffloadingNewDriver) {
+ if (LangOpts.HIP) {
// Emit a unique ID so that host and device binaries from the same
// compilation unit can be associated.
auto *GV = new llvm::GlobalVariable(