diff options
| author | Peter Collingbourne <peter@pcc.me.uk> | 2017-11-30 23:05:52 +0000 |
|---|---|---|
| committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-11-30 23:05:52 +0000 |
| commit | 1f03422610aacbc5b15a8b1a64805d1643a02f85 (patch) | |
| tree | 364121e415d4f44bc8200abf8fe3861db18b9e58 /llvm/test/Transforms/ThinLTOBitcodeWriter | |
| parent | f0e4c6a819799ef578cba48df890d15441ad3f9a (diff) | |
| download | bcm5719-llvm-1f03422610aacbc5b15a8b1a64805d1643a02f85.tar.gz bcm5719-llvm-1f03422610aacbc5b15a8b1a64805d1643a02f85.zip | |
ThinLTOBitcodeWriter: Try harder to discard unused references to the merged module.
If the thin module has no references to an internal global in the
merged module, we need to make sure to preserve that property if the
global is a member of a comdat group, as otherwise promotion can end
up adding global symbols to the comdat, which is not allowed.
This situation can arise if the external global in the thin module
has dead constant users, which would cause use_empty() to return
false and would cause us to try to promote it. To prevent this from
happening, discard the dead constant users before asking whether a
global is empty.
Differential Revision: https://reviews.llvm.org/D40593
llvm-svn: 319494
Diffstat (limited to 'llvm/test/Transforms/ThinLTOBitcodeWriter')
| -rw-r--r-- | llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll b/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll index 48f2900da36..eb0cbe78a73 100644 --- a/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll +++ b/llvm/test/Transforms/ThinLTOBitcodeWriter/filter-alias.ll @@ -1,7 +1,9 @@ ; RUN: opt -thinlto-bc -o %t %s ; RUN: llvm-modextract -n 0 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK0 %s ; RUN: llvm-modextract -n 1 -o - %t | llvm-dis | FileCheck --check-prefix=CHECK1 %s +; CHECK0-NOT: @{{.*}}anon{{.*}}= ; CHECK0: @al = external global i8* +; CHECK0-NOT: @{{.*}}anon{{.*}}= ; CHECK1: @al = unnamed_addr alias i8*, target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" |

