From 427f570ce1768717bb892e4e85fac4b8be34a3c7 Mon Sep 17 00:00:00 2001 From: Sergei Larin Date: Thu, 28 Jan 2016 18:59:28 +0000 Subject: [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 --- llvm/lib/Transforms/Utils/SplitModule.cpp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'llvm/lib/Transforms/Utils/SplitModule.cpp') 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(&GV)) { + if (const GlobalObject *Base = GA->getBaseObject()) + GVtoClusterMap.unionSets(&GV, Base); + } + // Further only iterate over local GVs. if (!GV.hasLocalLinkage()) return; -- cgit v1.1