diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2019-11-21 11:30:43 -0500 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2019-11-25 15:01:28 -0500 |
| commit | bbc328c62430dd3e2e72973ca85c5c6fb550b227 (patch) | |
| tree | 07ec8bcbd6cd255edd565ff05d2b6205dd0dbe87 /clang/lib/CodeGen | |
| parent | 7b86188b50bf6e537fe98b326f258fbd23108b83 (diff) | |
| download | bcm5719-llvm-bbc328c62430dd3e2e72973ca85c5c6fb550b227.tar.gz bcm5719-llvm-bbc328c62430dd3e2e72973ca85c5c6fb550b227.zip | |
[OPENMP]Fix PR41826: symbols visibility in device code.
Summary:
Currently, we ignore all locality attributes/info when building for
the device and thus all symblos are externally visible and can be
preemted at the runtime. It may lead to incorrect results. We need to
follow the same logic, compiler uses for static/pie builds. But in some
cases changing of dso locality may lead to problems with codegen, so
instead mark external symbols as hidden instead in the device code.
Reviewers: jdoerfert
Subscribers: guansong, caomhin, kkwli0, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70549
Diffstat (limited to 'clang/lib/CodeGen')
| -rw-r--r-- | clang/lib/CodeGen/CodeGenModule.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenModule.cpp b/clang/lib/CodeGen/CodeGenModule.cpp index 25268efff61..9793a5ef472 100644 --- a/clang/lib/CodeGen/CodeGenModule.cpp +++ b/clang/lib/CodeGen/CodeGenModule.cpp @@ -815,7 +815,7 @@ static bool shouldAssumeDSOLocal(const CodeGenModule &CGM, const auto &CGOpts = CGM.getCodeGenOpts(); llvm::Reloc::Model RM = CGOpts.RelocationModel; const auto &LOpts = CGM.getLangOpts(); - if (RM != llvm::Reloc::Static && !LOpts.PIE && !LOpts.OpenMPIsDevice) + if (RM != llvm::Reloc::Static && !LOpts.PIE) return false; // A definition cannot be preempted from an executable. |

