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

Konstantin Pyzhov via cfe-commits cfe-commits at lists.llvm.org
Mon Jun 24 07:40:21 PDT 2019


Author: kpyzhov
Date: Mon Jun 24 07:40:20 2019
New Revision: 364183

URL: http://llvm.org/viewvc/llvm-project?rev=364183&view=rev
Log:
[CUDA][HIP] Don't set comdat attribute for CUDA device stub functions.\nDifferential Revision: https://reviews.llvm.org/D63277

Modified:
    cfe/trunk/lib/CodeGen/CodeGenModule.cpp

Modified: cfe/trunk/lib/CodeGen/CodeGenModule.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenModule.cpp?rev=364183&r1=364182&r2=364183&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenModule.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenModule.cpp Mon Jun 24 07:40:20 2019
@@ -3712,6 +3712,11 @@ static bool shouldBeInCOMDAT(CodeGenModu
   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;
 




More information about the cfe-commits mailing list