Эх сурвалжийг харах

[CUDA][HIP] Don't set comdat attribute for CUDA device stub functions.\nDifferential Revision: https://reviews.llvm.org/D63277

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@364183 91177308-0d34-0410-b5e6-96231b3b80d8
Konstantin Pyzhov 6 жил өмнө
parent
commit
4fab8765b9

+ 5 - 0
lib/CodeGen/CodeGenModule.cpp

@@ -3712,6 +3712,11 @@ static bool shouldBeInCOMDAT(CodeGenModule &CGM, const Decl &D) {
   if (!CGM.supportsCOMDAT())
     return false;
 
+  // Do not set COMDAT attribute for CUDA/HIP stub functions to prevent
+  // them being "merged" by the COMDAT Folding linker optimization.
+  if (D.hasAttr<CUDAGlobalAttr>())
+    return false;
+
   if (D.hasAttr<SelectAnyAttr>())
     return true;