diff options
author | Konstantin Pyzhov <konstantin.pyzhov@gmail.com> | 2019-06-24 14:40:20 +0000 |
---|---|---|
committer | Konstantin Pyzhov <konstantin.pyzhov@gmail.com> | 2019-06-24 14:40:20 +0000 |
commit | 15e678e8438c56703c775fcb45afb25e09b31cff (patch) | |
tree | 9ef56409b6066e501609b8a7488337e8bdbde893 /clang/lib/CodeGen/CodeGenModule.cpp | |
parent | 942404d01b7d2cbea037f9af2f2f9335ffeaa199 (diff) | |
download | bcm5719-llvm-15e678e8438c56703c775fcb45afb25e09b31cff.tar.gz bcm5719-llvm-15e678e8438c56703c775fcb45afb25e09b31cff.zip |
[CUDA][HIP] Don't set comdat attribute for CUDA device stub functions.\nDifferential Revision: https://reviews.llvm.org/D63277
llvm-svn: 364183
Diffstat (limited to 'clang/lib/CodeGen/CodeGenModule.cpp')
-rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index d0f62beed96..87a1d45abf4 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/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; |