[clang] [HIP] Do not include the CUID module hash with the new driver (PR #84332)

via cfe-commits cfe-commits at lists.llvm.org
Thu Mar 7 07:26:40 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-clang-codegen

Author: Joseph Huber (jhuber6)

<details>
<summary>Changes</summary>

Summary:
The new driver does not need this hash and it can lead to redefined
symbol errors when the CUID hash isn't set.


---
Full diff: https://github.com/llvm/llvm-project/pull/84332.diff


1 Files Affected:

- (modified) clang/lib/CodeGen/CodeGenModule.cpp (+1-1) 


``````````diff
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp
index d02875c6a86d77..967319bdfc4571 100644
--- a/clang/lib/CodeGen/CodeGenModule.cpp
+++ b/clang/lib/CodeGen/CodeGenModule.cpp
@@ -916,7 +916,7 @@ void CodeGenModule::Release() {
         llvm::ConstantArray::get(ATy, UsedArray), "__clang_gpu_used_external");
     addCompilerUsedGlobal(GV);
   }
-  if (LangOpts.HIP) {
+  if (LangOpts.HIP && !getLangOpts().OffloadingNewDriver) {
     // Emit a unique ID so that host and device binaries from the same
     // compilation unit can be associated.
     auto *GV = new llvm::GlobalVariable(

``````````

</details>


https://github.com/llvm/llvm-project/pull/84332


More information about the cfe-commits mailing list