Skip to content

Commit 09e794c

Browse files
authored
[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.
1 parent c079040 commit 09e794c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clang/lib/CodeGen/CodeGenModule.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -969,7 +969,7 @@ void CodeGenModule::Release() {
969969
llvm::ConstantArray::get(ATy, UsedArray), "__clang_gpu_used_external");
970970
addCompilerUsedGlobal(GV);
971971
}
972-
if (LangOpts.HIP && !getLangOpts().OffloadingNewDriver) {
972+
if (LangOpts.HIP) {
973973
// Emit a unique ID so that host and device binaries from the same
974974
// compilation unit can be associated.
975975
auto *GV = new llvm::GlobalVariable(

0 commit comments

Comments
 (0)