diff options
author | Sergei Larin <slarin@codeaurora.org> | 2016-01-28 18:59:28 +0000 |
---|---|---|
committer | Sergei Larin <slarin@codeaurora.org> | 2016-01-28 18:59:28 +0000 |
commit | 427f570ce1768717bb892e4e85fac4b8be34a3c7 (patch) | |
tree | e527a07a5e7e36bfcfb2844ad9a8f0153cdc92e9 /llvm/lib/Transforms/Utils/SplitModule.cpp | |
parent | bff6b581e20060dcf1f9823562a6eb6f1ec162fc (diff) | |
download | llvm-427f570ce1768717bb892e4e85fac4b8be34a3c7.zip llvm-427f570ce1768717bb892e4e85fac4b8be34a3c7.tar.gz llvm-427f570ce1768717bb892e4e85fac4b8be34a3c7.tar.bz2 |
[SplitModule] In split module utility we should never separate alias with its aliasee.
Summary: When splitting module with preserving locals, we currently do not handle case of global alias being separated with its aliasee.
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D16585
llvm-svn: 259075
Diffstat (limited to 'llvm/lib/Transforms/Utils/SplitModule.cpp')
-rw-r--r-- | llvm/lib/Transforms/Utils/SplitModule.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Utils/SplitModule.cpp b/llvm/lib/Transforms/Utils/SplitModule.cpp index b3d0f52..dcb2307 100644 --- a/llvm/lib/Transforms/Utils/SplitModule.cpp +++ b/llvm/lib/Transforms/Utils/SplitModule.cpp @@ -88,6 +88,13 @@ static void findPartitions(Module *M, ClusterIDMapType &ClusterIDMap, Member = &GV; } + // For aliases we should not separate them from their aliasees regardless + // of linkage. + if (GlobalAlias *GA = dyn_cast<GlobalAlias>(&GV)) { + if (const GlobalObject *Base = GA->getBaseObject()) + GVtoClusterMap.unionSets(&GV, Base); + } + // Further only iterate over local GVs. if (!GV.hasLocalLinkage()) return; |