[PATCH] D63277: [CUDA][HIP] Don't set "comdat" attribute for CUDA device stub functions.

Konstantin Pyzhov via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 19 12:23:54 PDT 2019


kpyzhov updated this revision to Diff 205655.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63277/new/

https://reviews.llvm.org/D63277

Files:
  clang/lib/CodeGen/CodeGenModule.cpp


Index: clang/lib/CodeGen/CodeGenModule.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenModule.cpp
+++ clang/lib/CodeGen/CodeGenModule.cpp
@@ -3706,6 +3706,11 @@
   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;
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63277.205655.patch
Type: text/x-patch
Size: 519 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190619/b2b14767/attachment.bin>


More information about the cfe-commits mailing list